User Tools

Site Tools


projects:crazyflie:firmware:log

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
projects:crazyflie:firmware:log [2012-10-07 13:56]
arnaud
projects:crazyflie:firmware:log [2021-06-24 16:49] (current)
kimberly
Line 1: Line 1:
 +<WRAP center round important 60%>
 +This page has deprecated and will be archived. Please go to [[https://www.bitcraze.io/]].
 +</WRAP>
 ====== Crazyflie LOG subsystem ====== ====== Crazyflie LOG subsystem ======
  
-The purpose of the logging is to be able to log variables that are available in the copter during runtime. The Crazyflie log system is design in such a way that the copter firmware is mostly independant from the client and all information required to get the log system to work are communicated at connection time. The copter contains a table of content of all the variable possible to log. The client retrieve the list at connection time. The client then program in the copter log packets (ie. list of variable to log at the same time) to be sent back at regular interval.+The purpose of the logging is to be able to log variables that are available in the copter during runtime. The Crazyflie log system is design in such a way that the copter firmware is mostly independent from the client and all information required to get the log system to work are communicated at connection time. The copter contains a table of content of all the variable possible to log. The client retrieve the list at connection time. The client then program in the copter log packets (ie. list of variable to log at the same time) to be sent back at regular interval.
  
 This mechanism is used both for regular log operation (ie. user requested log to inspect and debug flight data) but also to update indication in the GUI application. This mechanism is used both for regular log operation (ie. user requested log to inspect and debug flight data) but also to update indication in the GUI application.
  
-Each variable to log is contained in a +Each variable to log is contained in a group group and has a name. The system is designed to make it easy to add a log variable in the Firmware and have it available in the ground station GUI:
  
-===== Communication protocol =====+{{:projects:crazyflie:firmware:logmagic.png?800|}}
  
-The log port is separated in 3 channels:+===== Firmware usage =====
  
-^ **Port**  ^ **Channel** ^ **Function**      ^ +A couple of macros are declared in //log.h// to define new log variables. All log variables should be in a log group. Example:
-|            0        | [[comm_protocol#table_of_content_access|Table of content access]] | +
-|            1        | [[comm_protocol#log_settings_access| Log settings access]] | +
-|            2        | [[comm_protocol#log_data_access|Log data access]] |+
  
-==== Table of content access ==== +<code style="c"
- +LOG_GROUP_START(stabilizer
-This channel is used to access the loggable variables table of content. +LOG_ADD(LOG_FLOAT, roll, &eulerRollActual) 
- +LOG_ADD(LOG_FLOAT, pitch, &eulerPitchActual
-The first byte of each messages correspond a command. All communication on this port are initated by the client and all answer from the copter will contain the same command byte. +LOG_ADD(LOG_FLOAT, yaw, &eulerYawActual
- +LOG_GROUP_STOP(stabilizer)
-^ TOC command byte ^ Meaning             ^ +
-|                0 | Get TOC Element     | +
-|                1 | Get TOC information | +
- +
-=== Get TOC element === +
- +
-<code> +
-Request (PC to Copter): +
-        +-------------+------------+ +
-        | Command (0| Element ID | +
-        +-------------+------------+ +
-Length                    1 +
- +
-Answer (Copter to PC): +
-        +-------------+------------+------+------------+--------------+ +
-        | Command (0| Element ID | Type |   Group    |     Name     | +
-        +-------------+------------+------+------------+--------------+ +
-Length        1                        < Null terminated strings >+
 </code> </code>
-^ Request fields ^ Content                             ^ 
-| Command        | Must be 0 for GET_ELEMENT operation | 
-| Element ID     | ID of the element to be retrieved. The variables are numbered from 0 to LOG_LEN (see GET_INFO command) | 
  
-Answer fields  Content                             +Macro                        Usage                                             
-Command        0 for GET_ELEMENT operation +LOG_GROUP_START(grp_name)    Start a log group named //grp_name//              
-Element ID     | ID of the element returned  +LOG_GROUP_STOP(grp_name)     | Stop log group declaration for group //grp_name// 
-Type           Variable type of the element. See variable types list | +LOG_ADD(type, name, address) Add a log variable. //type// is the variable type (see bellow), //name// is the name as it will be sent to the ground and //address// is the memory address of the variable |
-| Group          | Null-terminated string containing variable group | +
-| Name           | Null-terminated string containing the variable name |+
  
 +^ Type defines ^ Corresponding C99 type ^ Note ^
 +| LOG_UINT8    | uint8_t                |      |
 +| LOG_UINT16   | uint16_t                    |
 +| LOG_UINT32   | uint32_t                    |
 +| LOG_INT8     | int8_t                      |
 +| LOG_INT16    | int16_t                |      |
 +| LOG_INT32    | int32_t                |      |
 +| LOG_FLOAT    | float                  | IEEE 754 binary32 (single precision float) |
 +| LOG_FP16     | //N/A?//               | IEEE 754 binary16, intended for log report only (not in memory) |
projects/crazyflie/firmware/log.1349611003.txt.gz · Last modified: 2015-07-15 16:30 (external edit)