Skip to main content

Mavlink

Introduction

Build Mavlink connection between companion computer to flight controller

Refer to document: Ardupilot.org Companion Computers

Prerequirement

Hardware:

Install System

caution

Always ensure your workspace is safe, power sources are controlled, and surroundings are clear before testing or experimentation.

  • Optional: Enable auto-login to skip manual login
 System Options -> Boot / Auto Login -> Console Autologin

OR

  sudo mkdir -p /etc/systemd/system/[email protected]

cat <<EOF | sudo tee /etc/systemd/system/[email protected]/autologin.conf > /dev/null
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin pi --noclear %I \$TERM
EOF

sudo systemctl daemon-reexec
sudo systemctl restart getty@tty1
  • Update system
sudo apt update && sudo apt upgrade -y
  • Install MAVLink support
pip install pymavlink
  • Confirm work
python3 -c "from pymavlink import mavutil; print(' All working:  pymavlink')"  
  • Check USB Info
ls /dev/ttyACM*
dmesg | grep ttyACM # cdc_acm 1-1:1.0: ttyACM0: USB ACM device
  • mavlink connect
mavproxy.py --master=/dev/ttyACM0 --baud=115200 # mavlink connect

Reference document: ardupilot mavlink via pi