replay: add replay module, build for sitl_default, but do not load on startup

This adds a new module that does:
- read an parse an ULog file, given via ENV variable 'replay'
- apply all parameters from the log file
- read and apply user-defined override parameters from a file
- publish all messages in 'real-time' from the log file and add a constant
  offset to the timestamp to match the system time.
- apply changed parameters in the log (which are not overridden)
This commit is contained in:
Beat Küng
2016-07-07 12:51:42 +02:00
committed by Lorenz Meier
parent ffcefd9047
commit 28ad6066aa
7 changed files with 1110 additions and 2 deletions
+6 -2
View File
@@ -49,14 +49,18 @@ enum class ULogMessageType : uint8_t {
/* declare message data structs with byte alignment (no padding) */
#pragma pack(push, 1)
#define ULOG_MSG_HEADER_LEN 3 //accounts for msg_size and msg_type
/** first bytes of the file */
struct ulog_file_header_s {
uint8_t magic[8];
uint64_t timestamp;
};
#define ULOG_MSG_HEADER_LEN 3 //accounts for msg_size and msg_type
struct ulog_message_header_s {
uint16_t msg_size;
uint8_t msg_type;
};
struct ulog_message_format_s {
uint16_t msg_size; //size of message - ULOG_MSG_HEADER_LEN
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::FORMAT);