A customized PX4-Autopilot for fixed-wing UAVs formation flight.
Key features:
- Enable airspeed command under offboard mode.
- Control pitch (
$\theta$ ) and heading ($\psi$ ) angle of a fixed-wing UAV at the same time. - Receive true wind velocity from Gazebo to calculate the true airspeed (Bug fixed)
- Ubuntu 22.04 LTS
- Gz sim Garden 7.9.0
- ROS2 humble
-
Install PX4 formation simulation package
-
Install PX4 Autopilot
cd ~/ git clone git@github.com:TigerWuu/Formation-PX4.git --recursive mv ~/Formation-PX4 ~/PX4-Autopilot bash ./PX4-Autopilot/Tools/setup/ubuntu.sh cd PX4-Autopilot/ make px4_sitl -
Install QGroundControl
For Xbox one
Open QGroundControl
./QGroundControl.AppImage
-
Terminal 1
cd ~/PX4-Autopilot
-
w/ Gazebo gui
make px4_sitl gz_standard_vtol{world} -
w/o Gazebo gui
HEADLESS=1 make px4_sitl gz_standard_vtol{world}world lists :
_default : w/o wind field
_windyGust : w/ wind field
-
Terminal 2
MicroXRCEAgent udp4 -p 8888 -
Terminal 3
ros2 launch commander formation.xml wind_com:=w2 L_dir:=0.0 trajectory:=C L:=1.0 L2:=0.1 radii:=400.0Arguments :
- wind_com:
w1,w2,none. wind compensation setting. - L_dir: straight line formation flight heading angle [rad].
- trajectory :
C,L.Cmeans circular orbit,Lmeans straight line. - L: observer gain L1.
- L2: observer gain L2.
- radii: circular orbit formation flight radius [m].
- wind_com:
-
Terminal 1
cd ~/PX4-Autopilot
-
w/ Gazebo gui
./px4_multi_uav.sh {world}world lists :
default : w/o wind field
windyGust : w/ wind field
-
Terminal 5
ros2 launch commander formation_multi.xml wind_com:=w2 L_dir:=0.0 trajectory:=C L:=1.0 L2:=0.1 radii:=400.0 leader:=0Arguments :
- leader:
0,1.0means all three follower UAVs will maintain a certain configuration with the virtual leader.1means only the first follower UAV maintain a configuration with virtual leader, and the other followers maintain the configuration with the first follower UAV, that is, the first follower UAV will be designated as a real leader.
- leader:
-
Plot with Matlab
See https://github.com/TigerWuu/Fixed-Wing-Formation-Control
-
Plot with real time
ros2 run plotjuggler plotjuggler
- ros2 bag
- Plotjuggler
