Bitcraze Crazyflie

Introduction

Crazyflie 2.1 by Bitcraze can be found here

../../_images/Crazyflie2_01.jpeg

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
  • For source installation, follow the steps below:

# If you have installed Aerostack2 from sources we recommend to clone the package in the src folder of your workspace otherwise you can clone it in any ROS 2 workspace you want.
cd ~/aerostack2_ws/src/aerostack2/as2_aerial_platforms
git clone git@github.com:aerostack2/as2_platform_crazyflie.git
cd ~/aerostack2_ws
rosdep install as2_platform_crazyflie --from-paths src --ignore-src -r -y
colcon build --packages-up-to as2_platform_crazyflie

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 Modes Gazebo Platform

Control Mode

Yaw Mode

Reference Frame

Hover

None

None

Speed

Speed

ENU

Speed in a plane

Speed

ENU

Sensors

These are supported sensors:

Sensors Gazebo Platform

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.

Aerostack2 provides a launch file for this platform:

ros2 launch as2_platform_crazyflie crazyflie_swarm_launch.py

To see all the available parameters, use the ‘-s’ flag to show the description of each parameter in the launch file.