Flight and data analysis framework for Crazyflies.
Ideally, make use of a Python virtual environment:
$ sudo apt install python3-venv
$ git clone https://github.com/Huizerd/crazyflie-suite.git
$ cd crazyflie-suite
$ python3 -m venv venv
$ source venv/bin/activateYou can exit the virtual environment by typing deactivate at any time. Next, update pip and setuptools and install the package and its dependencies:
$ pip install --upgrade pip && pip install --upgrade setuptools
$ pip install -e .We're installing the package in editable (-e) mode, such that we can change it without having to install again.
Code is formatted using Black. To automatically format when committing, run this once:
$ pre-commit installFiles needed:
A flight can be started by running python flight/logFlight.py. Several arguments can be supplied:
--fileroot: folder to store the log--keywords: keywords to identify your run (optional)--logconfig: location of the logging configuration--space: location of the flight space specification--estimator: which estimator to use (complementaryorkalman, must be compatible with flashed firmware)--uwb: which UWB mode to use (none,twrortdoa, must be compatible with anchor settings)--flow: whether or not a Flowdeck is used (optional)--trajectory: trajectory (or trajectories) to fly (see here for all options)--optitrack: how to use OptiTrack (none,loggingorstate, optional)--optitrack_id: if using OptiTrack, provide the rigid body ID here (optional)
A simple example can be found here.
Note that some options are incompatible. For instance, without UWB (none), you need OptiTrack for providing state (state). If either UWB or a Flowdeck (--flow) is used, the Kalman filter has to be selected.
To log a manual flight, choose "manual" as trajectory (i.e. --trajectory manual). Per default, the "PS3_Mode_1" controller mapping is used. It is however recommended to perform the following steps to make sure your controller works as intended:
- Connect your controller.
- Open the crazyflie client. This can be done from the terminal in your virtual environment with the command
cfclient. Your controller should show up under Input device > Device - Select a device mapping in Input device > Device > Input map. You can check the behaviour of your controller by moving the sticks and observing the numbers in "Gamepad input" in the "Flight Control" tab.
- If you can't find a mapping that works with your controller, you can create your own map in Input device > Configure device mapping. Select your device, click configure and detect all inputs. Finally save the profile using a memorable name.
- In the flight/log_flight.py file, change line 43 to
self.setup_controller(map="your_profile_name")