mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-14 22:20:35 +08:00
ReplayEkf: correctly add all subscriptions
Logged data and subscription messages can be mixed, so don't stop adding subscriptions after finding the first logged message
This commit is contained in:
committed by
Mathieu Bresciani
parent
30a6a854c1
commit
fa0ba69083
@@ -902,6 +902,7 @@ Replay::run()
|
||||
|
||||
PX4_INFO("Replay in progress...");
|
||||
|
||||
// Find and add all subscriptions
|
||||
ulog_message_header_s message_header;
|
||||
replay_file.seekg(_data_section_start);
|
||||
|
||||
@@ -910,22 +911,23 @@ Replay::run()
|
||||
replay_file.read((char *)&message_header, ULOG_MSG_HEADER_LEN);
|
||||
|
||||
if (!replay_file) {
|
||||
// end of file
|
||||
break;
|
||||
}
|
||||
|
||||
if (message_header.msg_type == (int)ULogMessageType::ADD_LOGGED_MSG) {
|
||||
readAndAddSubscription(replay_file, message_header.msg_size);
|
||||
|
||||
} else if (message_header.msg_type == (int)ULogMessageType::DATA) {
|
||||
// End of Definition & Data Section Message Header section
|
||||
break;
|
||||
|
||||
} else {
|
||||
// Not important for now, skip
|
||||
replay_file.seekg(message_header.msg_size, ios::cur);
|
||||
}
|
||||
}
|
||||
|
||||
// Rewind back to the begining of the data section
|
||||
replay_file.seekg(_data_section_start);
|
||||
replay_file.clear();
|
||||
|
||||
const uint64_t timestamp_offset = getTimestampOffset();
|
||||
uint32_t nr_published_messages = 0;
|
||||
streampos last_additional_message_pos = _data_section_start;
|
||||
|
||||
Reference in New Issue
Block a user