11 SLAM and Navigation
11 SLAM and Navigation
11 SLAM and Navigation
Textbook
P. 312~360
1
Contents
I. Navigation and components
V. Navigation Practice
3
What?
ㅡㅡ;;
Let’s go a little easier!
Path Finding
How is it?
Path…
Path 「Noun」
Development of Compass
Magnetic compass
Front compass
GPS
Map
Arrived safely!
Let’s go to
B from A
What you need for path finding!
Avoiding Obstacles…
Arrived safely!
Let’s go to
B from A
Error
Weather
Outdoor
Required Information
Encoder value E on both wheel axes
(Recalculated as gear ratio for motor shaft)
Distance between wheels D
Wheel radius r
① Position: Measuring/estimating the robot’s position
Dead Reckoning Calculation Position & Orientation after movement
(𝑥𝑘+1 , 𝑦𝑘+1 , 𝜃𝑘+1 )
𝑣𝑙 =
𝐸𝑙 c − 𝐸𝑙 p
𝑇𝑒
∙
π
180
(radian/sec)
Linear velocity: v
𝐸𝑟 c − 𝐸𝑟 p π
Angular velocity: w 𝑣𝑟 =
𝑇𝑒
∙
180
(radian/sec)
𝑉𝑙 = 𝑣𝑙 ∙ r (meter/sec)
Rotation angle θ 𝜔𝑘 =
𝑉𝑟 − 𝑉𝑙
(radian/sec)
𝐷
∆s = 𝑣𝑘 𝑇𝑒 ∆θ = 𝜔𝑘 𝑇𝑒
∆𝜃
𝑥 𝑘+1 = 𝑥𝑘 + ∆𝑠 cos 𝜃𝑘 +
2
(x, y)
r D ∆𝜃
x 𝑦 = 𝑦𝑘 + ∆𝑠 sin 𝜃𝑘 +
𝑘+1
2
y
θ 𝑘+1 = 𝜃𝑘 + ∆𝜃
② Sensing: Measuring obstacles such as walls and objects
Distance Sensor
LRF, ultrasonic sensor, infrared distance sensor
Vision Sensor
Stereo camera, mono camera, omni-directional camera
Depth camera
SwissRanger, Kinect-2
RealSense, Kinect, Xtion, Carmine(PrimeSense), Astra
③ Map: Maps with road and obstacle information
Robots need a map to find a path!
Map
Digital maps for infrastructure such as roads!
Maps of hospitals, cafes, companies, homes?
Maps of unknown, collapsed hazardous areas?
pixabay.com, CC0
③ Map: Maps with road and obstacle information
Robots need a map to find a path!
Map
Digital maps for infrastructure such as roads!
Maps of hospitals, cafes, companies, homes?
Maps of unknown, collapsed hazardous areas?
pixabay.com, CC0
④ Path: Function to calculate optimal path to destination and travel
• Navigation
• Localization / Pose estimation
• Path search and planning
25
Gmapping
• One of SLAM method published in OpenSLAM, packaged in ROS
• Author: G. Grisetti, C. Stachniss, W. Burgard
• Feature: Rao-Blackwellized particle filter, Decreased number of
particles, grid map
• Hardware Constraints
• X, Y, Theta Speed Command
• Differential drive mobile robot
• Omni-wheel robot
• Odometry
• Measuring sensor: 2D plane measurable sensor(LRF, LiDAR, Kinect, Xtion, etc.)
• Rectangular and circular robots
https://www.openslam.org/gmapping.html
Mapping: Gmapping + TurtleBot3
• Software Preparation
• http://emanual.robotis.com/docs/en/platform/turtlebot3/pc_setup/
• http://emanual.robotis.com/docs/en/platform/turtlebot3/sbc_setup/
• http://emanual.robotis.com/docs/en/platform/turtlebot3/opencr_setup/
• Turtlebot3 Packages
• https://github.com/ROBOTIS-GIT/turtlebot3
• https://github.com/ROBOTIS-GIT/turtlebot3_msgs
• https://github.com/ROBOTIS-GIT/turtlebot3_simulations
• https://github.com/ROBOTIS-GIT/turtlebot3_applications
Mapping: Gmapping + TurtleBot3
• http://turtlebot3.robotis.com/en/latest/slam.html
• Run Master (Remote PC)
$ roscore
https://youtu.be/7mEKrT_cKWI
29
Mapping: Gmapping + TurtleBot3
• Completed map
2D Occupancy Grid Map (OGM)
https://youtu.be/lkW4-dG2BCY
Mapping: Gmapping & Cartographer + TurtleBot3
https://youtu.be/lkW4-dG2BCY
Mapping
https://mirror.enha.kr/
Mapping
If you want to develop a service or mobile robot with
SLAM & Navigation as basic function,
Just use SLAM and Navigation as they are and
spend more time in your desired area!
I look forward to seeing your unique robot
that is not in the world
How about it, easy?
https://mirror.enha.kr/
Mapping
If you want to develop a service or mobile robot with
SLAM & Navigation as basic function,
Just use SLAM and Navigation as they are and
spend more time in your desired area!
I look forward to seeing your unique robot
that is not in the world
How about it, easy?
If you want to study more about SLAM & Navigation,
All software is opened.
See it , understand it, and add functions!
There is no better textbook than practice
https://mirror.enha.kr/
Process of SLAM Related Nodes
① sensor_node ③ ② ①
② turtlebot3_teleop turtlebot3_core
velocity
turtlebot3_teleop sensor_node
③ turtlebot3_core
geometry_msgs/Twist
④ slam_gmapping
odom
tf/tfMessage sensor_msgs/LaserScan
tf scan
⑤ map_server base_footprint
④
base_link
gmapping
(slam_gmapping)
base_scan
⑤
map_server
map (map_saver)
nav_msgs/OccupancyGrid
map.pgm & map.yaml
Localization | Kalman filter, Particle filter, Graph, Bundle adjustment
• Kalman filter
• A recursive filter that tracks the state of an object in a linear system
containing noise
• Based on Bayesian probability
• Prediction
• Estimate the state of the current state from the
previous state by assuming the model
• Update
• Using the error between the predicted value
of the previous step and the actual measured
value obtained by the external instrument !
http://en.wikipedia.org/wiki/Kalman_filter, CC0
Localization | Kalman filter, Particle filter, Graph, Bundle adjustment
• Particle Filter
• A particle filter is a technique that predicts
through simulation based on a trial-and-error
method. Estimated values are represented as
particles with probabilistic representation.
(t3) (t4)
S. Thrun, W. Burgard, and D. Fox. Probabilistic Robotics. MIT Press, Cambridge, MA, 2005.
Navigation
39
Navigation + TurtleBot3
• http://turtlebot3.robotis.com/en/latest/navigation.html
• Run Master (Remote PC)
$ roscore
https://youtu.be/VYlMywwYALU
Navigation
• Dynamic Window Approach (Mainly used in local plan)
• How to choose the speed at which you can quickly reach the target point while
avoiding the obstacles that can collide with the robot in the ‘velocity search space’
of the robot 𝑣𝑠 𝑣𝑚𝑎𝑥
Collision
Area
• Given the direction, speed, and impact of the robot, the ∆𝑡 ∙ 𝑎𝑚𝑎𝑥
objective function G finds 𝑣, 𝜔 at which the objective
function is maximized
Dynamic Window
D. Fox, W. Burgard and S. Thrun, The dynamic window approach to collision avoidance, IEEE Robotics & Automation Magazine
Dynamic Window Approach (DWA)
Goal
Dynamic Window Approach (DWA)
Goal
Dynamic Window Approach (DWA)
Goal
Mapping
If you want to develop a service or mobile robot with
SLAM & Navigation as basic function,
Just use SLAM and Navigation as they are and
spend more time in your desired area!
I look forward to seeing your unique robot
that is not in the world
How about it, easy?
If you want to study more about SLAM & Navigation,
All software is opened.
See it , understand it, and add functions!
There is no better textbook than practice
https://mirror.enha.kr/
Practice Time!
“SLAM / Navigation”
47
Preparation of TurtleBot3 Simulation Development Environment
• Official TurtleBot3 wiki reference
• http://turtlebot3.robotis.com
• Basic package installation (for the use of 3D simulator Gazebo)
$ sudo apt-get install ros-kinetic-joy ros-kinetic-teleop-twist-joy ros-kinetic-teleop-twist-keyboard ros-
kinetic-laser-proc ros-kinetic-rgbd-launch ros-kinetic-depthimage-to-laserscan ros-kinetic-rosserial-arduino
ros-kinetic-rosserial-python ros-kinetic-rosserial-server ros-kinetic-rosserial-client ros-kinetic-rosserial-msgs
ros-kinetic-amcl ros-kinetic-map-server ros-kinetic-move-base ros-kinetic-urdf ros-kinetic-xacro ros-kinetic-
compressed-image-transport ros-kinetic-rqt-image-view ros-kinetic-gmapping ros-kinetic-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
48
TurtleBot3 in Gazebo
https://youtu.be/xXM5r_SVkWM
49
Run Virtual Robot with Gazebo
• Control virtual robot on 3D simulator Gazebo
• Robots can be controlled with ‘Turtlebot3_teleop_key’ node
• Possible to check sensor value mounted on robot on Gazebo via Rviz
• 2D Laser Range Sensor, Camera, Depth Camera, IMU, etc.
$ export TURTLEBOT3_MODEL=waffle_pi
$ roslaunch turtlebot3_gazebo turtlebot3_world.launch
$ export TURTLEBOT3_MODEL=waffle_pi
$ roslaunch turtlebot3_gazebo turtlebot3_gazebo_rviz.launch
50
Run Virtual Robot with Gazebo
51
Virtual SLAM with Gazebo
Run Gazebo
$ export TURTLEBOT3_MODEL=waffle_pi
$ roslaunch turtlebot3_gazebo turtlebot3_world.launch
Run SLAM
$ export TURTLEBOT3_MODEL=waffle_pi
$ roslaunch turtlebot3_slam turtlebot3_slam.launch
Run RViz
$ export TURTLEBOT3_MODEL=waffle_pi
$ rosrun rviz rviz -d `rospack find turtlebot3_slam`/rviz/turtlebot3_slam.rviz
TurtleBot3 Remote Control
$ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
52
Virtual SLAM with Gazebo
53
Virtual Navigation with Gazebo
Run Gazebo
$ export TURTLEBOT3_MODEL=waffle_pi
$ roslaunch turtlebot3_gazebo turtlebot3_world.launch
Run Navigation
$ export TURTLEBOT3_MODEL=waffle_pi
$ roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml
54
Virtual Navigation with Gazebo
55
Question Time!
Advertisement #1
Download link
Language:
English, Chinese, Japanese, Korean
Direct Link
Advertisement #3
www.robotsource.org
The ‘RobotSource’ community is the space for people making robots.