Recreate remote timestamp logging in LogReader
It is useful to be able to log data, replay it into a simulation, and
then recreate a log again. To do this, we need remote timestamps to
work correctly.
When LogReader replays a forwarded message, it now creates the
corresponding MessageHeader and publishes it. It also tracks the queue
indicies such that the message is valid and can be logged.
Logger also translates channel indices as well when the logging config
is not the event loop config.
Change-Id: Iff6175a204b191c6f43a1d73ffce5b542925860c
diff --git a/aos/events/logging/logfile_utils.cc b/aos/events/logging/logfile_utils.cc
index 15b4fd9..70dae61 100644
--- a/aos/events/logging/logfile_utils.cc
+++ b/aos/events/logging/logfile_utils.cc
@@ -1153,6 +1153,8 @@
timestamp.realtime_event_time =
realtime_clock::time_point(chrono::nanoseconds(
std::get<2>(oldest_timestamp).message().realtime_sent_time()));
+ timestamp.queue_index =
+ std::get<2>(oldest_timestamp).message().queue_index();
// Consistency check.
CHECK_EQ(timestamp.monotonic_event_time, std::get<0>(oldest_timestamp));
@@ -1255,6 +1257,7 @@
timestamp.realtime_event_time =
realtime_clock::time_point(chrono::nanoseconds(
std::get<2>(oldest_message).message().realtime_sent_time()));
+ timestamp.queue_index = std::get<2>(oldest_message).message().queue_index();
timestamp.remote_queue_index = 0xffffffff;
CHECK_EQ(std::get<0>(oldest_message), timestamp.monotonic_event_time);