"Undefined reference to »tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)«
Hello, I am stuck in launching the turtlebot3 navigation. I tried different things to get it run but nothing worked. Now it is even worse and my catkin_make doesn't work anymore.... Maybe this came from uninstalling tf (and reinstalling it).
I get the same two errors for different packages:
[ 88%] Building CXX object navigation/base_local_planner/CMakeFiles/base_local_planner.dir/src/footprint_helper.cpp.o
**/opt/ros/melodic/lib/libtf.so: Warnung: undefinierter Verweis auf »tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)«
collect2: error: ld returned 1 exit status
turtlebot3_simulations/turtlebot3_fake/CMakeFiles/turtlebot3_fake_node.dir/build.make:118: recipe for target '/home/lslabon/catkin_ws/devel/lib/turtlebot3_fake/turtlebot3_fake_node' failed
make[2]: *** [/home/lslabon/catkin_ws/devel/lib/turtlebot3_fake/turtlebot3_fake_node] Error 1
CMakeFiles/Makefile2:17628: recipe for target 'turtlebot3_simulations/turtlebot3_fake/CMakeFiles/turtlebot3_fake_node.dir/all' failed
make[1]: *** [turtlebot3_simulations/turtlebot3_fake/CMakeFiles/turtlebot3_fake_node.dir/all] Error 2**
make[1]: *** Auf noch nicht beendete Prozesse wird gewartet …
[ 89%] Building CXX object navigation/base_local_planner/CMakeFiles/base_local_planner.dir/src/goal_functions.cpp.o
/opt/ros/melodic/lib/libtf.so: Warnung: undefinierter Verweis auf »tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)«
collect2: error: ld returned 1 exit status
slam_gmapping/gmapping/CMakeFiles/slam_gmapping.dir/build.make:166: recipe for target '/home/lslabon/catkin_ws/devel/lib/gmapping/slam_gmapping' failed
make[2]: *** [/home/lslabon/catkin_ws/devel/lib/gmapping/slam_gmapping] Error 1
CMakeFiles/Makefile2:11899: recipe for target 'slam_gmapping/gmapping/CMakeFiles/slam_gmapping.dir/all' failed
make[1]: *** [slam_gmapping/gmapping/CMakeFiles/slam_gmapping.dir/all] Error 2
[ 89%] Building CXX object navigation/base_local_planner/CMakeFiles/base_local_planner.dir/src/map_cell.cpp.o
/opt/ros/melodic/lib/libtf.so: Warnung: undefinierter Verweis auf »tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)«
collect2: error: ld returned 1 exit status
slam_gmapping/gmapping/CMakeFiles/slam_gmapping_replay.dir/build.make:166: recipe for target '/home/lslabon/catkin_ws/devel/lib/gmapping/slam_gmapping_replay' failed
make[2]: *** [/home/lslabon/catkin_ws/devel/lib/gmapping/slam_gmapping_replay] Error 1
CMakeFiles/Makefile2:12046: recipe for target 'slam_gmapping/gmapping/CMakeFiles/slam_gmapping_replay.dir/all' failed
make[1]: *** [slam_gmapping/gmapping/CMakeFiles/slam_gmapping_replay.dir/all] Error 2
What does this line Undefined reference to »tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)
mean... ? I am kinda frustrated now.
I am using gazebo version 11.1.0 and ros melodic. I already sourced my enviroment setup for like 1000 times and tried to install tf2 again (maybe there was something missing or so)
ROS enviroment variables:
ROS_ETC_DIR=/opt/ros/melodic/etc/ros
ROS_ROOT=/opt/ros/melodic/share/ros
ROS_MASTER_URI=http://localhost:11311
ROS_VERSION=1
ROS_PYTHON_VERSION=2
ROS_PACKAGE_PATH=/home/lslabon/catkin_ws/src:/home/lslabon/mybot_ws/src:/opt/ros/melodic/share
ROSLISP_PACKAGE_DIRECTORIES=/home/lslabon/catkin_ws/devel/share/common-lisp:/home/lslabon/mybot_ws/devel/share/common-lisp
ROS_DISTRO=melodic
I hope somenody can help me with this.
Thanks a lot! Laura
PS: This was the problem I was actually trying to solve, I guess the movebase file was build bad, cause I could not find the file in opt/ros/melodic/lib - only in my catkinws:
$ roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=lslabon@pccad111Ubuntu/map.yaml
ERROR: cannot launch node of type [move_base/move_base]: Cannot locate node of type [move_base] in package [move_base]. Make sure file exists in package path and permission is set to executable (chmod +x)
Asked by lslabon on 2020-09-07 10:00:34 UTC
Answers
Please check which version of the navigation stack you have checked out. Tf2 errors like this often mean that the wrong branch is checked out. You should have the melodic-devel branch.
Asked by David Lu on 2020-09-09 21:02:54 UTC
Comments
I've just reinstalled everything from scratch and it worked... There might have been something missing (what must have defined it) - don't know how I can close this thread now ?
Asked by lslabon on 2020-09-10 08:42:21 UTC
Comments
Hi Islabon, I have the same problem with you. But it fails again when I reinstall the tf2_ros package. Do you have any suggestions?
Asked by Godbless on 2020-12-04 22:12:16 UTC
I did not only reinstall the tf2_ros package but the whole ros and turtlebot3 Package they provide in their setup tutorial Hope everything works fine for you too then!:)
Asked by lslabon on 2020-12-05 06:54:15 UTC
Comments
It is getting worse... I can not uninstall something from my system. now I have an error that there is the same package multiple ways found. How can I fix this?
Asked by lslabon on 2020-09-07 10:02:39 UTC
Please don't answer your question to add more information.
Asked by David Lu on 2020-09-09 21:01:18 UTC