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

Exception problem that is related to time issue

asked 2012-01-25 19:39:12 -0600

alfa_80 gravatar image

I have 2 nodes that all read/deal with time from a recorded dataset(It doesn't start with ros::Time::now() and the like). After I successfully build the point cloud using those data then, I've just realized that I caught a lot of exceptions(after looking at the rxconsole output) that is related to time issue. I would prefer to solve this problem because it will be useful if I want to use with other nodes that are normally expect ROS time. I copied some information from the debug info as below:

Is there any solution for this:

header: 
  seq: 11
  stamp: 1327570083.262721196
  frame_id: 
level: 4
name: /pointcloud_builder_node
msg: Problem: Lookup would require extrapolation into the past.  Requested time 24.553000000 but the earliest data is at time 1327570080.147540118, when looking up transform from frame [/laser] to frame [/base_link].

If I interpret correctly, 24.553000000 is the one in my dataset and 1327570080.147540118 is the one that ROS was using.

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-01-25 20:57:45 -0600

Lorenz gravatar image

I see two possible solutions here. Either you can use rosbag play --clock <bag> and set the ros parameter use_sim_time to true (link) or you write your own rosbag playback node (e.g. using the python API, link) and set the time stamps manually to current time before publishing them.

The former solution causes all your nodes (don't forget to restart them after setting use_sim_time) to run on the timestamps recorded in the bag. That only works if you don't run on a real robot and want to use real sensors. The latter solution is more work to implement but is also more flexible. It would be just a few lines of python code though.

edit flag offensive delete link more

Comments

For the latter solution, does that mean, all my data indices like x-value, say stored in [:,3] will be changed right?
alfa_80 gravatar image alfa_80  ( 2012-01-25 21:15:13 -0600 )edit
For the latter solution also, what do you mean by "set the time stamps manually to current time before publishing them..", how do I convert say for my timestamp of 2 row say "24.553" into ROS-type one?
alfa_80 gravatar image alfa_80  ( 2012-01-25 21:17:34 -0600 )edit
My dataset is not in rosbag anyway. it's just in "normal" .txt format.
alfa_80 gravatar image alfa_80  ( 2012-01-25 21:19:39 -0600 )edit
How do you play it back then and how are the time stamps generated?
Lorenz gravatar image Lorenz  ( 2012-01-25 22:30:02 -0600 )edit
It contains many data from some sensors, say for laser scanner data, I write a publisher node that reads certain columns and all rows in a dataset. The timestamps are generated by somebody else which I use it to publish those laser data.
alfa_80 gravatar image alfa_80  ( 2012-01-25 22:36:02 -0600 )edit
If the time stamps are set using ros::Time::now() right before the laser package is published, the stamps should be fine at least. Do a `rostopic echo /your/laser/topic` to check what they are set to.
Lorenz gravatar image Lorenz  ( 2012-01-25 22:37:36 -0600 )edit
The output: " seq: 32 stamp: secs: 25 nsecs: 348000000 frame_id: laser "
alfa_80 gravatar image alfa_80  ( 2012-01-25 22:53:31 -0600 )edit
I'm the one who wrote this publisher. So, I just use the timestamp from the dataset when I publish it.
alfa_80 gravatar image alfa_80  ( 2012-01-25 22:54:48 -0600 )edit

Question Tools

Stats

Asked: 2012-01-25 19:39:12 -0600

Seen: 656 times

Last updated: Jan 25 '12