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

Error while compiling transform_listener from ROS tutorials

asked 2013-11-21 21:10:26 -0500

Krunal Chande gravatar image

updated 2013-11-22 08:10:56 -0500

Hey I am trying to follow the ROS tutorials on Navigation Stack

I can successfully compile tf_broadcaster.cpp but it throws a bunch of errors with tf_listener.cpp. Could you please have a look and tell me what should I do?

I have even tried copy/pasting the code from the website, still doesn't work.

Running ros groovy with ubuntu 12.04

[ 80%] Building CXX object robot_setup_tf/CMakeFiles/tf_listener.dir/src/tf_listener.cpp.o
[100%] Building CXX object robot_setup_tf/CMakeFiles/tf_broadcaster.dir/src/tf_broadcaster.cpp.o
Linking CXX executable /home/krunal/turtlebot/Research/Gatech/devel/lib/robot_setup_tf/tf_broadcaster
[100%] Built target tf_broadcaster
Linking CXX executable /home/krunal/turtlebot/Research/Gatech/devel/lib/robot_setup_tf/tf_listener
    CMakeFiles/tf_listener.dir/src/tf_listener.cpp.o: In function `transformPoint(tf::TransformListener const&)':
tf_listener.cpp:(.text+0xda): undefined reference to `tf::TransformListener::transformPoint(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, geometry_msgs::PointStamped_<std::allocator<void> > const&, geometry_msgs::PointStamped_<std::allocator<void> >&) const'
tf_listener.cpp:(.text+0xf9): undefined reference to `ros::console::g_initialized'
tf_listener.cpp:(.text+0x109): undefined reference to `ros::console::initialize()'
tf_listener.cpp:(.text+0x152): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::console::levels::Level)'
tf_listener.cpp:(.text+0x18d): undefined reference to `ros::console::setLogLocationLevel(ros::console::LogLocation*, ros::console::levels::Level)'
tf_listener.cpp:(.text+0x197): undefined reference to `ros::console::checkLogLocationEnabled(ros::console::LogLocation*)'
tf_listener.cpp:(.text+0x231): undefined reference to `ros::console::print(ros::console::FilterBase*, log4cxx::Logger*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
tf_listener.cpp:(.text+0x318): undefined reference to `ros::console::g_initialized'
tf_listener.cpp:(.text+0x328): undefined reference to `ros::console::initialize()'
tf_listener.cpp:(.text+0x371): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::console::levels::Level)'
tf_listener.cpp:(.text+0x3ac): undefined reference to `ros::console::setLogLocationLevel(ros::console::LogLocation*, ros::console::levels::Level)'
tf_listener.cpp:(.text+0x3b6): undefined reference to `ros::console::checkLogLocationEnabled(ros::console::LogLocation*)'
tf_listener.cpp:(.text+0x41a): undefined reference to `ros::console::print(ros::console::FilterBase*, log4cxx::Logger*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
CMakeFiles/tf_listener.dir/src/tf_listener.cpp.o: In function `main':
tf_listener.cpp:(.text+0x4b5): undefined reference to `ros::init(int&, char**, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
tf_listener.cpp:(.text+0x511): undefined reference to `ros::NodeHandle::NodeHandle(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)'
tf_listener.cpp:(.text+0x564): undefined reference to `tf::TransformListener::TransformListener(ros::Duration, bool)'
tf_listener.cpp:(.text+0x628): undefined reference to `ros::NodeHandle::createTimer(ros::Duration, boost ...
(more)
edit retag flag offensive close merge delete

Comments

Tutorial from here http://wiki.ros.org/navigation/Tutorials/RobotSetup/TF Apparently, I cannot add links because I do not have enough karma.

Krunal Chande gravatar image Krunal Chande  ( 2013-11-21 21:10:59 -0500 )edit

It's probably not linking tf. What is your CMakeLists.txt and what build system do you use?

dornhege gravatar image dornhege  ( 2013-11-22 00:41:54 -0500 )edit

Added CMakeLists.txt. I am using catkin.

Krunal Chande gravatar image Krunal Chande  ( 2013-11-22 08:07:21 -0500 )edit

It builds successfully, and while "Linking CXX executable" it gives these errors. Added the two lines before the error message which says precisely that.

Krunal Chande gravatar image Krunal Chande  ( 2013-11-22 08:10:09 -0500 )edit

Did you found a solution? I ran into the same Problem at the moment.

einrob gravatar image einrob  ( 2014-02-03 23:32:25 -0500 )edit

Sorry I did not. Post the answer here if you do manage to find it!

Krunal Chande gravatar image Krunal Chande  ( 2014-02-04 05:18:02 -0500 )edit

3 Answers

Sort by » oldest newest most voted
3

answered 2014-03-28 01:42:23 -0500

demmeln gravatar image

Without looking at it much, the part of the CMakeLists.txt target_link_libraries(tf_listener ${catkin_libraries}) seems wrong. CMake variables are case sensitive, so you need to use catkin_LIBRARIES.

edit flag offensive delete link more
0

answered 2015-07-26 22:12:45 -0500

Anoshan gravatar image

This answer helped me >> http://answers.ros.org/question/15544...

edit flag offensive delete link more
0

answered 2014-03-27 15:00:01 -0500

AlphaOne gravatar image

Check your cmakelist if you don't tell catkin to find tf you'll get this error.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-11-21 21:10:26 -0500

Seen: 2,690 times

Last updated: Mar 28 '14