Gmapping
개념
Gmapping은 openSLAM에서 개발한 ROS에서 가장 널리 쓰이는 SLAM package
SLAM에서 해결해야할 문제점
정확성과 비용적 효율성을 갖춘 mapping method는 SLAM 기술의 해결되어야할 문제점이다.
특징
- Static한 환경에서 유리하다.
- OGM과 particle filter를 사용하는 Grid mapping기법.
- Each particle carries an individual map of the environment.
- The number of particles is reduced using several adaptive techniques to learn the grid maps.
- Laser range data에서 grid maps을 learning하기 위한 아주 효율적인 Rao-Blackwellized particle filter이다.
- ( filtered SLAM framework를 바탕으로 함 )
- Some of the other packages that gmapping is compared with are Core SLAM, Graph SLAM and Hetor, filter-based SLAM etc.
- Gmapping proposes an approaches to compute an accurate proposal distribution taking into account not only the movement of the robot but also the most recent observation. This drastically decreses the uncertainty about the robot's pose in the prediction step of the filter. Furthermore, it also applies an approach to selectively carry out re-sampling operations which seriously reduces the problem of particle depletion.
- (Gmapping은 로봇의 움직임뿐만 아니라 가장 최근의 관측 데이터도 고려하여 정확한 제안 분포를 계산하는 접근 방식을 제안한다. 이는 필터의 예측 단계에서 로봇 포즈에 대한 불확실성을 크게 감소시킨다. 나아가 입자 고갈 문제를 심각하게 감소시키는 리샘플링 작업을 선택적으로 수행하는 접근법도 적용한다.)
- The base_link is a very commonly used frame to refer to the robot base frame (기초 프레임)
하드웨어 제약사항
- x, y, theta 속도 이동 명령
- 차동 구동형 모바일 로봇 (differential drive mobile robot)
- 전 방향 이동 로봇 (omni-wheel robot)
- 주행기록계(Odometry)
- 계측 센서: 2차 평면 계측 가능 센서 (LRF, LiDAR, Kinect, Xtion 등)
- 직사각형 및 원형의 로봇
Algorithm
새로운 튜플 \( (u_{t-1}, z_t) \) 을 얻을 때마다 proposal은 각각의 particle에 대해 개별적으로 연산되며, 그리고 그 particle을 update하는 데 사용된다. 그 결과 아래와 같은 단계가 발생하게 된다.
( x: 로봇의 궤적, m: 지도, z: 센서 측정값, u: odometry 측정값 )
다음 샘플 생성 연산 이후, \( N_{eff} \)의 값에 따라 재추출(resampling) 단계가 실행된다.
Input data
: raw laser scan data and the automatory (raw 레이저 스캔 데이터와 자동장치?)
--> used by the slam algorithm to estimate the robot pose with respect to the odom and provides the map to odom link as an output.
( laser scan provides distances based on the time of fight technique, and hence the distance between the robot and surroundings will seem to change of the position of ladar changes. And as this data is being used by the rosnode to not just create the map but also estimate the robot position, this relationship between the 2 links a critical piece input. )
And the odom link is initialized at the beginning of the gmapping process.
In other words, the raw laser scan provides distances based on the time of fight technique, and odometry.
Along with that it also needs a few transforms i.e the base_link (robot base frame) and the laser_link.
The laser link is a the origin of the laser sensor which could be mounted anywhere on the robot, but maintains a static relationship to the base_link.
Output
: a map or a 2D occupancy grid or a representation of the environment displaying the obstacles and the free space.
In 2D occupancy grid map, the value of each cell encodes a probability of its state calculated using a bayesian approach.
-> this map can be saved using the map server ros package and used for navigational purposes. it also needs a few transforms.
Parameter
- wheel slippage (slippage : 불이행, 하락, 저하)
- robot speed
- frequency of map update
- The above parameters can produce a noisy odometry resulting in discontinuous and distorted maps.
- Gmapping performs the correction by continuously merging measurements from previous positions and provides the updated map to odom link.
- (Gmapping은 이전 위치의 측정값을 연속적으로 병합하여 보정을 수행하며 업데이트된 map을 odom link에 제공한다.)
결론
GMapping’s resulting model can be used directly as a map of the environment in navigational tasks such as path planning, obstacle avoidance, and pose estimation. The main advantages of gmapping is that it is easy to construct and it can be as accurate as necessary.
SLAM 관련 노드들의 처리 과정
- 센서를 실행하여 SLAM에 필요한 scan 정보를 slam_gmapping 노드에게 보낸다.
- 이는 단 한 번으로 끝나지 않고, 로봇이 움직이더라도 지속적으로 scan 정보를 보내게 된다.
- 키보드 입력 값을 받아서 로봇을 조종하는 것이 가능한 노드이다.
- 즉, turtlebot3(거북이) 노드에게 이동 속도, 회전 속도 명령을 보낸다.
- turtlebot3 노드는 유저의 명령을 받고 이동하게 된다.
- 이 때, 내부적으로는 자신의 위치를 계측/측정한 위치 정보인 odom 정보를 전송함과 동시에 같은 이름으로 odom의 위치 변환 정보를 tf로 내보내며, 이와 연결된 로봇의 중앙 부분의 base_footprint 위치도 tf로 내보내게 된다.
- (센서의 위치인 base_scan을 tf 형태로 SLAM에게 넘기기 위해 odom → base_footprint → base_link → base_scan 의 변환을 거쳐서 내보낸다.)
- slam_gmapping 노드에서는 센서가 측정한 거리 값인 scan 정보와 센서의 위치 값인 tf 정보를 기반으로 지도를 작성하게 된다.
- map_server 패키지의 map_saver 노드는 이 지도 정보를 가지고 저장 가능한 map.pgm 파일과 이에 대한 정보 파일인 map.yaml 파일을 생성하게 된다.
참고
- Algorithm은 Framework에서 제공되는 다양한 라이브러리 및 알고리즘을 이용해 개발될 수 있다. 따라서 개발자가 이를 빠르고 손쉽게 사용할 수 있도록 해준다.
- (중복적 기능을 구현해야하는 소모적인 작업으로부터 개발자를 해방시켜, 문제 해결을 위한 핵심 알고리즘에만 집중할 수 있도록 도와줌)
- 전체 로봇 모델의 구성, 장애물과의 거리 및 센서 정보 등을 포함한 다양한 정보는 RViz를 통하여 표시하였다. 이동 로봇은 LiDAR 센서 데이터를 통해 지형정보를 획득하고 이 정보를 이용하고 Gmapping 패키지를 활용하여 대상 지형에 대한 지도를 생성시켰다. 그리고 뎁스 카메라를 이용하여 객체의 위치를 파악하도록 하였다. 로봇이 획득한 영상 정보, 로봇의 상태 정보, 지도 정보 및 지도상의 로봇 위치 등 시인성 향상을 위하여 가시화를 시도하였다. 또한, 획득한 위치정보를 기반으로 하여 정확한 목표 추종이 가능토록 Manipulator 제어를 실시하였다.
*참고 자료
ros-seminar/11_SLAM과_내비게이션.pdf at master · robotpilot/ros-seminar · GitHub
GitHub - robotpilot/ros-seminar: ROS 수업, 세미나, 강연, 강의 등의 보조 자료
ROS 수업, 세미나, 강연, 강의 등의 보조 자료. Contribute to robotpilot/ros-seminar development by creating an account on GitHub.
github.com
https://ai-mrkogao.github.io/ros/ROStutorial_korean/
ROS tutorial korean
로봇 운영체제 강좌로봇 운영체제 강좌
ai-mrkogao.github.io
http://oak.ulsan.ac.kr/bitstream/2021.oak/6851/2/200000337580.pdf
*참고 영상
https://www.youtube.com/watch?v=ESEoqhejK7o
*참고하면 좋을 사이트
http://docs.ros.org/en/hydro/api/gmapping/html/index.html
gmapping: slam_gmapping
gmapping This package contains a ROS wrapper for OpenSlam's Gmapping. The gmapping package provides laser-based SLAM (Simultaneous Localization and Mapping), as a ROS node called slam_gmapping. Using slam_gmapping, you can create a 2-D occupancy grid map (
docs.ros.org
http://jinyongjeong.github.io/2017/02/14/lec02_motion_observation_model/
[SLAM] Motion & Observation model · Jinyong
[SLAM] Motion & Observation model Motion model과 observation model 설명. 본 글은 University Freiburg의 Robot Mapping 강의를 바탕으로 이해하기 쉽도록 정리하려는 목적으로 작성되었습니다. 개인적인 의견을 포함하
jinyongjeong.github.io
https://saint-swithins-day.tistory.com/85
https://blog.naver.com/PostView.naver?blogId=ycpiglet&logNo=222153686510
https://emanual.robotis.com/docs/en/platform/turtlebot3/slam/
ROBOTIS e-Manual
emanual.robotis.com
https://www.ijert.org/research/optimization-of-slam-gmapping-based-on-simulation-IJERTV9IS040107.pdf
https://blog.katastros.com/a?ID=01350-f3bb9cd1-51af-4097-91f0-f61168ef1dd8
gmapping code analysis (for personal use) - Katastros
void SlamGMapping::startLiveSlam() { entropy_publisher_ = private_nh_.advertise<std_msgs::Float64>("entropy", 1, true); //Define the publisher entropy_publisher_, the topic name is "entropy", the node handle is private_nh_, and the publisher queue is 1. //
blog.katastros.com
https://answers.ros.org/question/199781/how-does-gmapping-detect-loop-closure/
How does gmapping detect loop closure? - ROS Answers: Open Source Q&A Forum
How does gmapping detect loop closure? edit I want to know the way to detect loop closure in gmapping package. I couldn't find loop closing method in gmapping papers.
answers.ros.org
https://roomedia.tistory.com/entry/SLAM-%ED%8C%A8%ED%82%A4%EC%A7%80#toc-Algorithm
12일차 - SLAM 패키지
SLAM 관련 패키지로는 gmapping, cartographer, rtabmap이 많이 사용됩니다. Gmapping Gmapping은 OpenSLAM에 공개된 SLAM의 한 종류로, ROS 패키지로 제공되고 있습니다. Rao-Blackwellized 파티클 필터를 사용하..
roomedia.tistory.com