(Ⅵ) Crazyflie and PX4 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 installation and usage tutorial).
(Ⅰ) 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 PX4 drone configuration and crazyflie lies in uri and type. The PX4 drone 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 p200.
.png)
Figure 7 - Crazyflie and PX4 Configuration Description
Ⅲ. Basic Operation Flight Demonstration
(Ⅰ) Create Rigid Bodies
Place one px4 drone and one crazyflie on the site with the nose facing the positive x-axis direction. Create rigid bodies pxf2 and nokov3, with skeleton orientation toward the x-axis.
(Ⅱ) Position Placement
Place px4 at the origin with the nose facing the positive x-axis direction. Place the crazyflie drone in front of px4 with the nose facing the positive x-axis direction. Refer to the position as shown below. Power on all devices.
.png)
Figure 8 - Reference Position
(Ⅲ) Enable Devices
Configure and enable one crazyflie and one px4 drone in the flightmasters.yaml file.
.png)
Figure 9 - Enable Swarm Devices
(Ⅳ) Modify Circle Script
Modify the names in the circle.py script (path: ~/FlightMaster2/flightmaster_examples/flightmaster_examples), and the startup should correspond. crazyflie corresponds to rigid body nokov3, and px4 corresponds to rigid body pxf2.
.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 Circle Script
Click the Run circle.py button on the right side of the graphical interface to start the circle script.
.png)
Figure 13 - Start Circle Script
.png)
Figure 14 - rviz Display
.png)
Figure 15 - Crazyflie Circling Around PX4