This command is compound, it has one request message and two response messages. The request message doubles as a response for Control mode.
It serves for controlling the data recording capability of the package. See Realtime Value Tracking for more details.
ID: 41
This command controls the data recording functionality.
| Offset | Size | Name | Mandatory | Description |
|---|---|---|---|---|
| 0 | 1 | mode |
Yes | 1: Control2: Send |
| 1 | 1 | sub_mode |
Yes | Submode is different for each of the two modes. |
Control mode will respond with the DATA_RECORD response after processing the request.
sub_mode = 0: Get Status
No additional parameters are expected. The response contains the current status without making any changes.
For sub_mode > 0, one additional parameter is expected:
| Offset | Size | Name | Mandatory | Description |
|---|---|---|---|---|
| 0 | 1 | value |
Yes | Represents a boolean value to set for given sub_mode. |
-
sub_mode = 1: Start/Stop Recording
value = 1starts recording,value = 0stops recording. -
sub_mode = 2: Set Autostart tovalue
Autostart will automatically start recording when engaging the board. Default value: True -
sub_mode = 3: Set Autostop tovalue
Autostop will automatically stop recording when disengaged. Default value: True -
sub_mode = 4: Set Decimation tovalue.
Decimation controls how often samples are recorded. A value of 1 records every sample, 2 records every 2nd sample, etc. This allows recording over a longer time period at reduced resolution. Default value: 1
Requests sending the data. Send mode has two submodes:
sub_mode = 1: Send Headersub_mode = 2: Send Data
The Send Header submode should be sent first to get the metadata, followed by a series of Send Data requests.
This submode has no additional parameters and the package will respond with the DATA_RECORD_HEADER Response.
Note: Requesting the header will pause the recording. If the recording would continue while the data are being fetched, it would overwrite them as they are being read, there is no safeguard.
This submode has one additional parameter:
| Offset | Size | Name | Mandatory | Description |
|---|---|---|---|---|
| 0 | 4 | offset |
Yes | Offset in number of samples to send. |
The client is responsible to request all the chunks of data by repeatedly calling this command with the offsets of the data it needs to fetch.
ID: 41
Response to Control mode requests with the current status of the data recording feature.
| Offset | Size | Name | Description |
|---|---|---|---|
| 0 | 1 | enabled |
Whether data recording is available (requires compatible firmware). |
| 1 | 1 | flags |
Data recording state flags. |
| 2 | 1 | decimation |
Current decimation value. |
| 3 | 2 | duration |
Recording duration in centiseconds (hundredths of a second) at decimation 1 as uint16. |
| 7-3 | 2 | 1 | 0 |
|---|---|---|---|
| 0 | autostop |
autostart |
recording |
ID: 42
Response with the metadata for the recorded data. Sends the total number of samples and then a list of string IDs for the values in each sample, same as in REALTIME_DATA.
| Offset | Size | Name | Description |
|---|---|---|---|
| 0 | 4 | size |
Size of the buffer in number of samples. The client is expected to fetch up to this number of samples. |
| 4 | 1 | recorded_data_id_count |
Number of the recorded items per sample (sample size). |
| 5 | ? | recorded_data_ids |
A string sequence repeated recorded_data_id_count times. |
ID: 43
Response with the actual sample data at the offset given in the request.
| Offset | Size | Name | Description |
|---|---|---|---|
| 0 | 4 | offset |
offset repeated in the response. |
| 4 | ? | samples |
An unspecified number of samples follows until the end of the message. |
sample:
| Offset | Size | Name | Description |
|---|---|---|---|
| 0 | 4 | time |
Timestamp of the sample in ticks, as uint32. |
| 4 | 1 | flags |
Important runtime flags and state. |
| 5 | ? | values |
A sequence of sample values, each 16 bits long and encoded in float16. The number of values is equal to the number of IDs sent in DATA_RECORD_HEADER. |
| 7-4 | 3-2 | 1 | 0 |
|---|---|---|---|
sat |
footpad_state |
wheelslip |
running |
footpad_state:
0: NONE1: LEFT2: RIGHT3: BOTH
sat (setpoint adjustment type):
0: NONE1: CENTERING2: REVERSESTOP6: PB_DUTY10: PB_HIGH_VOLTAGE11: PB_LOW_VOLTAGE12: PB_TEMPERATURE