본문 바로가기

FOSCAR-(Autonomous Driving)/ROS 스터디

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

반응형

1. 내비게이션과 구성 요소 

#길 찾기에 필요한 것 

1) GPS 2) Indoor Positiong Sensor 3) 추측 항법 4) 경로 : 목적까지 최적 경로를 계산하고 주행하는 기능 

 

SLAM - 위치 +센싱 -> 지도 

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

 

#SLAM을 위해 ROS에서 주어진 패키지 - Gmapping

-OpenSLAM에 공개된 SLAM의 한 종류, ROS에서 패키지로 제공

 

http://wiki.ros.org/gmapping 

 

gmapping - ROS Wiki

melodic noetic   Show EOL distros:  EOL distros:   electric fuerte groovy hydro indigo jade kinetic lunar diamondback: Only showing information from the released package extracted on Unknown. No API documentation available. Please see this page for in

wiki.ros.org

 

• 저자: G. Grisetti, C. Stachniss, W. Burgard

• 특징: Rao-Blackwellized 파티클 필터, 파티클 수 감소, 그리드 맵

• 하드웨어 제약 사항

  • X, Y, Theta 속도 이동 명령

  • 주행기록계 (Odometry)

  • 계측 센서: 2차 평면 계측 가능 센서( LRF, LiDAR, Kinect, Xtion 등)

  • 직사각형 및 원형의 로봇

 

맵 지도 만드는 방법

 

#실습 

 

참고 자료

https://emanual.robotis.com

 

기본 설치 패키지이다 .

$ sudo apt install ros-melodic-joy ros-melodic-teleop-twist-joy ros-melodic-teleop-twist-keyboard \
ros-melodic-laser-proc ros-melodic-rgbd-launch ros-melodic-depthimage-to-laserscan ros-melodic-rosserial-arduino ros-melodic-rosserial-python \
ros-melodic-rosserial-server ros-melodic-rosserial-client ros-melodic-rosserial-msgs ros-melodic-amcl \
ros-melodic-map-server ros-melodic-move-base ros-melodic-urdf ros-melodic-xacro ros-melodic-compressed-image-transport \
ros-melodic-rqt-image-view ros-melodic-gmapping ros-melodic-navigation

패키지 빌드

$ 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

패키지 빌드

$ sudo nano ~/.bashrc

방향키를 따라 맨 밑으로 이동 후, 다음과 같은 문장을 복붙해서 넣어준다.

export TURTLEBOT3_MODEL=waffle_pi

 

 

$ source .bashrc
$ source devel/setup.bash

실행 

$ roslaunch turtlebot3_gazebo turtlebot3_world.launch
$ roslaunch turtlebot3_gazebo turtlebot3_gazebo_rviz.launch

로봇을 움직일 수있다.

$ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

이제는  SLAM을 실행시켜보자 

$ roslaunch turtlebot3_slam turtlebot3_slam.launch

지도 생성

$ rosrun map_server map_saver -f ~/map

네비게이션 실행

$ roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml

 

반응형