This fork of the Crazyflie firmware contains modifications for software-in-the-loop simulation with the ROS2 Gazebo sim_cf2 Crazyflie Flight Simulator. It is utilizing the FreeRTOS Linux Port https://www.freertos.org/FreeRTOS-simulator-for-Linux.html#SimulatorApp
The build process is fully integrated into the firmware's KBuild build system allowing the use of the same code base for simulation and execution on the real Crazyflie based on the configuration.
The firmware for SITL is built using the systems default C/C++ compiler. KBuild requires some additional packages
sudo apt install make build-essential libncurses5-dev
If you haven't done already, make sure all submodules are up to date. The SITL requires the FreeRTOS repository with the Linux Port which isn't part of the original crazyflie-firmware repository.
git submodule update --init --recursive
Download the newest version of GNU Scientific Library (GSL) from their website https://www.gnu.org/software/gsl/#downloading
Get the tarball with the newest version
Unpack the archive and move into the gsl folder. Run the configure script
./configure
Build the library
make -j
Install the library on your system
sudo make install
Run ldconfig
sudo ldconfig
Open a terminal and move into the crazyflie-firmware repository (assuming ~/repos/crazyflie-firmware) and configure the build
cd ~/repos/crazyflie-firmware
make menuconfig
In the gui interface of menuconfig first navigate to Build and debug options
Select Build for SITL
Switch to Platform configuration
Select Build for SITL in the Platform to build window
In the menu entry Expansion deck configuration make sure no decks are activated
Save the configuration file and exit menuconfig
Run make
make -j
A script to start the SITL instances is located under scripts/sim_cf2. Open a new terminal and move to the scripts/sim_cf2 folder in this repository (assuming ~/repos/crazyflie-firmware)
cd ~/repos/crazyflie-firmware/scripts/sim_cf2
Run the run_cfs.sh script with as many instances of simulated Crazyflies as needed by providing the amount of Crazyflies as argument (e.g. two)
./run_cfs.sh 2
This project contains the source code for the firmware used in the Crazyflie range of platforms, including the Crazyflie 2.X and the Roadrunner.
The 2017.06 release was the last release with Crazyflie 1.0 support. If you want to play with the Crazyflie 1.0 and modify the code, please clone this repo and branch off from the 2017.06 tag.
See the building and flashing instructions in the github docs folder.
Check out the Bitcraze crazyflie-firmware documentation on our website.
The easiest way to generate the API documentation is to use the toolbelt
tb build-docs
and to view it in a web page
tb docs
Go to the contribute page on our website to learn more.
To run the tests please have a look at the unit test documentation.
The code is licensed under LGPL-3.0