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

Why is my state_publisher build complaining about tf::TransformBroadcaster?

asked 2013-11-29 13:20:05 -0600

flb gravatar image

I am actually trying to put together enough to visualize my URDF model in RVIZ. I currently have two files in my workspace:

  • …_ws/src/rbot_description/urdf/rbot.urdf
  • …_ws/src/rbot_description/src/state_publisher.cpp

When I call catkin_make the state_publisher fails to build. The failure message reads: "… undefined reference to 'tf::TransformBroadcaster::sendTransform(geometry_msgs::TransformStamped_<std::allocator<void> > const&)' "

What do I need to do to fix this error?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2014-08-08 06:22:36 -0600

CryptoKnight gravatar image

updated 2014-08-08 06:34:51 -0600

"undefined reference to" error occurs when object file (.so file), corresponding to a particular included header has not been linked to your target (the executable to be built). In this case, tf/transform_broadcaster.h.

try adding this line in your CMakelists.txt:

target_link_libraries("name of executable" "location of file"/_tf.so "location of file"/_tf2.so )

put the location of the file _tf.so and _tf2.so in the respective "location of file"

eg. target_link_libraries(state_publisher opt/ros/groovy/lib/python2.7/dist-packages/tf/_tf.so opt/ros/groovy/lib/python2.7/dist-packages/tf2/_tf2.so )

Also, if not added, add tf package dependency in manifest.xml.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2013-11-29 13:20:05 -0600

Seen: 980 times

Last updated: Aug 08 '14