본문 바로가기

FOSCAR-(Autonomous Driving)/ROS 스터디

[2023 ROS 스터디] 변준형 #4주차 - SLAM과 내비게이션

반응형

위치

로봇의 위치 계측 / 추정하는 기능

ex) GPS / Indoor Positioning Sensor / 추측항법

 

센싱

벽, 물체 등의 장애물의 계측하는 기능

ex) 거리센서 / 비전센서 / Depth camera

 

지도

길과 장애물 정보가 담긴 지도

 

경로

목적지까지 최적 경로를 계산하고 주행하는 기능

ex) 내비게이션 / 위치 추정 / 경로 탐색계획

 

---

 

위치 + 센싱 -> 지도

SLAM

 

위치 + 센싱 + 지도 -> 경로

Navigation

 

---

 

위치추정 (Localization)

 

칼만 필터 (Kalman filter)

* 잡음이 포함되어 있는 선형 시스템이서 대상체의 상태를 추적하는 재귀 필터

* 베이즈 확률 기반

 

파티클 필터 (Particle Filter)

* 파티클 필터는 시행 착오법을 기반으로한 시뮬레이션을 통하여 예측하는 기술로

대상 시스템에 확률 분포로 임의로 생성된 추정값을 파티클 형태로 나타냄

 

---

 

SLAM & Navigation 실습

 

1. 개발 환경 설치

( 강의 교안에 있는 명령어와 다르게 melodic으로 설치하였습니다.)

$ cd ~/catkin_ws/src/
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
$ cd ~/catkin_ws && catkin_make

 

2. Gazebo, Rviz

export TURTLEBOT3_MODEL=waffle
$ roslaunch turtlebot3_gazebo turtlebot3_world.launch
$ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

(teleop_key 명령어로 Gazebo상의 터틀봇 이동)

 

( Rviz 실행화면 )

 

3. SLAM

export TURTLEBOT3_MODEL=waffle
$ roslaunch turtlebot3_gazebo turtlebot3_world.launch
$ roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping
$ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
$ rosrun map_server map_saver -f ~/map

 

(1) SLAM 실행

(2) teleop을 이용한 구조 파악

(3) map 생성

 

 4. Navigation

export TURTLEBOT3_MODEL=waffle
$ roslaunch turtlebot3_gazebo turtlebot3_world.launch
$ roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml

( navigation 실행 및 경로 지정화면)

 

5. 오류해결

실습과정에서 설치할 패키지가 많다보니 일부 패키지가 설치되지 않아 오류가 나는 경우가 있었습니다.

그 때는 해당에러 메시지를 읽고 패키지를 설치해주면 대부분의 오류를 해결할 수 있습니다.

참고링크 : https://answers.ros.org/question/313820/error-cannot-launch-node-of-type-gmappingslam_gmapping-cant-locate-node-slam_gmapping-in-package-gmapping/

 

ERROR: cannot launch node of type [gmapping/slam_gmapping]: can't locate node [slam_gmapping] in package [gmapping] - ROS Answer

ERROR: cannot launch node of type [gmapping/slam_gmapping]: can't locate node [slam_gmapping] in package [gmapping] edit This is my first time using ROS. I'm using ubuntu 18.04 and ROS-melodic on my remote (PC) and ROS-kinetic on my turtlebot (pc). I'm try

answers.ros.org

 

반응형