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

Is it possible to reuse the tf::TransformBroadcaster

asked 2016-05-17 10:06:04 -0500

user23fj239 gravatar image

updated 2016-05-17 10:07:12 -0500

It is simple as mentioned above. Is it possible to reuse the object br for multiple transforms having different parent and child frames

static tf::TransformBroadcaster br;
        br.sendTransform( tf::StampedTransform(tf, ros::Time::now(), "frame_1", "frame_2") );
        br.sendTransform( tf::StampedTransform(tf, ros::Time::now(), "frame_2", "frame_3") );

The question popped reading the tutorial here.

Furthermore where should I start looking when the terminal erros me nan_input for the send transform, assuming the quaternion is fine, a normalized unit quaternion.

tf::Quaternion q_f2tof3(rot[3], rot[4], rot[5], qw);
tf::Transform(q_f2tof3, tf::Vector3(0,0,0))
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-05-17 11:00:59 -0500

tfoote gravatar image

Yes, it's fine to reuse the TransformBroadcaster to send multiple different transforms, irrespective of their relationship. Based on your above content you may want to send them simultaneously using a vector of transforms.

A nan_input almost always means an unnormalized quaternion. The other option is that you're passing in a nan value to the vector. But based on the above snippet that does not look possible and as such I'd suggest checking your normalization logic.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-05-17 10:06:04 -0500

Seen: 217 times

Last updated: May 17 '16