공부중

[터틀봇] CMake Error at CMakeLists.txt:18 (find_package): 본문

인공지능...?/터틀봇 프로젝트

[터틀봇] CMake Error at CMakeLists.txt:18 (find_package):

복습 2024. 10. 3. 22:20
728x90

우분투 22.04 

ros : humble

 

문제 : 

 

mkdir -p ~/turtlebot3_ws/src/
git clone -b humble-devel https://github.com/ROBOTIS-GIT/DynamixelSDK.git


cd ~/turtlebot3_ws
colcon build --symlink-install
echo 'source ~/turtlebot3_ws/install/setup.bash' >> ~/.bashrc
source ~/.bashrc

 

과정에서 CMake Error at CMakeLists.txt:18 (find_package): 문제 발생

:~/turtlebot3_ws$ colcon build --symlink-install
Starting >>> dynamixel_sdk
Starting >>> dynamixel_sdk_custom_interfaces
--- stderr: dynamixel_sdk
CMake Error at CMakeLists.txt:18 (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.

 

 

 

아래 방법으로 해결 

 

ROS 2 Humble 작업 환경 설정 확인
setup.bash 파일을 소스하여 환경 설정을 해보세요:

source /opt/ros/humble/setup.bash

 

CMAKE_PREFIX_PATH 설정
ament_cmake 패키지가 설치된 위치를 CMake가 찾을 수 있도록 CMAKE_PREFIX_PATH 환경 변수를 설정합니다:

export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:/opt/ros/humble

 

 

728x90