0
$\begingroup$

Rosanswers logo

Hello, I'm publishing a tf from base_link to camera_rgb_optical_frame in order to calculate robot motion from camera motion. When doing this using a frame_tf_broadcaster similar to the one seen in the tf tutorials I get the following warning:

[ WARN] [1374775573.363920696]: TF exception:
Lookup would require extrapolation into the future.  Requested time 1374775573.291255712 but the latest data is at time 1374775573.259098846, when looking up transform from frame [/camera_depth_optical_frame] to frame [/camera_rgb_optical_frame]

So, when I look at the frames I see the following: image description http://screencloud.net//img/screenshots/1cfec494cb5b78cabd7bcda92979d316.png

As you can see the frame tf broadcast is not being recognized.

Am I publishing to the correct frames (base_link -> camera_rgb_optical_frame)? Any idea why the tf isn't being recognized?

Thanks,

EDIT: adding the code of the frame_tf_broadcaster

#include <ros/ros.h>
#include <tf/transform_broadcaster.h>

int main(int argc, char** argv){
  ros::init(argc, argv, "my_tf_broadcaster");
  ros::NodeHandle node;

  tf::TransformBroadcaster br;
  tf::Transform transform;

  ros::Rate rate(10.0);
  while (node.ok()){
    transform.setOrigin( tf::Vector3(0.0, 0.0, 2.0) );
    transform.setRotation( tf::Quaternion(0, 0, 0) );
    br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "base_link", "camera_rgb_optical_frame"));
    rate.sleep();
  }
  return 0;
};

Originally posted by Pino on ROS Answers with karma: 88 on 2013-07-25

Post score: 1


Original comments

Comment by Martin Peris on 2013-07-25:
mmm I don't know if this would make any difference, but have you tried using higher publication rate? maybe ros::Rate rate(30.0)

Comment by Stephan on 2013-07-26:
Instead of writing your own, I suggest you use tf's static_transform_publisher: http://www.ros.org/wiki/tf#static_transform_publisher.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Your camera_rgb_optical_frame already has the parent camera_rgb_frame. So publishing base_link->camera_rgb_optical_frame is not allowed (the structure has to be a tree). Try publishing base_link->camera_link instead.


Originally posted by Stephan with karma: 1924 on 2013-07-26

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by Pino on 2013-08-13:
I believe this worked, the warning is no longer present. Also using static_transform_publisher was a good suggestion. I have a question though, I'm trying to change from "x-right, y-down and z-front" to "x-forward, y-left and z-up", for this I publish how you suggested, but I'm unsure...

Comment by Pino on 2013-08-13:
... about the values. This is how I publish the TF: $ rosrun tf static_transform_publisher 0 0 -1.57079633 1.57079633 0 base_link camera_link 100 but this doesn't seem to achieve the transformation I need, is this the correct method to do this?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.