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

[rviz2] Lookup would require extrapolation into the future

asked 2023-03-30 16:57:32 -0600

Nopas gravatar image

updated 2023-04-01 01:47:27 -0600

gvdhoorn gravatar image

Hi,

I've got a ydlidar X4 publishing in /scan and I would like to display a map while I'm moving it around (by hand).

I use ros2_laser_scan_matcher to calculate odometry data and publish the odom/base_link tf.

I've a laser_frame and base_link that are basicaly attached together.

Everything is runing on the same computer.

Once I run rviz2, everything works as expected with base_link or laser_frame as fixed frame. But if I use odom as fixed frame, I can't display the /scan data anymore. However, I can still correctly display the odom and base_link frames' position. I get the following error :

[ERROR] [1680210915.546343593] [rviz2]: Lookup would require extrapolation into the future.  Requested time 1680210915,336426 but the latest data is at time 1680210915,212826, when looking up transform from frame [laser_frame] to frame [odom]

There is always ~0.1s gap.


Edit: There are some rate differences but I don't know if they're acceptable or not.

user@ROS:~/ros2_ws$ ros2 topic hz /scan
average rate: 8.155
    min: 0.118s max: 0.128s std dev: 0.00305s window: 10
average rate: 8.148
    min: 0.118s max: 0.128s std dev: 0.00235s window: 19
average rate: 8.141
    min: 0.115s max: 0.130s std dev: 0.00348s window: 28
^Cuser@ROS:~/ros2_ws$ ros2 topic hz /tf
average rate: 8.613
    min: 0.066s max: 0.151s std dev: 0.02656s window: 10
average rate: 8.500
    min: 0.066s max: 0.153s std dev: 0.02444s window: 19
^Cuser@ROS:~/ros2_ws$ ros2 topic hz /
/clicked_point                              /rosout
/goal_pose                                  /scan
/initialpose                                /tf
/odom                                       /tf_static
/parameter_events                           /ydlidar_ros2_driver_node/transition_event
user@ROS:~/ros2_ws$ ros2 topic hz /tf_static 
^Cuser@ROS:~/ros2_ws$ ros2 topic hz /odom
average rate: 8.168
    min: 0.083s max: 0.166s std dev: 0.02188s window: 10
average rate: 8.078
    min: 0.083s max: 0.166s std dev: 0.02518s window: 18
^Cuser@ROS:~/ros2_ws$

C:\fakepath\frames_2023-03-31_12.00.02_page-0001.jpg

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2023-04-02 14:29:01 -0600

Nopas gravatar image

updated 2023-04-05 04:44:56 -0600

Hey, thanks everyone for the help. I've finaly found that there was a frame rate parameter in rviz2. It was set by default at 30. I dropped it down to 8 and now it is working. (I can't realy go higher or I can still get this error from times to times).

For the rate of my static_transform_publisher that would be too high : no, it is from the tf2 package and publish in /tf_static, from my research, there is no rate control anymore, static transform timing issues are supposed to be solved by tf2. However, I've looked at the tf2_node (started by the companie's launcher) and it was calling the executable with x y z r p y X parent_frame child_frame, I don't know what is this X (set to 1), I erased it.

For the time_increment of the scan message, might be difficult to know which value I should set : I don't have access to the driver's code (I've some src but they're all based on a binary file that manages the low lvl driving, including the time_increment). And I haven't looked at the source code of rviz2, anyway my problem is now solved.

Thanks !

edit flag offensive delete link more

Comments

it was calling the executable with x y z r p y X parent_frame child_frame, I don't know what is this X (set to 1), I erased it.

Someone specified the orientation as a quaternion rather than with euler angles. Also, the order of the euler angles is not r p y, non-intuitively this node uses y p r.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-04-05 06:16:21 -0600 )edit
0

answered 2023-04-02 09:36:46 -0600

Mike Scheutzow gravatar image

updated 2023-04-02 09:41:42 -0600

This error message seems to be coming from the LaserScan plugin in rviz2. Search for second instance of the word tolerance in this file (currently line 67):

https://github.com/ros2/rviz/blob/hum...

In humble, the TF lookup tolerance is calculated from the time_increment field of the LaserScan message. I haven't tried it, but my guess is that you need to either 1) increase that value in the LaserScan message, or 2) edit the source code of this plugin to use a reasonable initial value for filter_tolerance_.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2023-03-30 16:57:32 -0600

Seen: 1,071 times

Last updated: Apr 05 '23