rsasaki0109/lidarslam_ros2

Failed to build lidarslam_ros2

SyahirMuzni opened this issue · 8 comments

System:

  • Ubuntu 20.04 Focal Fossa

I was building lidarslam_ros2 with ndt_omp_ros2 installed. But failed to build the scanmatcher & graph_based_slam because there is no g2o. The error is stated as below:
"CMake Error at CMakeLists.txt:33 (find_package):
By not providing "Findg2o.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "g2o", but
CMake did not find one.

Could not find a package configuration file provided by "g2o" with any of
the following names:

g2oConfig.cmake
g2o-config.cmake

Add the installation prefix of "g2o" to CMAKE_PREFIX_PATH or set "g2o_DIR"
to a directory containing one of the above files. If "g2o" provides a separate development package or SDK, be sure it has been installed."

So, I am quite confused because I see in your scanmatcher package stated that I don't have to build the g2o.
Really appreciate for your help.

Install g2o with the following command.

sudo apt install ros-foxy-libg2o

The CI of this package installs the dependent packages with rosdep.
https://github.com/rsasaki0109/lidarslam_ros2/blob/foxy/.github/workflows/main.yml#L40-L41

Still fail to build. Maybe because I am using the Galactic distro that might not suitable with the package which is (foxy). For your information, I have built the Autoware in my system in Galactic. So is it possible to use this package?

Oh, sorrry. I was mistaken. This package is also available for ros2 galactic.
Install g2o with the following command.

sudo apt install ros-galactic-libg2o

Ok. Thank you. It is done!

Hi.
I tried to run the command 'ros2 launch lidarslam lidarslam.launch.py'

But I encountered this error:
'Package 'lidarslam' not found: "package 'lidarslam' not found, searching: ['/opt/ros/galactic']'

For your information, I have successfully built the lidarslam package.

Really appreciate your help.

In ROS2, the following command must be entered to use a built package.

source <Workspace where the package was built>/install/setup.bash

Ok thank you for your quick response. I will close this issue