To track a variable's value while the Crazyflie is running we use the built in logging feature. This consists of the Crazyflie sending the values of predetermined variables back to the ground station. Note the logging bandwidth is limited to 26 bytes so only a handful of values can be logged simultaneously.
To track a variable's value while the Crazyflie is running we use the built in logging feature. This consists of the Crazyflie sending the table of contents of logging variables to the ground station, the ground station responds with what values it would like to receive. The Crazyflie then periodically sends those values to the ground station. Note the logging bandwidth is limited to 26 bytes so only a handful of values can be logged simultaneously.
# Firmware Setup
The variables that can be logged are determined at compile time and is setup through a C macro. These macros are defined under the [`src/modules/interface/log.h`](/../blob/master/crazyflie_software/crazyflie-firmware-2021%2E06/src/modules/interface/log%2Eh) file so be sure this is included where you want to use logging. These logging macros are typically placed at the end of the relevant .c file outside of any function definition. They read the value of static global variables.
...
...
@@ -132,7 +132,7 @@ The ground station then listens on port 5 channel 2 for data sent by the Crazyfl
>|----|-------------|-------|
>|0 |BLOCK_ID |ID of the block|
>|1 |ID |Timestamp in ms from the copter startup as a little-endian 3 bytes integer|
>|4.. |Log variable values|Packed log values in littleendian format|
>|4.. |Log variable values|Packed log values in little-endian format|