Communicate with Intel RTF flight controller using UART interface (2)

1. Upgrade firmware to px4 v1.8.1

(1) Download release version directly. [1]
(2) Copy the firmware to /etc/aerofc/px4/ and do the update

cd /etc/aerofc/px4/
sudo aerofc-update.sh aerofc-v1-default.px4

(3) Check firmware version

sudo aero-get-version.py

2. Parameter setting using QGroundControl (presetting for connecting to drone is needed. [2] )

(1) EKF2_AID_MASK: 24
(2) EKF2_HGT_MODE: Vision (or Barometric pressure)
(3) SYS_COMPANION: 921600 (57600 for TX2)

*Reboot the drone after modifying parameters

3. Download example [3]

git clone https://github.com/rijesha/mavlink-interface
cd mavlink-interface
git submodule init
git submodule update
4. Connect the drone with a UART cable and check serial port name

ls /dev/ttyUSB*

5. Modify port name and baudrate in main.cpp

#define PORT "/dev/ttyUSB0"
#define BAUD 921600 (57600 for TX2)

6. Build and then run the project

make 
sudo ./position_controller

7. Result

As shown in the following pictures, mavlink inspector respects the values wrote in the main.cpp

留言

這個網誌中的熱門文章

Tuing PID parameters in QGroundcontrol (2)

Useful PX4 Parameters

Burn linux image to eMMC storage on Banana Pi M3