tu-darmstadt-ros-pkg / hector_slam

hector_slam contains ROS packages related to performing SLAM in unstructed environments like those encountered in the Urban Search and Rescue (USAR) scenarios of the RoboCup Rescue competition.
http://wiki.ros.org/hector_slam
653 stars 454 forks source link

catkin_make failed #74

Closed Erdemhan closed 4 years ago

Erdemhan commented 4 years ago

Hi , i cloned hector_slam to my workspace but when i do catkin_make it gives these errors and it fails. Distro : melodic tf2 package is already installed

[ 97%] Linking CXX executable /home/erdemhan/catkin_ws/devel/lib/tf2_ros/static_transform_publisher
[ 97%] Built target tf2_ros_static_transform_publisher
Scanning dependencies of target hector_mapping
[ 98%] Building CXX object hector_slam/hector_mapping/CMakeFiles/hector_mapping.dir/src/HectorMappingRos.cpp.o
[ 98%] Linking CXX executable /home/erdemhan/catkin_ws/devel/lib/hector_imu_attitude_to_tf/imu_attitude_to_tf_node
/opt/ros/melodic/lib/libtf.so: undefined reference to `tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)'
collect2: error: ld returned 1 exit status
hector_slam/hector_imu_attitude_to_tf/CMakeFiles/imu_attitude_to_tf_node.dir/build.make:118: recipe for target '/home/erdemhan/catkin_ws/devel/lib/hector_imu_attitude_to_tf/imu_attitude_to_tf_node' failed
make[2]: *** [/home/erdemhan/catkin_ws/devel/lib/hector_imu_attitude_to_tf/imu_attitude_to_tf_node] Error 1
CMakeFiles/Makefile2:11837: recipe for target 'hector_slam/hector_imu_attitude_to_tf/CMakeFiles/imu_attitude_to_tf_node.dir/all' failed
make[1]: *** [hector_slam/hector_imu_attitude_to_tf/CMakeFiles/imu_attitude_to_tf_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 98%] Building CXX object hector_slam/hector_mapping/CMakeFiles/hector_mapping.dir/src/main.cpp.o
[ 98%] Linking CXX executable /home/erdemhan/catkin_ws/devel/lib/hector_imu_tools/pose_and_orientation_to_imu_node
/opt/ros/melodic/lib/libtf.so: undefined reference to `tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)'
collect2: error: ld returned 1 exit status
hector_slam/hector_imu_tools/CMakeFiles/pose_and_orientation_to_imu_node.dir/build.make:118: recipe for target '/home/erdemhan/catkin_ws/devel/lib/hector_imu_tools/pose_and_orientation_to_imu_node' failed
make[2]: *** [/home/erdemhan/catkin_ws/devel/lib/hector_imu_tools/pose_and_orientation_to_imu_node] Error 1
CMakeFiles/Makefile2:11893: recipe for target 'hector_slam/hector_imu_tools/CMakeFiles/pose_and_orientation_to_imu_node.dir/all' failed
make[1]: *** [hector_slam/hector_imu_tools/CMakeFiles/pose_and_orientation_to_imu_node.dir/all] Error 2
[ 98%] Building CXX object hector_slam/hector_mapping/CMakeFiles/hector_mapping.dir/src/PoseInfoContainer.cpp.o
[ 98%] Linking CXX executable /home/erdemhan/catkin_ws/devel/lib/tf2_ros/buffer_server
[ 98%] Linking CXX executable /home/erdemhan/catkin_ws/devel/lib/hector_trajectory_server/hector_trajectory_server
[ 98%] Built target tf2_ros_buffer_server
/opt/ros/melodic/lib/libtf.so: undefined reference to `tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)'
collect2: error: ld returned 1 exit status
hector_slam/hector_trajectory_server/CMakeFiles/hector_trajectory_server.dir/build.make:118: recipe for target '/home/erdemhan/catkin_ws/devel/lib/hector_trajectory_server/hector_trajectory_server' failed
make[2]: *** [/home/erdemhan/catkin_ws/devel/lib/hector_trajectory_server/hector_trajectory_server] Error 1
CMakeFiles/Makefile2:12120: recipe for target 'hector_slam/hector_trajectory_server/CMakeFiles/hector_trajectory_server.dir/all' failed
make[1]: *** [hector_slam/hector_trajectory_server/CMakeFiles/hector_trajectory_server.dir/all] Error 2
[100%] Linking CXX shared library /home/erdemhan/catkin_ws/devel/lib/libpointcloud_to_laserscan.so
[100%] Built target pointcloud_to_laserscan
[100%] Linking CXX shared library /home/erdemhan/catkin_ws/devel/lib/liblaserscan_to_pointcloud.so
[100%] Built target laserscan_to_pointcloud
[100%] Linking CXX executable /home/erdemhan/catkin_ws/devel/lib/hector_map_server/hector_map_server
/opt/ros/melodic/lib/libtf.so: undefined reference to `tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)'
collect2: error: ld returned 1 exit status
hector_slam/hector_map_server/CMakeFiles/hector_map_server.dir/build.make:118: recipe for target '/home/erdemhan/catkin_ws/devel/lib/hector_map_server/hector_map_server' failed
make[2]: *** [/home/erdemhan/catkin_ws/devel/lib/hector_map_server/hector_map_server] Error 1
CMakeFiles/Makefile2:12009: recipe for target 'hector_slam/hector_map_server/CMakeFiles/hector_map_server.dir/all' failed
make[1]: *** [hector_slam/hector_map_server/CMakeFiles/hector_map_server.dir/all] Error 2
[100%] Linking CXX executable /home/erdemhan/catkin_ws/devel/lib/hector_mapping/hector_mapping
/opt/ros/melodic/lib/libtf.so: undefined reference to `tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)'
collect2: error: ld returned 1 exit status
hector_slam/hector_mapping/CMakeFiles/hector_mapping.dir/build.make:186: recipe for target '/home/erdemhan/catkin_ws/devel/lib/hector_mapping/hector_mapping' failed
make[2]: *** [/home/erdemhan/catkin_ws/devel/lib/hector_mapping/hector_mapping] Error 1
CMakeFiles/Makefile2:15324: recipe for target 'hector_slam/hector_mapping/CMakeFiles/hector_mapping.dir/all' failed
make[1]: *** [hector_slam/hector_mapping/CMakeFiles/hector_mapping.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
StefanFabian commented 4 years ago

First, I would suggest using catkin tools (catkin build) instead of catkin_make which is deprecated.

Your error suggests tf2_ros might not be installed?

Erdemhan commented 4 years ago

First, I would suggest using catkin tools (catkin build) instead of catkin_make which is deprecated.

Your error suggests tf2_ros might not be installed?

I tried catkin build but it gives errors too tf2_ros already installed

catkin build errors:

_______________________________________________________________________________________________________________________
Errors     << hector_imu_tools:make /home/erdemhan/catkin_ws/logs/hector_imu_tools/build.make.001.log                  
/opt/ros/melodic/lib/libtf.so: undefined reference to `tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/erdemhan/catkin_ws/devel/.private/hector_imu_tools/lib/hector_imu_tools/pose_and_orientation_to_imu_node] Error 1
make[1]: *** [CMakeFiles/pose_and_orientation_to_imu_node.dir/all] Error 2
make: *** [all] Error 2
cd /home/erdemhan/catkin_ws/build/hector_imu_tools; catkin build --get-env hector_imu_tools | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
.......................................................................................................................
Failed     << hector_imu_tools:make                          [ Exited with code 2 ]                                    
Failed    <<< hector_imu_tools                               [ 0.3 seconds ]                                           
Abandoned <<< hector_compressed_map_transport                [ Unrelated job failed ]                                  
Abandoned <<< hector_geotiff                                 [ Unrelated job failed ]                                  
Abandoned <<< hector_geotiff_plugins                         [ Unrelated job failed ]                                  
Abandoned <<< hector_map_server                              [ Unrelated job failed ]                                  
Abandoned <<< hector_slam_launch                             [ Unrelated job failed ]                                  
Abandoned <<< hector_trajectory_server                       [ Unrelated job failed ]                                  
Abandoned <<< rosapi                                         [ Unrelated job failed ]                                  
Abandoned <<< rosbridge_library                              [ Unrelated job failed ]                                  
Abandoned <<< rosbridge_server                               [ Unrelated job failed ]                                  
Abandoned <<< tf2                                            [ Unrelated job failed ]                                  
Abandoned <<< tf2_bullet                                     [ Unrelated job failed ]                                  
Abandoned <<< tf2_eigen                                      [ Unrelated job failed ]                                  
Abandoned <<< tf2_py                                         [ Unrelated job failed ]                                  
Abandoned <<< tf2_ros                                        [ Unrelated job failed ]                                  
Abandoned <<< tf2_geometry_msgs                              [ Unrelated job failed ]                                  
Abandoned <<< tf2_kdl                                        [ Unrelated job failed ]                                  
Abandoned <<< test_tf2                                       [ Unrelated job failed ]                                  
Abandoned <<< tf2_sensor_msgs                                [ Unrelated job failed ]                                  
Abandoned <<< pointcloud_to_laserscan                        [ Unrelated job failed ]                                  
Abandoned <<< tf2_tools                                      [ Unrelated job failed ]                                  
Finished  <<< hector_marker_drawing                          [ 0.1 seconds ]                                           
Finished  <<< deneme                                         [ 0.2 seconds ]                                           
_______________________________________________________________________________________________________________________
Errors     << hector_imu_attitude_to_tf:make /home/erdemhan/catkin_ws/logs/hector_imu_attitude_to_tf/build.make.001.log
/opt/ros/melodic/lib/libtf.so: undefined reference to `tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/erdemhan/catkin_ws/devel/.private/hector_imu_attitude_to_tf/lib/hector_imu_attitude_to_tf/imu_attitude_to_tf_node] Error 1
make[1]: *** [CMakeFiles/imu_attitude_to_tf_node.dir/all] Error 2
make: *** [all] Error 2
cd /home/erdemhan/catkin_ws/build/hector_imu_attitude_to_tf; catkin build --get-env hector_imu_attitude_to_tf | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
.......................................................................................................................
Failed     << hector_imu_attitude_to_tf:make                 [ Exited with code 2 ]                                    
Failed    <<< hector_imu_attitude_to_tf                      [ 0.5 seconds ]                                           
Finished  <<< hector_nav_msgs                                [ 0.7 seconds ]                                           
Finished  <<< tf2_msgs                                       [ 0.8 seconds ]                                           
_______________________________________________________________________________________________________________________
Errors     << hector_mapping:make /home/erdemhan/catkin_ws/logs/hector_mapping/build.make.001.log                      
/opt/ros/melodic/lib/libtf.so: undefined reference to `tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/erdemhan/catkin_ws/devel/.private/hector_mapping/lib/hector_mapping/hector_mapping] Error 1
make[1]: *** [CMakeFiles/hector_mapping.dir/all] Error 2
make: *** [all] Error 2
cd /home/erdemhan/catkin_ws/build/hector_mapping; catkin build --get-env hector_mapping | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
.......................................................................................................................
Failed     << hector_mapping:make                            [ Exited with code 2 ]                                    
Failed    <<< hector_mapping                                 [ 1.3 seconds ]                                           
Finished  <<< autoware_msgs      
Martin-Oehler commented 4 years ago

