Skip to content

The main firmware for the Crazyflie Nano Quadcopter, Crazyflie Bolt Quadcopter and Roadrunner Positioning Tag with modifications for sim_cf and sim_cf2 flight simulators.

License

Notifications You must be signed in to change notification settings

CrazyflieTHI/crazyflie-firmware

 
 

Repository files navigation

Crazyflie Firmware for sim_cf2 SITL

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.

Dependencies

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

sitl_download_gsl_website

Get the tarball with the newest version

sitl_gsl_download_tar_gz

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

Building for SITL

Open a terminal and move into the crazyflie-firmware repository (assuming ~/repos/crazyflie-firmware) and configure the build

cd ~/repos/crazyflie-firmware
make menuconfig

Configure the Build

In the gui interface of menuconfig first navigate to Build and debug options

sitl_menuconfig_build_and_debug_options

Select Build for SITL

sitl_menuconfig_build_for_sitl

Switch to Platform configuration

sitl_menuconfig_platform_configuration

Select Build for SITL in the Platform to build window

sitl_menuconfig_platform_to_build_build_for_sitl

In the menu entry Expansion deck configuration make sure no decks are activated

sitl_menuconfig_no_decks_activated

Save the configuration file and exit menuconfig

Build the Firmware

Run make

make -j

sitl_make_build_for_x86

Run SITL Instances

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

Crazyflie Firmware CI

This project contains the source code for the firmware used in the Crazyflie range of platforms, including the Crazyflie 2.X and the Roadrunner.

Crazyflie 1.0 support

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.

Building and Flashing

See the building and flashing instructions in the github docs folder.

Official Documentation

Check out the Bitcraze crazyflie-firmware documentation on our website.

Generated documentation

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

Contribute

Go to the contribute page on our website to learn more.

Test code for contribution

To run the tests please have a look at the unit test documentation.

License

The code is licensed under LGPL-3.0

About

The main firmware for the Crazyflie Nano Quadcopter, Crazyflie Bolt Quadcopter and Roadrunner Positioning Tag with modifications for sim_cf and sim_cf2 flight simulators.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 95.6%
  • HTML 2.0%
  • Python 0.7%
  • C++ 0.4%
  • Makefile 0.4%
  • Assembly 0.2%
  • Other 0.7%