DroneKit
DroneKit-Python allows developers to create apps that run on an onboard companion computer and communicate with the ArduPilot flight controller using a low-latency link.
The API communicates with vehicles over MAVLink. It provides programmatic access to a connected vehicle’s telemetry, state and parameter information, and enables both mission management and direct control over vehicle movement and operations.
Drone-kit is a python API corresponding to the functionality of mavproxy. This means you can arm, change flight modes and send waypoints. The constraint being that all of this happens at a low frequency.
If you want to implement an an autonomous vehicle with your very own AI you would choose the GUIDED mode. There are two ways to control the vehicle
-
Position. In this mode positions in relative/global frame are sent to vehicle (over mavlink) in the form of goto commands.
-
Velocity The function send_ned_velocity() below generates a SET_POSITION_TARGET_LOCAL_NED MAVLink message which is used to directly specify the speed components of the vehicle in the MAV_FRAME_LOCAL_NED frame (relative to home location). The message is re-sent every second for the specified duration.
RC overid
PX4 pro
Build an Agent on your offboard compute which communicate with the PX4 autopilot client. The client and agent both run as daemon process.
-
PX4-Firmware This repository holds the PX4 Pro flight control solution for drones, with the main applications located in the src/modules directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.
- multiple applications known as Apps are runnig on the Pixhawk2:
~/src/Firmware/Tools$ ./mavlink_shell.py /dev/ttyACM0
Connecting to MAVLINK...
NuttShell (NSH)
nsh> help
...
Builtin Apps:
adc
tone_alarm
fmu
px4io
rgbled
mpu6000
mpu9250
lsm303d
l3gd20
hmc5883
ms5611
sf0x
ll40ls
trone
gps
pwm_out_sim
ets_airspeed
ms4525_airspeed
ms5525_airspeed
sdp3x_airspeed
frsky_telemetry
sensors
px4flow
vmount
pwm_input
camera_trigger
bst
lis3mdl
ulanding_radar
bl_update
config
hardfault_log
mixer
mtd
nshterm
param
perf
pwm
reboot
top
ver
commander
send_event
load_mon
navigator
mavlink
gpio_led
land_detector
camera_feedback
ekf2
fw_att_control
fw_pos_control_l1
gnd_att_control
gnd_pos_control
mc_att_control
mc_pos_control
vtol_att_control
logger
uorb
dataman
px4_simple_app
serdis
sercon
Individual message channels between Applications (Apps) are called topics in PX4.
ArduPilot
Learning the ArduPilot Codebase
Mavros
What is the difference between ArduPilot and PX4
ArduPilot uses