This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
doc:crazyflie:dev:arch:logparam [2015-03-11 14:02] macke |
doc:crazyflie:dev:arch:logparam [2019-09-05 15:20] kimberly |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <WRAP center round important 60%> | ||
+ | This page is deprecated and is moved to the main Bitcraze website. Please go to: | ||
+ | [[ | ||
+ | https:// | ||
+ | ]] | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ====== Logging and parameter frameworks ====== | ||
+ | The aim of the logging and parameter framework is to easily be able to log data from the Crazyflie and to set variables during runtime. | ||
+ | |||
+ | ===== Table of content (TOC) ===== | ||
+ | The variables that are available for the logging/ | ||
+ | |||
+ | This will make the variables used to control the [[projects: | ||
+ | <code c> | ||
+ | PARAM_GROUP_START(ring) | ||
+ | PARAM_ADD(PARAM_UINT8, | ||
+ | PARAM_ADD(PARAM_UINT32 | PARAM_RONLY, | ||
+ | PARAM_ADD(PARAM_UINT8, | ||
+ | PARAM_ADD(PARAM_UINT8, | ||
+ | PARAM_ADD(PARAM_UINT8, | ||
+ | PARAM_ADD(PARAM_UINT8, | ||
+ | PARAM_ADD(PARAM_FLOAT, | ||
+ | PARAM_ADD(PARAM_FLOAT, | ||
+ | PARAM_ADD(PARAM_FLOAT, | ||
+ | PARAM_GROUP_STOP(ring) | ||
+ | </ | ||
+ | |||
+ | This will make the variables for roll/ | ||
+ | < | ||
+ | LOG_GROUP_START(stabilizer) | ||
+ | LOG_ADD(LOG_FLOAT, | ||
+ | LOG_ADD(LOG_FLOAT, | ||
+ | LOG_ADD(LOG_FLOAT, | ||
+ | LOG_ADD(LOG_UINT16, | ||
+ | LOG_GROUP_STOP(stabilizer) | ||
+ | </ | ||
+ | |||
+ | During the compilation a table of content (TOC) is created that holds all the available variables together with the type and access restrictions. There' | ||
+ | |||
+ | All the variables have a name and belong to a group. So in the examples above there' | ||
+ | |||
+ | ===== Parameters ===== | ||
+ | Using the parameter framework it's possible to both read and write variables in run-time, but note the following: | ||
+ | * There' | ||
+ | * Only use the parameter framework to read variables that are set during start-up. If variables change during runtime then use the logging framework. | ||
+ | * The reading or writing of a parameter can be done at any time once you are connected to the Crazyflie. | ||
+ | |||
+ | ===== Logging ===== | ||
+ | The logging framework is used to log variables from the Crazyflie at a specific interval. Instead of triggering a reading of the variables at certain intervals, the framework is used to set up a logging configuration to that will push data from the Crazyflie to the host. After the host has connected to a Crazyflie and downloaded the TOC it will be possible to setup one of these configurations. Once the configuration is set up and started the Crazyflie will start pushing data to the host. A configuration can be stopped and re-started again. Since there' | ||
+ | |||
+ | Note the following for the logging framework: | ||
+ | * Once a Crazyflie is connected you can set up new logging configurations. It's only possible to create/ | ||
+ | * The interval for a logging configuration is specified in 10th of milliseconds. | ||
+ | |||
+ | Note that variables can be logged as different types from what they have been declared as in the firmware. I.e if a variable is declared as a uint32_t you can log it as a uint8_t (this is being done for the motors in the UI). |