Currently, we can publish LCM messages from multiple sources over multiple channels via the LcmPublisher class. These can be recorded and played back using the lcm-logger and lcm-logplayer LCM utilities. However, we have no good way of timestamping these outgoing messages.
Proposed Solution
Maintain a realtimetools::Timer object in the MjbotsControlLoop realtime thread, which acts as the global system time, and pass this to all objects that may publish LCM messages (e.g., robots, behaviors) or otherwise require system time via raw or shared pointers. This solution permits the synchronization of LCM messages based on recorded timestamps, which may be useful in debugging or examining logs. This solution is only trivial as long as the LCM publisher and control loop are running on the same thread.
Problem
Currently, we can publish LCM messages from multiple sources over multiple channels via the
LcmPublisher
class. These can be recorded and played back using thelcm-logger
andlcm-logplayer
LCM utilities. However, we have no good way of timestamping these outgoing messages.Proposed Solution
Maintain a
realtimetools::Timer
object in theMjbotsControlLoop
realtime thread, which acts as the global system time, and pass this to all objects that may publish LCM messages (e.g., robots, behaviors) or otherwise require system time via raw or shared pointers. This solution permits the synchronization of LCM messages based on recorded timestamps, which may be useful in debugging or examining logs. This solution is only trivial as long as the LCM publisher and control loop are running on the same thread.Related Discussion