Bitcraze Crazyflie
Introduction
Crazyflie 2.1 by Bitcraze can be found here
Installation
Prerequisites
First thing to do is to configure your Crazyflie(s). In order to do that, please follow these steps:
Install the cfclient.
Setup UDEV permissions for using the Crazyradio.
Perform a firmware upgrade.
Configure the radio address for your crazyflie. To do this, connect your crazyflie, then open “Connect->Configure 2.X” to open the address configuration dialog. Please use a different address for each crazyflie to be used in a swarm.
These steps are meant to be done once.
Install platform package
For binary installation, install by running:
sudo apt install ros-humble-as2-platform-crazyflie
Warning
This package is not available for binary installation yet. Cooming soon.
For source installation, clone Aerostack2 repository into your workspace and build it. See it in Aerostack2 installation guide.
Aerostack2 Common Interface
For more details about platform control modes and sensors, see Aerostack2 Aerial Platform Concepts.
Control Modes
These are supported control modes:
Control Mode |
Yaw Mode |
Reference Frame |
---|---|---|
Hover |
None |
None |
Speed |
Speed |
ENU |
Speed in a plane |
Speed |
ENU |
Sensors
These are supported sensors:
Sensor |
Topic |
Type |
---|---|---|
Odometry |
sensor_measurements/odom |
nav_msgs/Odometry |
IMU |
sensor_measurements/imu |
sensor_msgs/Imu |
Battery |
sensor_measurements/battery |
sensor_msgs/BatteryState |
Platform Launch
In order to map the adresses of the crazyflie(s) we just configured to the input adresses of the platfom, we need to use a .yaml
configuration file with the format as the following example:
cf0:
uri: radio://0/80/2M/E7E7E7E700
cf1:
uri: radio://0/80/2M/E7E7E7E701
In this case, we are mapping two Crazyflies with uri’s radio://0/80/2M/E7E7E7E700
and radio://0/80/2M/E7E7E7E701
for namespaces cf0
and cf1
respectively.
As you can see for the radio id part of the uri, the same Crazyradio is going to be used for both.
This configuration file’s path shall serve as an input to the platform launch parameter swarm_config_file
. Note that this platform is launched only once, regardless of the number of crazyflies beeing used.
Aerostack2 Crazyflie platform provides a launch file, which parameters are:
Parameter |
Type |
Description |
---|---|---|
swarm_config_file |
string |
Path to the swarm URI’s configuration file. |
control_modes_file |
string |
Optional. File path with the control modes configuration. Default the one in the package. |
external_odom |
bool |
Optional. Use external odometry source. Default false. |
external_odom_topic |
bool |
Optional. Topic name of external odometry source. Default ‘external_odom’. |
controller_type |
int |
Optional. Controller type: Any(0), PID(1), Mellinger(2), INDI(3). Default PID. |
estimator_type |
int |
Optional. Estimator type: Any(0), complementary(1), kalman(2). Default Kalman. |
Example of launch command with a Crazyflies with flow deck:
ros2 launch as2_platform_crazyflie crazyflie_swarm_launch.py swarm_config_file:=uris_yaml_path
Example of launch command with a Crazyflies with motion capture system:
ros2 launch as2_platform_crazyflie crazyflie_swarm_launch.py swarm_config_file:=uris_yaml_path external_odom:=true external_odom_topic:=mocap_topic_name