Simple MAVSDK examples for controlling DEXI drone via MAVLink.
pip3 install --break-system-packages mavsdkdexi-mavsdk/
├── missions/ # Autonomous flight scripts
├── control/ # Manual/interactive control
└── config/ # Parameter configuration
Autonomous flight scripts that takeoff, execute a task, and land.
# Basic takeoff to 2.5m and land
python3 missions/takeoff_and_land.py
# Velocity-based takeoff/land (bypasses position hold issues)
python3 missions/velocity_takeoff_land.py
# Takeoff, fly forward 2m, and land
python3 missions/takeoff_fly_forward_land.py
# Fly a 1m box pattern
python3 missions/box_mission.pyInteractive and manual control scripts.
# Keyboard control (WASD-style)
python3 control/keyboard_control.py
# Simple movement test
python3 control/move_left.pyParameter configuration scripts for EKF2 sensor fusion modes.
Standard mode using GPS for position. Use this for outdoor flight or to reset after testing vision mode.
python3 config/enable_gps.pySets: EKF2_GPS_CTRL=7, EKF2_EV_CTRL=0, EKF2_HGT_REF=1 (GPS height)
Disables GPS and enables visual odometry fusion. Use with apriltag_odometry for indoor flight or GPS-denied environments.
python3 config/disable_gps.pySets: EKF2_GPS_CTRL=0, EKF2_EV_CTRL=1 (horizontal position only), EKF2_HGT_REF=0 (barometer)
Warning: In vision mode, the drone will drift if it loses sight of the AprilTag.
# Monitor visual odometry messages being received by PX4
python3 config/debug_vision_odom.py- PX4 SITL runs in
px4-sitlcontainer at172.20.0.4 - MAVLink is sent to
code-servercontainer at172.20.0.8:14540 - ROS2 uses uXRCE-DDS on port 8888 (separate from MAVLink)
- MAVSDK and ROS2 can run simultaneously - they use different protocols
- MAVLink: Direct drone control via MAVSDK (code-server container)
- uXRCE-DDS: PX4 ROS2 topics via micro-ros-agent (ros2-dev container)