This project contains a python wrapper for the source code for the firmware used in the Crazyflie range of platforms, including the Crazyflie 2.X and the Roadrunner. This project is meant for simulation of on board controller response to sending commands from a ground station.
Clone this repo.
git clone https://github.com/utiasDSL/pycffirmware.git
cd pycffirmware/Initialize submodules.
git submodule update --init --recursiveInstall SWIG for your machine. Ensure that the install location is added to your path variable.
sudo apt update
sudo apt -y install swig
Install NumPy, gcc, and make.
pip install numpy
sudo apt install build-essentialNavigate to and run the build script.
cd wrapper
chmod +x build_linux.sh
./build_linux.shInstall brew.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Install NumPy, SWIG, the gcc compiler and make command.
pip install numpy
brew install swig
brew install gcc
brew install makeAlso run xcode-select --install if prompted.
If gcc is installed in a different location than /usr/local/bin/gcc-12 you will need to edit build_osx.sh to reflect this.
You can find the install location using
locate */bin/gcc-*Navigate to and run the build script.
cd wrapper
chmod +x build_osx.sh
./build_osx.shInstall SWIG for your machine. Installation instructions can be found here. Ensure that the install location is added to your path variable.
Install NumPy.
python -m pip install numpyInstall Visual Studio. Make sure to include C++ and MSVC build tools.
Navigate to and run the windows build script.
cd wrapper
build_windows.batThis module wraps parts of the firmware that are considered "value changing" when it comes to commands. These are the modules of the firmware that could change the intended values for a positional command to fit with Crazyflie constraints. These include:
- Controller
- High level commander and planner
- State estimator (coming soon)
An example of how one can use this package can be found in safe-control-gym.
University of Toronto's Dynamic Systems Lab