How to Run MAVSDK on VOXL with PX4

Table of contents

  1. Overview
  2. System Architecture
  3. MAVSDK Behavior with MAVLink

Overview

This tutorial demonstrates how to fly a VOXL-based drone autonomously, using MAVSDK.

Link to C++ tutorial

Link to Python tutorial

WARNING: At the end of this tutorial, your drone will be flying autonomously. Please only run this in a safe location away from people and wear protective eyewear!!

System Architecture

modalai-voxl-mavsdk-px4-architecture.png

MAVSDK works by sending MAVLink commands to the flight computer in order to control the drone.

When the drone is being operated by MAVSDK, it is placed in “offboard” mode. During operation in “offboard” mode, the drone is still able to respond to “RC_CHANNELS_OVERRIDE” commands if configured correctly. This allows the user to manually control gimbals using RC pass-though from the RC input to PWM outputs.

Though “RC_CHANNELS_OVERRIDE” commands work at the same time as MAVSDK is operating, they do not work if an RC transmitter is connected.

  • The flight computer will only respond to the first type of input it sees.
  • If the flight controller receives “RC_CHANNELS_OVERRIDE” MAVLink messages first, then all RC transmitter input is ignored until the flight computer is rebooted.
  • If the flight controller sees RC transmitter data before any “RC_CHANNELS_OVERRIDE” MAVLink messages are received then all “RC_CHANNELS_OVERRIDE” messages are ignored.

MAVSDK can operate regardless of which form of input is used (“RC_CHANNELS_OVERRIDE” messages or RC transmitter input) but when in offboard mode, MAVSDK will cause the flight computer to ignore flight control input for thrust, yaw, roll and pitch.

All other RC channel inputs will be honored if appropriate (such as an RC channel configured to be an RC pass-through.)