Trouble with catkin_make hector slam

Hi, I have trouble with cmake of hector slam. The same works on the x86 architecture, I have tested it but it’s not working on my TX2. please help me.

tx2slam@tx2slam-desktop:~/catkin_ws$ source devel/setup.bash
tx2slam@tx2slam-desktop:~/catkin_ws$ catkin_make
Base path: /home/tx2slam/catkin_ws
Source space: /home/tx2slam/catkin_ws/src
Build space: /home/tx2slam/catkin_ws/build
Devel space: /home/tx2slam/catkin_ws/devel
Install space: /home/tx2slam/catkin_ws/install

Running command: “make cmake_check_build_system” in “/home/tx2slam/catkin_ws/build”

– Using CATKIN_DEVEL_PREFIX: /home/tx2slam/catkin_ws/devel
– Using CMAKE_PREFIX_PATH: /home/tx2slam/catkin_ws/devel;/opt/ros/melodic
– This workspace overlays: /home/tx2slam/catkin_ws/devel;/opt/ros/melodic
– Found PythonInterp: /usr/bin/python2 (found suitable version “2.7.17”, minimum required is “2”)
– Using PYTHON_EXECUTABLE: /usr/bin/python2
– Using Debian Python package layout
– Using empy: /usr/bin/empy
– Using CATKIN_ENABLE_TESTING: ON
– Call enable_testing()
– Using CATKIN_TEST_RESULTS_DIR: /home/tx2slam/catkin_ws/build/test_results
– Found gtest sources under ‘/usr/src/googletest’: gtests will be built
– Found gmock sources under ‘/usr/src/googletest’: gmock will be built
– Found PythonInterp: /usr/bin/python2 (found version “2.7.17”)
– Using Python nosetests: /usr/bin/nosetests-2.7
– catkin 0.7.23
– BUILD_SHARED_LIBS is on
– BUILD_SHARED_LIBS is on
– Using CATKIN_WHITELIST_PACKAGES: hector_compressed_map_transport;hector_geotiff;hector_geotiff_plugins;hector_imu_attitude_to_tf;hector_map_server;hector_map_tools;hector_mapping;hector_marker_drawing;hector_nav_msgs;hector_slam;hector_slam_launch;hector_trajectory_server;rplidar_ros
– ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
– ~~ traversing 13 packages in topological order:
– ~~ - hector_slam (metapackage)
– ~~ - hector_slam_launch
– ~~ - hector_map_tools
– ~~ - hector_nav_msgs
– ~~ - hector_geotiff
– ~~ - hector_geotiff_plugins
– ~~ - hector_marker_drawing
– ~~ - hector_compressed_map_transport
– ~~ - rplidar_ros
– ~~ - hector_imu_attitude_to_tf
– ~~ - hector_map_server
– ~~ - hector_trajectory_server
– ~~ - hector_mapping
– ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
– +++ processing catkin metapackage: ‘hector_slam’
– ==> add_subdirectory(RPLidar_Hector_SLAM/hector_slam/hector_slam)
– +++ processing catkin package: ‘hector_slam_launch’
– ==> add_subdirectory(RPLidar_Hector_SLAM/hector_slam/hector_slam_launch)
– +++ processing catkin package: ‘hector_map_tools’
– ==> add_subdirectory(RPLidar_Hector_SLAM/hector_slam/hector_map_tools)
– Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Warning at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on ‘Eigen’ but neither ‘Eigen_INCLUDE_DIRS’ nor
‘Eigen_LIBRARIES’ is defined.
Call Stack (most recent call first):
/opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
RPLidar_Hector_SLAM/hector_slam/hector_map_tools/CMakeLists.txt:51 (catkin_package)

– +++ processing catkin package: ‘hector_nav_msgs’
– ==> add_subdirectory(RPLidar_Hector_SLAM/hector_slam/hector_nav_msgs)
– Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
– hector_nav_msgs: 0 messages, 5 services
– +++ processing catkin package: ‘hector_geotiff’
– ==> add_subdirectory(RPLidar_Hector_SLAM/hector_slam/hector_geotiff)
– Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
– +++ processing catkin package: ‘hector_geotiff_plugins’
– ==> add_subdirectory(RPLidar_Hector_SLAM/hector_slam/hector_geotiff_plugins)
– Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
– +++ processing catkin package: ‘hector_marker_drawing’
– ==> add_subdirectory(RPLidar_Hector_SLAM/hector_slam/hector_marker_drawing)
– +++ processing catkin package: ‘hector_compressed_map_transport’
– ==> add_subdirectory(RPLidar_Hector_SLAM/hector_slam/hector_compressed_map_transport)
CMake Error at /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake:113 (message):
Project ‘cv_bridge’ specifies ‘/usr/local/include/opencv’ as an include
dir, which is not found. It does neither exist as an absolute directory
nor in ‘${{prefix}}//usr/local/include/opencv’. Check the issue tracker
https://github.com/ros-perception/vision_opencv/issues’ and consider
creating a ticket if the problem has not been reported yet.
Call Stack (most recent call first):
/opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
RPLidar_Hector_SLAM/hector_slam/hector_compressed_map_transport/CMakeLists.txt:7 (find_package)

– Configuring incomplete, errors occurred!
See also “/home/tx2slam/catkin_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/tx2slam/catkin_ws/build/CMakeFiles/CMakeError.log”.
Makefile:320: recipe for target ‘cmake_check_build_system’ failed
make: *** [cmake_check_build_system] Error 1
Invoking “make cmake_check_build_system” failed

I’m running into similar problems with my Xavier NX. So far I believe I’ve tracked it down to the wrong version of opencv being on the system. For me 4.1.1 is installed. ROS Melodic is built with 3.2.0. I’m still trying to figure out how to get opencv 3.2.0 installed or some other workaround.

You can check what version of opencv you have installed by running
apt search libopencv

/usr/local/include/opencv is also not present on my machine only /usr/local/include/opencv4

Thank you for sharing your info. I’ll try downgrading the opencv version and try again. When I get it to working, I’ll post it up the result.

I ended up removing the libopencv* libraries that came preinstalled. I then shut off the Nvidia repositories. Then I reinstalled ROS melodic which grabbed opencv 3.2.0 from the normal Ubuntu. This fixed the cv_bridge dependencies.

It’d better if there was a way to keep opencv 4 I’d be interested.

How do you shut off the Nvidia repositories? I’m new to jetson nano and TX2. can you carefully explain to me how to achieve your way of solving the problem? Thank you in advance!

Hi, I followed your method(gundy360’s) and it worked!

  1. sudo apt-get purge ’ * libopencv * ’ (’ and * should have not space in between. Don’t know why but this website does not reflect when ’ and * is next to each other)
  2. sudo apt-get remove ros-*
  3. System Settings --> Software & Updates --> ‘Other Software’ tab --> uncheck nvidia related repos
  4. reinstall ROS using ROS website’s tutorial
  5. ~/catkin_ws$ source devel/setup.bash
  6. ~/catkin_ws$ catkin_make

the catkin_make worked. and cv_bridge issue disappeared.
I was able to run hector slam.

1 Like