Project/#1 AI 기반 자율주행 로봇을 이용한 매장 관리

#3. ROS - Noetic&Cartographer 설치

얼죽아여뜨샤 2022. 5. 13. 21:05

Cartographer ROS를 빌드하기 위해 wstool 과 rosdep 설치

https://google-cartographer-ros.readthedocs.io/en/latest/compilation.html

 

Compiling Cartographer ROS — Cartographer ROS documentation

Building & Installation In order to build Cartographer ROS, we recommend using wstool and rosdep. For faster builds, we also recommend using Ninja. On Ubuntu Focal with ROS Noetic use these commands to install the above tools: sudo apt-get update sudo apt-

google-cartographer-ros.readthedocs.io

참고(자세함)

https://varhowto.com/install-ros-noetic-ubuntu-20-04/

 

How to Install ROS Noetic on Ubuntu 20.04 - VarHowto

ros-noetic-desktop is a trimmed-down version of ros-noetic-desktop-full, also containing most tutorials packages. Specifically, it includes the following

varhowto.com

On Ubuntu Focal with ROS Noetic use these commands to install the above tools:

sudo apt-get update
sudo apt-get install -y python3-wstool python3-rosdep ninja-build stow

 

On older distributions:

sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build stow

오류발생 - 넘어가도 됌

After the tools are installed, create a new cartographer_ros workspace in ‘catkin_ws’.

mkdir catkin_ws
cd catkin_ws
wstool init src
wstool merge -t src https://raw.githubusercontent.com/cartographer-project/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src

 

Now you need to install cartographer_ros’ dependencies. First, we use rosdep to install the required packages. The command ‘sudo rosdep init’ will print an error if you have already executed it since installing ROS. This error can be ignored.

sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

# Only on Ubuntu 16 / ROS Kinetic: src/cartographer/scripts/install_proto3.sh

=> 오류 발생시 글 맨 아래 확인

 

Cartographer uses the abseil-cpp library that needs to be manually installed using this script:

src/cartographer/scripts/install_abseil.sh

 

Due to conflicting versions you might need to uninstall the ROS abseil-cpp using

sudo apt-get remove ros-${ROS_DISTRO}-abseil-cpp

 

Build and install.

catkin_make_isolated --install --use-ninja

This builds Cartographer from the latest HEAD of the master branch. If you want a specific version, you need to change the version in the cartographer_ros.rosinstall.

-> 설정 내용 저장

source /home/goeun-jeon/catkin_ws/install_isolated/setup.bash

 

***오류 발생 

-> 해결 

 

Make Error: Error: generator : Ninja
Does not match the generator used previously: Unix Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
<== Failed to process package 'cartographer_ros': 

라는 오류가 발생하면 

 

cartographer_ros 파일로 들어가서CMakeCache.txt 파일을 지워준다.

 

CMake Error: Error: generator : Ninja
Does not match the generator used previously: Unix Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
<== Failed to process package 'cartographer_rviz': 

라는 오류 발생 

 

cartographer_rviz 파일로 들어가서 CMakeCache.txt 파일을 지워준다.

-> 성공 설치 완료

***오류 발생

-> 해결

git clone

 

***desktop 설치 중에 오류 발생

rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

<= 이 단락에서 오류 발생

오류 내용

:ERROR: the dollowing packages/stacks could not have their keys resolved to system dependencies:

cartographer : [libabsl.dev] defined as "net available" for OS version [focal]

 

-> !해결!

catkin_ws 파일 -> cartographer 파일 -> package.xml 파일에서 46번째 줄  <depend>libabsl-dev</depend> 삭제하기

그러고 다시 위 코드 재 실행하고 기다리면 #All required rosdeps installed successfully가 나온다.