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

Rviz2 requests data ahead of system clock -> requires extrapolation into the future

asked 2022-02-08 07:56:13 -0500

MasHyke gravatar image

This problem is similar to, but not the same as: https://answers.ros.org/question/3822...

I am having synchronization issues in Rviz2 when trying to visualize my transforms. The transformation is updated using the following code:

rclcpp::Time now = this->get_clock()->now();
geometry_msgs::msg::TransformStamped t;

// Read message content and assign it to
// corresponding tf variables
t.header.stamp = now;
t.header.frame_id = "world";
t.child_frame_id = msg->child_frame_id;

t.transform.translation.x = msg->pose.pose.position.x;
t.transform.translation.y = msg->pose.pose.position.y;

t.transform.rotation = msg->pose.pose.orientation;

// Send the transformation
tf_broadcaster_->sendTransform(t);

I use the system clock through a call to the current node, so this should be the newest timestamp. However, I still get the following error in Rviz2 when I try to visualize it all:

No transform to fixed frame [world]. TF error: [Lookup would require extrapolation into the future. Requested time 1644326574,469065 but the latest data is at time 1644326574,468505, when looking up transform from frame [F15] to frame [world]]

As you can see, Rviz is requesting data ahead by approx. 5 ms. This is a very small difference, shouldn't Rviz be a little bit more patient? Is Rviz2 on a different clock?

If I run tf2_monitor:

RESULTS: for all Frames

Frames:
Frame: /F15, published by <no authority available>, Average Delay: 0.000386881, Max Delay: 0.00139952

All Broadcasters:
Node: <no authority available> 10.0274 Hz, Average Delay: 0.000386881 Max Delay: 0.00139952

Ubuntu 20.04

Ros2 Foxy

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-02-18 02:19:01 -0500

MasHyke gravatar image

If anyone runs into the same problem, I found the solution after trying every possibility in Rviz2. The solution was to not use the "Axes" visualization for dynamic transforms, but rather the "TF" visualization. Static transforms are displayed correctly using "Axes", but for some reason it does not for dynamic transforms.

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2022-02-08 07:56:13 -0500

Seen: 342 times

Last updated: Feb 18 '22