ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

precise timing with rosbag or an alternative

asked 2019-01-24 05:21:47 -0600

volume_8091 gravatar image

The beginner's tutorial reads, that rosbag may be not precise when it comes to the timing. Some tasks I face are not Lyapunov stable, so precise data playback is necessary.

1) Could rosbag be precise with the usage of advanced technical hacks? E.g. RAM-disk as a bag file destination and dedicated CPU core for recording/playing. Are there any ROS directives/modes for precise timing?

2) Are there alternative means of recording and playing messages and requests/responses with precise timing (95% <1ms)? Unfortunately, some non-trivial data like camera output might be involved.

For simplicity let's assume we work with a single machine to avoid network latency issues.

ROS Kinetic, Ubuntu 16.04.05 x64.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2019-01-24 06:11:44 -0600

There is a solution where you can playback a bag file with perfectly accurate 'simulated' time, but not real time. The rosbag API provides the tools to make a node which can scan a read messages out of a bag file in any order or at any time. Using this package you can make a node which can read out and process the data with the exact time-stamps in the bag file, regardless of the actual real time taken to do the processing.

Hope this help.s

edit flag offensive delete link more
1

answered 2019-02-12 12:59:35 -0600

Davide Faconti gravatar image

updated 2019-02-12 13:01:38 -0600

I have a different answer for you :)

99% of the people use rosbag from the command line. This means that your message is:

  • Serialized on the publisher side.
  • Sent it by TCP
  • The rosbag recorder receive the message,
  • Message is stored.

Very few people realize that instead of publishing it, you write the message inside your C++ application, avoiding the latency of point 2) and 3)

The only problem is that you have a single file per process, but you can merge this files later with a script...

Take a look to the C++ API or rosbag_storage https://docs.ros.org/api/rosbag_stora...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-01-24 05:21:47 -0600

Seen: 691 times

Last updated: Feb 12 '19