TixiaoShan / LIO-SAM

LIO-SAM: Tightly-coupled Lidar Inertial Odometry via Smoothing and Mapping
BSD 3-Clause "New" or "Revised" License
3.38k stars 1.25k forks source link

ROS2 foxy, colcon build error #476

Open adijams01 opened 7 months ago

adijams01 commented 7 months ago

using ubuntu 20.04 ROS2 foxy installed all dependicies with foxy

sudo apt install ros-<ros2-version>-perception-pcl \
       ros-<ros2-version>-pcl-msgs \
       ros-<ros2-version>-vision-opencv \
       ros-<ros2-version>-xacro
sudo add-apt-repository ppa:borglab/gtsam-release-4.1
sudo apt install libgtsam-dev libgtsam-unstable-dev

while doing colcon build

Starting >>> lio_sam 
--- stderr: lio_sam                         
CMake Error at CMakeLists.txt:10 (find_package):
  By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "ament_cmake", but CMake did not find one.

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

    ament_cmakeConfig.cmake
    ament_cmake-config.cmake

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

---
Failed   <<< lio_sam [0.61s, exited with code 1]

Summary: 0 packages finished [2.62s]
  1 package failed: lio_sam
  1 package had stderr output: lio_sam
rehanTUNI commented 6 months ago

using ubuntu 20.04 ROS2 foxy installed all dependicies with foxy

sudo apt install ros-<ros2-version>-perception-pcl \
         ros-<ros2-version>-pcl-msgs \
         ros-<ros2-version>-vision-opencv \
         ros-<ros2-version>-xacro
sudo add-apt-repository ppa:borglab/gtsam-release-4.1
sudo apt install libgtsam-dev libgtsam-unstable-dev

while doing colcon build

Starting >>> lio_sam 
--- stderr: lio_sam                         
CMake Error at CMakeLists.txt:10 (find_package):
  By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "ament_cmake", but CMake did not find one.

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

    ament_cmakeConfig.cmake
    ament_cmake-config.cmake

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

---
Failed   <<< lio_sam [0.61s, exited with code 1]

Summary: 0 packages finished [2.62s]
  1 package failed: lio_sam
  1 package had stderr output: lio_sam

I believe you forgot to source your ros2 environment. Moreover, replace with your ros2 distribution

adijams01 commented 6 months ago

Thanks for your input, Ig I did forgot to replace with foxy. Anyways I shifted with the ROS1 branch and it worked. Will try with the ROS2 branch soon.