Are you building tf from source? Can you try to manually build the tf packages first?

StefanFabian commented 4 years ago

DId Martins suggestion solve your issue?

Erdemhan commented 4 years ago

DId Martins suggestion solve your issue?

I am not able to use my computer now , i will try and let u know asap.

Erdemhan commented 4 years ago

Thanks , worked.

mn-banjar commented 4 years ago

I'm facing the same issue. I tried using both catkin tools & catkin_make

Errors << costmap_2d:make /home/pi/ros/ros_ws/logs/costmap_2d/build.make.014.log
/usr/bin/ld: /opt/ros/melodic/lib/libtf.so: undefined reference to `tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/costmap_2d_node.dir/build.make:157: /home/pi/ros/ros_ws/devel/.private/costmap_2d/lib/costmap_2d/costmap_2d_node] Error 1 make[1]: [CMakeFiles/Makefile2:774: CMakeFiles/costmap_2d_node.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....

Erdemhan commented 4 years ago

I'm facing the same issue. I tried using both catkin tools & catkin_make

Errors << costmap_2d:make /home/pi/ros/ros_ws/logs/costmap_2d/build.make.014.log /usr/bin/ld: /opt/ros/melodic/lib/libtf.so: undefined reference to `tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/costmap_2d_node.dir/build.make:157: /home/pi/ros/ros_ws/devel/.private/costmap_2d/lib/costmap_2d/costmap_2d_node] Error 1 make[1]: [CMakeFiles/Makefile2:774: CMakeFiles/costmap_2d_node.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....

In my case , I solved it by deleting tf packages and build files from my workspace and reinstalled tf/tf2 packages with apt-get EDIT: if your tf packages in your workspace try to delete from workspace and install to your ros source with apt-get install or apt install

mn-banjar commented 4 years ago

I'm facing the same issue. I tried using both catkin tools & catkin_make Errors << costmap_2d:make /home/pi/ros/ros_ws/logs/costmap_2d/build.make.014.log /usr/bin/ld: /opt/ros/melodic/lib/libtf.so: undefined reference to `tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/costmap_2d_node.dir/build.make:157: /home/pi/ros/ros_ws/devel/.private/costmap_2d/lib/costmap_2d/costmap_2d_node] Error 1 make[1]: [CMakeFiles/Makefile2:774: CMakeFiles/costmap_2d_node.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....

In my case , I solved it by deleting tf packages and build files from my workspace and reinstalled tf/tf2 packages with apt-get EDIT: if your tf packages in your workspace try to delete from workspace and install to your ros source with apt-get install or apt install

Thank you, it works I deleted all the packages and reinstalled it again without repetition in my workspace, I have already some tf packages in /opt/ros/melodic/share