KodlabPenn / kodlab_mjbots_sdk

Repo for kodlab SDK for use with mjbots ecosystem
Other
8 stars 7 forks source link

Control system time #55

Open ethanmusser opened 2 years ago

ethanmusser commented 2 years ago

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 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.

Related Discussion