Browse Source

Replay: include a minimal set of FMT messages at start of log

mission-4.1.18
Andrew Tridgell 9 years ago
parent
commit
1e44251d35
  1. 2
      Tools/Replay/LogReader.cpp
  2. 15
      Tools/Replay/Replay.cpp

2
Tools/Replay/LogReader.cpp

@ -29,7 +29,7 @@
extern const AP_HAL::HAL& hal; extern const AP_HAL::HAL& hal;
static const struct LogStructure log_structure[] = { const struct LogStructure log_structure[] = {
LOG_COMMON_STRUCTURES, LOG_COMMON_STRUCTURES,
{ LOG_CHEK_MSG, sizeof(log_Chek), { LOG_CHEK_MSG, sizeof(log_Chek),
"CHEK", "QccCLLffff", "TimeUS,Roll,Pitch,Yaw,Lat,Lng,Alt,VN,VE,VD" } "CHEK", "QccCLLffff", "TimeUS,Roll,Pitch,Yaw,Lat,Lng,Alt,VN,VE,VD" }

15
Tools/Replay/Replay.cpp

@ -98,13 +98,22 @@ void ReplayVehicle::load_parameters(void)
AP_Param::set_default_by_name("LOG_FILE_BUFSIZE", 60); AP_Param::set_default_by_name("LOG_FILE_BUFSIZE", 60);
} }
static const struct LogStructure min_log_structure[] = {
{ LOG_FORMAT_MSG, sizeof(log_Format),
"FMT", "BBnNZ", "Type,Length,Name,Format,Columns" },
{ LOG_PARAMETER_MSG, sizeof(log_Parameter),
"PARM", "QNf", "TimeUS,Name,Value" },
{ LOG_MESSAGE_MSG, sizeof(log_Message),
"MSG", "QZ", "TimeUS,Message"},
};
void ReplayVehicle::setup(void) void ReplayVehicle::setup(void)
{ {
load_parameters(); load_parameters();
// we pass zero log structures, as we will be outputting the log // we pass a minimal log structure, as we will be outputting the
// structures we need manually, to prevent FMT duplicates // log structures we need manually, to prevent FMT duplicates
dataflash.Init(nullptr, 0); dataflash.Init(min_log_structure, ARRAY_SIZE(min_log_structure));
dataflash.StartNewLog(); dataflash.StartNewLog();
ahrs.set_compass(&compass); ahrs.set_compass(&compass);

Loading…
Cancel
Save