mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 04:41:36 +08:00
replay: fix issue when original logfile had topics with zero timstamps
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
This commit is contained in:
committed by
Kabir Mohammed
parent
3d271245a1
commit
ed2d4f6a9c
@@ -773,6 +773,7 @@ void Replay::run()
|
|||||||
//to be in chronological order, so we need to check all subscriptions
|
//to be in chronological order, so we need to check all subscriptions
|
||||||
uint64_t next_file_time = 0;
|
uint64_t next_file_time = 0;
|
||||||
int next_msg_id = -1;
|
int next_msg_id = -1;
|
||||||
|
bool first_time = true;
|
||||||
|
|
||||||
for (size_t i = 0; i < _subscriptions.size(); ++i) {
|
for (size_t i = 0; i < _subscriptions.size(); ++i) {
|
||||||
const Subscription *subscription = _subscriptions[i];
|
const Subscription *subscription = _subscriptions[i];
|
||||||
@@ -782,7 +783,8 @@ void Replay::run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (subscription->orb_meta && !subscription->ignored) {
|
if (subscription->orb_meta && !subscription->ignored) {
|
||||||
if (next_file_time == 0 || subscription->next_timestamp < next_file_time) {
|
if (first_time || subscription->next_timestamp < next_file_time) {
|
||||||
|
first_time = false;
|
||||||
next_msg_id = (int)i;
|
next_msg_id = (int)i;
|
||||||
next_file_time = subscription->next_timestamp;
|
next_file_time = subscription->next_timestamp;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user