User Tools

Site Tools


projects:crazyflie:firmware:log

This is an old revision of the document!


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.

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:

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 Meaning
0 Get TOC Element
1 Get TOC information

Get TOC element

Request (PC to Copter):
        +-------------+------------+
        | Command (0) | Element ID |
        +-------------+------------+
Length         1            1

Answer (Copter to PC):
        +-------------+------------+------+------------+--------------+
        | Command (0) | Element ID | Type |   Group    |     Name     |
        +-------------+------------+------+------------+--------------+
Length        1             1         1    < Null terminated strings >
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
Command 0 for GET_ELEMENT 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.1349611003.txt.gz · Last modified: 2015-07-15 16:30 (external edit)