Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 475

rospy cyclic buffering of topics with timestamps

$
0
0
I have a lot of topics that I want to store in a buffer, but the individual topics shouldn't be recorded for more than 10 seconds each. For a couple of topics this line functions fine, but if I want to subscribe to all topics it starts lagging behind. I need to use something more effective than re-writing a new list, I need to pop all the elements that are older than 10s. `buffer[topic] = [ msg for msg in buffer[topic] if timestamp - msg[0] < rospy.Duration(10.0) ]` Each topics has a timestamp, if this timestamp is larger than 10s we want to remove those elements. Hoping you guys can help.

Viewing all articles
Browse latest Browse all 475

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>