슬램 지도 제작자를 플레이하세요!
처음에는 catkin_ws/src 파일에서
$ sudo apt update
$ sudo apt install -y python3-wstool python3-rosdep ninja-build stow
$ cd ~/catkin_ws/src
$ wstool init src
$ wstool merge -t src https://raw.githubusercontent.com/cartographer-project/cartographer_ros/master/cartographer_ros.rosinstall
$ wstool update -t src
$ sudo rosdep init
$ rosdep update
$ rosdep install --from-paths src --ignore-src --rosdistro=noetic -y
$ src/cartographer/scripts/install_abseil.sh
$ sudo apt remove ros-noetic-abseil-cpp
$ catkin_make_isolated --install --use-ninja
위의 명령을 실행했습니다.
그런 다음 내가 볼 수 있는 오류는 catkin_make를 catkin_ws 작업 공간에서 실행할 수 없다는 오류였습니다.
그래서 새로운 carto_ws/src 파일이 생성되었고 catkin_init_workspace 명령으로 새로운 작업 공간이 생성되었습니다.
$ mkdir -p carto_ws/src
$ catkin_init_workspace
다시 cd carto_ws/src 파일로 이동하여 위의 명령을 통해 설치했습니다.
$ cd carto_ws/src
명령으로 설치
rosdep install –from-paths src –ignore-src –rosdistro=noetic -y 이 명령을 통해 설치하는 동안 다음 오류가 발생했습니다.
$ rosdep install --from-paths src --ignore-src --rosdistro=noetic -y
(libabsl-dev) OS 버전에 대해 “사용할 수 없음”으로 정의됨
지도 제작자 파일의 package.xml 파일에서 구글링한 결과
나는 46 번째 줄을 가지고
#source ~/carto_ws/install_isolated/setup.bash ## carto 터미널에 이 명령어를 입력하세요.
cd carto_ws로 이동하여 roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=cartographer 명령으로 slam을 실행합니다.
$ cd ~/carto_ws
$ roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=cartographer
그러면 지도를 불러올 수 없고 로봇의 모양을 불러올 수 없다는 오류가 발생했습니다.
오류에는 lds_2d.lua라는 파일을 언급하는 오류가 있었습니다.
그래서 나는 turtlebot3_lds_2d_gazebo.lua 파일을 catkin_ws/src/turtlebot3/turtlebot3_slam/config로 변경했다.
https://google-cartographer-ros.readthedocs.io/en/latest/configuration.html 각 매개변수에 대한 설명은 웹사이트에서 찾을 수 있습니다.
오류에 ‘odom’이 중복되는 오류가 발생했습니다.
그래서 publish_frame=”base_footprint” 로 변경하고 슬램을 진행하니 정상적으로 실행되었습니다.