rosrust icon indicating copy to clipboard operation
rosrust copied to clipboard

Allow periodic and unique logging

Open adnanademovic opened this issue 6 years ago • 0 comments

Both rospy and roscpp allow various frequencies and ways of logging. In rospy there are most prominently logs that happen periodically or once, as described here.

In the C++ and Python solution, this is done by taking the line number and filename, and maintaining a singleton hash map of all the periodic and unique logs. So logic would be to use lazy_static to create:

  • hashmap periodicLog with key "file:line" and value Time representing the next fitting time.
  • hashset uniqueLog with same key structure.
  • the ros_*_throttle! and ros_*_once! macros would check time/presence, and execute the normal log if things fit, updating the time to (now() + 1s/rate) in the former case.

adnanademovic avatar Dec 26 '17 01:12 adnanademovic