Question regarding tf2 static_transform_publisher [closed]

asked 2014-07-18 15:36:10 -0500

mpthompson gravatar image

Under ROS Hydro, I'm attempting to publish static transforms using the tf2_ros static_transform_publisher using the following in may .launch files:

<node name="tag00001_publisher" pkg="tf2_ros" type="static_transform_publisher" args="1.00 1.00 0.35 0.00 0.00 0.7071 0.7071 /map /tag00001" />

In my C++ code I want to use these transform. To do so making a call using the canTransform() method on the tf2_ros::Buffer object to make sure the transform can occur before getting the transform with the lookupTransform() method.

if (tf_buffer_.canTransform(map_frame_, tag_frame_, ros::Time::now(), ros::Duration(0.1), &tf_err) {

This method call will succeed the first time, but subsequent calls will fail. However, if I use tf to publish the static transform as shown below, the code above will always succeed.

<node name="tag00001_publisher" pkg="tf" type="static_transform_publisher" args="1.00 1.00 0.35 0.00 0.00 1.57 /map /tag00001 100" />

Is this an issue with the tf2_ros::Buffer.canTransform() not yet properly working with latched transform publishers?

What's puzzling to me is why the call to the canTransform() method will succeed once, but not on subsequent calls unless I'm using the tf version of the static_transform_publisher.

I have a feeling there is something missing in my understanding of tf2 and how the tf2_ros::Buffer class. Unfortunately, the tf2 tutorials are woefully outdated and not very helpful in this regards.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2018-01-30 22:11:59.894651



did you solve the problem? I'm having the same issue.

Hernan gravatar image Hernan  ( 2015-08-11 08:31:50 -0500 )edit