0
$\begingroup$

Rosanswers logo

I am not able to get a transformation from "base_laser_link" to the "map" frame Although they are connected in the tf view.
TransformPoint always throws an exception.
Also when I use waitForTransform, it will always return 0. Setting the duration higher won't help either.

Don't know what I could do here...

Here is for example my callback function:

 void markerDetectionCallback(const sensor_msgs::LaserScanConstPtr& msg)
 {
MarkerDetection detector;
//detector.getPositionOfMarker(msg);

try{

    if(listener_.waitForTransform("/map", "/base_laser_link", msg->header.stamp, ros::Duration(1)))
        ROS_INFO("transform OK");
    else
        ROS_ERROR(" Marker node waitForTransform failed");

catch (tf::TransformException ex){
    ROS_ERROR("%s",ex.what());
}
}

This also fails :

           listener_.transformPoint("map", p1, p1_out);
                

with Frame id /map does not exist! Frames (1)

tf_monitor returns this information and looks fine:

RESULTS: for /base_laser_link to /map
Chain is: /map -> /central_server/map -> /odom -> NO_PARENT -> /base_link -> /base_link -> /base_link
Net delay     avg = 0.0276587: max = 0.0562334

tf tf_echo /base_laser_link /map

Failure at 1373963487.596705661
Exception thrown:Lookup would require extrapolation into the past.  Requested time 1373963487.580510149 but the earliest data is at time 1373963487.796449639, when looking up transform from frame [/map] to frame [/base_link]

The current list of frames is:
Frame /base_link exists with parent /odom.
Frame /odom exists with parent /map.
Frame /map exists with parent /central_server/map.
Frame /central_server/map exists with parent NO_PARENT.
Frame /base_laser_link exists with parent /base_link.
Frame /ultrasonic_left exists with parent /base_link.
Frame /ultrasonic_right exists with parent /base_link.

At time 1373967822.996
- Translation: [-13.529, -29.468, 0.000]
- Rotation: in Quaternion [-0.000, -0.000, 0.286, 0.958]
            in RPY [-0.000, -0.000, 0.579]

So tf_echo should be fine.


Originally posted by madmax on ROS Answers with karma: 496 on 2013-07-15

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Your problem is that you are not giving your listener time to fill it's buffer. You need to create the listener in a persistent location and then query it on demand. I recommend reading through the tf and Time tutorial


Originally posted by tfoote with karma: 58457 on 2013-07-15

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by madmax on 2013-07-15:
Well, was a copy and paste mistake. The listener is a member variable. Do I have to start the listener somehow? Because just writing tf::TransformListener listener_; in the private field of the class starts the listener by invoking the constructor of the class?

Comment by tfoote on 2013-07-15:
If you need more help, please provide the exact errors you are getting and an example of you tf tree.

Comment by tfoote on 2013-07-15:
with NO_PARENT in the middle of the chain it is not connected.

Comment by madmax on 2013-07-15:
Yes, but why is rviz able to show me the transformation and tf view_frames? And tf echo says it fails because it would require extrapolation into the past... I may have to look how the tf's are generated, but most of them seem to be static transformers. Strange.

Comment by tfoote on 2013-07-16:
The exception you have pasted still has the same problem I noted above that you have not let the transform listener build up it's buffer before you query it. The buffer will not back fill data, it must be receiving data already before you can query it.

$\endgroup$

Your Answer

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