Skip to content

Repository files navigation

Lighthouse — Position logger example

Connects to a Crazyflie and logs position state estimates to a CSV file.

This example uses cflib2, which is a new version of the cflib based on Rust. Its performance is much greater than cflib (version 1), but it is also less tested.

Prerequisites

  • rust
  • uv

Selecting a device

Run the scan script to list connected Crazyflie devices, pick one, and save it to config.json:

uv run scan_devices.py

The chosen URI is stored in config.json.

The USB serial number is unique to each hardware, and persists as it is tied to the hardware. So this script only needs to run when you have changed Crazyflie.

Logging position

uv run log_position.py

The URI is by default read from config.json.

All options:

uv run log_position.py --help

Output format

timestamp_ms,stateEstimate.x,stateEstimate.y,stateEstimate.z,...
1234,0.012,-0.003,0.421,...

Geometry configuration

Folder geometry-configuration contains a suggestion for how to set up lighthouse base stations to cover the defined area. See the folder for more information.

About

Simple example of setting up logging of state estimates from a Crazyflie via USB

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages