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

Realsense d435 Lookup would require extrapolation into the future

asked 2019-08-19 07:34:35 -0500

akosodry gravatar image

Hello!

I am using a realsense d435 rgbd camera to capture the world around the robot.

I am performing coordinate transformation in the camera callback pcCallback(const sensor_msgs::PointCloud2ConstPtr& cloud_msg) (in cca every 1 sec, just if a condition is satisfied..)

I perform the transformation with:

success = camTfListener->waitForTransform(REF_FRAME,SOURCE_FRAME,ros::Time(0),ros::Duration(10.0),ros::Duration(0.01),&error_msg);

I only continue with the processing if success is true (so if the transformation was successful - i assume...)

But what i experience is, that even if the transformation is unsuccessful, the function waitForTransform returns true. Is this possible?

So i get in the same time:

1)success=true and

2)[ERROR]: Lookup would require extrapolation into the future. Requested time 1566215389.147320515 but the latest data is at time 1566215389.029921464, when looking up transform from frame [camera_color_optical_frame] to frame [base_link]

Also since success was true, i my algorithm continues with image processing and i get lots of errors such as [pcl::VoxelGrid::applyFilter] Input dataset doesn't have x/y/z coordinates, etc...

Can you please give some hints how to solve this issue?

Remark: the camera works on 30 fps, i have also a static_transform_publisher running on 100Hz - that links the camera_link to the end_effector of the robot.

Thank you in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-08-19 07:55:07 -0500

pavel92 gravatar image

There are few things you can try. First try using ros::Time::now() instead of ros::Time(0) in your waitForTransform to get the transform at the current time instead of the latest transform.

Also you can try to catch the exception instead of using success. For example with the following you retain the same functionality:

  try {
    camTfListener->waitForTransform(REF_FRAME, SOURCE_FRAME, ros::Time(0), ros::Duration(10.0),
                                    ros::Duration(0.01), &error_msg);
  } catch (tf2::ExtrapolationException &e) {
    ROS_ERROR_STREAM("ExtrapolationException: " << e.what());
    return;
  }
edit flag offensive delete link more

Comments

1

also you can catch the tf2::TransformException exception if you are transforming a pose via camTfListener.transformPose()

pavel92 gravatar image pavel92  ( 2019-08-19 08:08:44 -0500 )edit

Thank you, im trying in 5 mins i will report what i got

akosodry gravatar image akosodry  ( 2019-08-19 08:28:37 -0500 )edit

@pavel92 Thank you once more for the help!

Out of 112 times the error did not appear :)

akosodry gravatar image akosodry  ( 2019-08-19 09:29:00 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-08-19 07:34:35 -0500

Seen: 794 times

Last updated: Aug 19 '19