write msg in .bag at specific time

asked 2019-11-14 11:33:06 -0500

occonni gravatar image

updated 2019-11-15 04:33:54 -0500

Hey guys,

How can I create a .bag file and specify the intervall of a message? When I'm doing that like in the rosbag API:

bag = rosbag.Bag('test.bag', 'w')

#write to .bag function
{
s = Imu()
bag.write('/chatter', s)
}

while 's' is an e.g. sensor_msgs/Imu. When I Increment the s.header.stamp.secs by 1, the message isnt published every second. In my specific case that write-function is called e.g. in an intervall of five seconds and I want to write the data in an intervall of one second instead of 5. The Message is going to be published just every fifth second.

Does anybody has a clue whats going on there?

Best

Occooni

edit retag flag offensive close merge delete