Problem with tf tutorial
I followed the tutorial http://wiki.ros.org/tf/Tutorials/Writ...
I encountered this error while doing catkin_make
CMakeFiles/turtle_tf_broadcaster.dir/src/turtle_tf_broadcaster.cpp.o: In function `poseCallback(boost::shared_ptr<turtlesim::Pose_<std::allocator<void> > const> const&)':
turtle_tf_broadcaster.cpp:(.text+0x57): undefined reference to `tf::TransformBroadcaster::TransformBroadcaster()'
turtle_tf_broadcaster.cpp:(.text+0x211): undefined reference to `tf::TransformBroadcaster::sendTransform(tf::StampedTransform const&)'
collect2: error: ld returned 1 exit status
learning_tf/CMakeFiles/turtle_tf_broadcaster.dir/build.make:113: recipe for target '/home/calvin/catkin_ws/devel/lib/learning_tf/turtle_tf_broadcaster' failed
make[2]: *** [/home/calvin/catkin_ws/devel/lib/learning_tf/turtle_tf_broadcaster] Error 1
CMakeFiles/Makefile2:1482: recipe for target 'learning_tf/CMakeFiles/turtle_tf_broadcaster.dir/all' failed
make[1]: *** [learning_tf/CMakeFiles/turtle_tf_broadcaster.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed
I don't think I have problem with the CMakeLists but to just make sure
I put
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
tf
turtlesim
)
and
add_executable(turtle_tf_broadcaster src/turtle_tf_broadcaster.cpp)
target_link_libraries(turtle_tf_broadcaster ${catkin_LIBRARIES})
and my package.xml looks has this inside
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>tf</build_depend>
<build_depend>turtlesim</build_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>tf</build_export_depend>
<build_export_depend>turtlesim</build_export_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>tf</exec_depend>
<exec_depend>turtlesim</exec_depend>
Please tell me what is the error with this?
Complete CMakeLists.txt
cmake_minimum_required(VERSION 2.8.3)
project(learning_tf)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
tf
turtlesim
)
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES learning_tf
# CATKIN_DEPENDS roscpp rospy tf turtlesim
# DEPENDS system_lib
)
include_directories(
# include
${catkin_INCLUDE_DIRS}
)
add_executable(turtle_tf_broadcaster src/turtle_tf_broadcaster.cpp)
target_link_libraries(turtle_tf_broadcaster ${catkin_LIBRARIES})
Please include your full CMakelists file. Its definitely a problem with your CMakeLists. I would suspect you didnt add the packages to the catkin_package() macro
hello, I have included my CMakeLists inside my posts here. There is a lot of comments generated from auto catkin_create_pkg learning_tf tf roscpp rospy turtlesim
@calvintanct I've removed the majority of the comments from your CMakeLists.txt file as they're not necessary