(Ⅴ) Crazyflie and Ardupilot Heterogeneous Swarm Control
Ⅰ. Motion Capture Software VRPN Configuration
Taking motion capture software version XINGYING 4.2.0.5495 as an example, other versions are similar. Open the motion capture software and connect the cameras. Click View -> Data Broadcast in the menu bar. Under the VRPN stream in Data Broadcast, select meters from the unit dropdown, check Rigid Body for type, and enable VRPN.
.png)
Figure 1 - Open Data Broadcast View
.png)
Figure 2 - VRPN Configuration in Motion Capture
Click View -> Devices in the menu bar to open the device view. First click the stop playback button, and modify the motion capture frame rate to 30 in the Advanced box.
.png)
Figure 3 - Open Device View
.png)
Figure 4 - Modify Motion Capture Frame Rate
Ⅱ. FlightMaster Platform Configuration
Requires ROS version: galactic, Ubuntu version: 20.04. Crazyflie firmware version 2024.10 or above. If the version is too low, update it yourself (cfclient usage).
(Ⅰ) Install Dependencies
Open a terminal and use the following commands to install dependencies.
sudo apt install python3-pip python3-colcon-common-extensions
pip3 install rowan
sudo apt install libusb-1.0-0-dev
(Ⅱ) Compile Source Code
First extract the given Flightmaster2 compressed package, then place the extracted folder in the ubuntu home directory (~/). Use the following commands to install mavsdk and compile FlightMaster2 source code.
cd ~/FlightMaster2/
sudo dpkg -i ./prebuilt/mavsdk-20241118_2.12_amd64.deb
colcon build --symlink-install
echo "source ~/FlightMaster2/install/setup.bash" >> ~/.bashrc
(Ⅲ) Configure VRPN in FlightMaster2
In the motion_capture.yaml file in FlightMaster2 (path: ~/FlightMaster2/flightmaster/config), change type to vrpn, and modify hostname to the IP address on the same network segment as the host running FlightMaster2 and the motion capture software.
.png)
Figure 5 - Configure type and hostname
In the flightmasters.yaml file in FlightMaster2 (path: ~/FlightMaster2/flightmaster/config), set the enabled field of motion_capture of the robot_types to be used to false.
.png)
Figure 6 - Set VRPN Method
(Ⅳ) FlightMaster2 Connection Configuration Description
In the flightmasters.yaml file in FlightMaster2 (path: ~/FlightMaster2/flightmaster/config), under the robots field, the crazyflie configuration is consistent with that in crazyswarm2. The difference between apm vehicle configuration and crazyflie lies in uri and type. The apm vehicle uses the mavlink protocol, and there are multiple ways to connect addresses (mavlink connection address format). This experiment uses the udp connection method. Select type r200.
.png)
Figure 7 - Crazyflie and APM Configuration Description
Ⅲ. Basic Operation Flight Demonstration
(Ⅰ) Create Rigid Bodies
Place one crazyflie and one apm unmanned vehicle on the site with the nose facing the positive x-axis direction. Create rigid bodies cf and car respectively, with skeleton orientation toward the x-axis.
.png)
Figure 8 - Reference Position
(Ⅱ) Enable Devices
Configure and enable one crazyflie and one apm unmanned vehicle in the flightmasters.yaml file.
.png)
Figure 9 - Enable Swarm Devices
(Ⅲ) Modify Follow Script
Modify the names in the follow.py script (path: ~/FlightMaster2/flightmaster_examples/flightmaster_examples), and the startup should correspond.
.png)
Figure 10 - Modify Script
(Ⅳ) Launch Graphical Operation Interface
Open a terminal and use the following command to open the flightmaster2 graphical control interface.
cd ~/FlightMaster2/
python fmclient.py
.png)
Figure 11 - Flightmaster2 Graphical Interface
(Ⅴ) Start Service Node
Select RealMode on the graphical interface and check RViz, then click Start FlightSwarm. At this time, the flightmaster2 service node will run, and rviz will also start.
.png)
Figure 12 - Start Flightmaster2 and rviz
(Ⅵ) Start Follow Script
Click the Run follow.py button on the right side of the graphical interface to start the follow script.
.png)
Figure 13 - Start Follow Script
.png)
Figure 14 - rviz Display
.png)
Figure 15 - Crazyflie Following APM Vehicle