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

Next revision
Previous revision
Next revision Both sides next revision
projects:crazyflie:firmware:log [2012-10-07 13:37]
arnaud created
projects:crazyflie:firmware:log [2012-10-07 14:04]
arnaud [Table of content access]
Line 1: Line 1:
 ====== Crazyflie LOG subsystem ====== ====== Crazyflie LOG subsystem ======
  
-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 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.
  
 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 
 +
 +===== Communication protocol =====
 +
 +The log port is separated in 3 channels:
 +
 +^ **Port**  ^ **Channel** ^ **Function**      ^
 +|            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 ====
 +
 +This channel is used to access the loggable variables table of content.
 +
 +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.
 +
 +^ TOC command byte ^ Command   ^ Operation ^
 +|                0 | GET_ITEM  | Get an item from the TOC |
 +|                1 | GET_INFO  | Get information about the TOC and the LOG subsystem implementation |
 +
 +=== Get TOC element ===
 +
 +<code>
 +Request (PC to Copter):
 +        +--------------+------------+
 +        | GET_ITEM (0) | Element ID |
 +        +--------------+------------+
 +Length                     1
 +
 +Answer (Copter to PC):
 +        +--------------+------------+------+------------+--------------+
 +        | GET_ITEM (0) | Element ID | Type |   Group    |     Name     |
 +        +--------------+------------+------+------------+--------------+
 +Length        1              1            < Null terminated strings >
 +</code>
 +^ Request fields ^ Content                             ^
 +| GET_ITEM       | At 0 for GET_ITEM 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                             ^
 +| GET_ITEM       | 0 for GET_ITEM operation |
 +| Element ID     | ID of the element returned  |
 +| Type           | Variable type of the element. See variable types list |
 +| Group          | Null-terminated string containing variable group |
 +| Name           | Null-terminated string containing the variable name |
  
projects/crazyflie/firmware/log.txt · Last modified: 2021-06-24 16:49 by kimberly