/UAV_CONSOLE

A simple CONSOLE

Primary LanguagePython

UAV Console - MAVSDK-Based Drone Control System

Optimized for Typhoon H480 with Gimbal Support

Overview

UAV Console is a Python-based drone control system built on MAVSDK, specifically tested and optimized for the Typhoon H480 model in PX4 SITL. The system provides comprehensive control including advanced gimbal operations, telemetry monitoring, and mission planning capabilities.

Features

  • Asynchronous drone control using MAVSDK
  • Real-time telemetry monitoring
  • Mission planning with waypoint navigation
  • Manual flight control capabilities
  • Gimbal control system
  • Return-to-Home functionality
  • Orbital movement patterns
  • Support for both SITL and hardware testing

System Requirements

Hardware Requirements

  • For physical testing: Pixhawk Flight Controller
  • Companion computer running Ubuntu 20.04
  • 3-axis gimbal system compatible with Typhoon H480

Software Requirements

  • Ubuntu 20.04 Focal Fossa
  • Python 3.8+
  • MAVSDK-Python
  • PX4 Firmware (v1.13.0 or later)
  • Gazebo 11
  • Typhoon H480 model package

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/uav-console.git
cd uav-console
  1. Install MAVSDK and PX4:
pip3 install mavsdk

# Clone PX4 Firmware
git clone https://github.com/PX4/PX4-Autopilot.git
cd PX4-Autopilot
git checkout v1.13.0
  1. Setup Typhoon H480 SITL:
# Install Typhoon H480 model
sudo apt-get install ros-noetic-typhoon-h480

# Build PX4 SITL with Typhoon H480
DONT_RUN=1 make px4_sitl_default gazebo_typhoon_h480

SITL Simulation Setup

  1. Launch Typhoon H480 simulation:
cd PX4-Autopilot
make px4_sitl gazebo_typhoon_h480
  1. In a new terminal, initialize the console:
from uav_console import Console
console = Console("udp://:14540")

Gimbal Operations

The Typhoon H480 comes with a 3-axis gimbal. Use the following commands for gimbal control:

  1. Initialize Gimbal:
# Set gimbal mode
console.run(10, {})
  1. Control Gimbal:
# Control gimbal movement
# Input integers for gimbal control:
# 1: Tilt up
# 2: Tilt down
# 3: Pan left
# 4: Pan right
console.run(11, {})
  1. Release Gimbal Control:
console.run(12, {})

Example Mission with Gimbal

# Initialize drone and gimbal
console.run(0, {})  # Initialize drone
console.run(10, {}) # Set gimbal mode

# Define mission with camera positioning
mission_data = {
    "lat": 47.397742,
    "long": 8.545594,
    "alt": 30,
    "speed": 5
}
console.run(2, mission_data)

# Control gimbal during flight
console.run(11, {})  # Manually input control command

# Complete mission and release gimbal
console.run(12, {})

Known Issues Specific to Typhoon H480

  1. Gimbal response may have slight delay in SITL
  2. Pan limits need calibration in simulation
  3. Height considerations for gimbal clearance during takeoff

Usage Notes for Typhoon H480

Pre-flight Checks

# Initialize with specific Typhoon H480 parameters
console = Console("udp://:14540")
console.run(0, {})

# Verify gimbal functionality
console.run(10, {})  # Set gimbal mode

Orbital Motion

orbit_data = {
    "radius": 10,
    "speed": 2,
    "lat": 47.397742,
    "long": 8.545594,
    "alt": 30  # Maintain safe altitude for Typhoon H480
}
console.run(5, orbit_data)

Typhoon H480 Specific Parameters

  • Default takeoff height: 2.5m
  • Safe operating radius: 5-50m
  • Recommended cruise speed: 5 m/s
  • Gimbal tilt range: -90° to +30°
  • Gimbal pan range: ±170°

Troubleshooting Typhoon H480 SITL

  1. If gimbal doesn't respond:
# Restart gimbal plugin
gz model -m typhoon_h480 -p "gimbal::control=true"
  1. For visual issues:
# Reset model visibility
gz model -m typhoon_h480 -v true

Safety Features

  • Pre-flight system checks
  • Connection state monitoring
  • Mission termination capability
  • Return-to-Home functionality
  • Telemetry monitoring

Known Issues

  1. Connection stability varies with different MAVSDK versions
  2. Telemetry delays possible during complex operations
  3. Manual control requires careful mode transitions

Future Development

  • Enhanced error handling
  • Additional mission patterns
  • Extended gimbal control features
  • Improved telemetry visualization
  • Mission planning GUI

License

MIT License (See LICENSE file for details)

Contact

For issues and support, please create an issue in the GitHub repository.