5CHAPTER 1: OVERVIEW OF SLAM AND HECTOR SLAM...- 6CHAPTER 2: DESIGN THE ROBOT SLAM FRAME USE ROS.... Keywords 3 — 5 words Mobile robot, Robot Operating System ROS, Simultaneous Localizat
Trang 1VIETNAM NATIONAL UNIVERSITY, HANOI
INTERNATIONAL SCHOOL
STUDENT RESEARCH REPORTResearching and developing the 2D mapping for a mobile robot
Hanoi, April 2024
Trang 2TEAM LEADER INFORMATION
- Program: Automation and Informatics
- Address: Xuan Thuy — Dich Vong Hau — Cau Giay — Ha Noi
- Phone no /Email: 21070198 @vnu.edu.vn
II Academic Results (from the first year to now)
Hanoi, April 15th, 2024Team Leader
(Sign and write fullname)
Trang 3ContentsINTRODUCTION 0 nnhaẶ '"-: :¡:545 5CHAPTER 1: OVERVIEW OF SLAM AND HECTOR SLAM - 6
CHAPTER 2: DESIGN THE ROBOT SLAM FRAME USE ROS 9
Design Methodology 00.0 ceseessesssssessessessessessessessnssvssnssnssnseuccnscucsuecuecneeneenesnecssnseveseseesseseeeseceneeneeneens 9Mechanical Design 0 ecececsesessesesessesesessesnesessecucsesnecncsesncanessnesussesuececsesnecuesesnesessesucaeneeneaeeneeneanens 9
MS 9/05i03-.5000//(001.58.(0 0 12
CHAPTER 3: SUAM c5: 2c 2 HH H2 H2222111211121212122e 14
1 The Extended Kalman Filter (EKTE) ¿2 2 %6 +E+E£E+E£EEEEEEEEEEEEEEEEEkekekerrkrrrrerrrerree 15
2 Extended Kalman Filter SLAM -¿-c-5:+c+ 2tr2 t2 212 11rre 17
CHAPTER 4: ROS He 19L.ROS nu mẽ o.A.A 19s20 1800): TS n 244.Conclusion & RecommendatIOTS - 55t 2E EEEEtrkrrrrkrrrrrrrrrrrrrrrrrrrrrei 255.Ab€VIAfIOTI - 2G TH HH TH TH TH HH HH HH Hiện 25REFERENCES 00 SE 25
Trang 4LISTS OF FIGURES
Figure | The relationship between these computation models in mobile robots 7 Figure 2 The parameters 1n SLÀÌM - s1 HH HH Hệ 7 Figure 3 The nodes of the hector SLAM eee eeeeceeseeseseeceseeeeecseceseeseessceeeeaesesseseneenes 8 Figure 4 Overview of the Mobile Robot SySf€m - 5 6 11x HH re 9 Figure 5 Overview 00:9 0800 10 Figure 6 Cross-sectional diagram of mobile robot -¿- + + £+x+sEEseEseksskeseeseesee 10 Figure 7 3D design 0901910110210 10 Figure 8 Servo MG996R 01.00888818 11 Figure 9 LM2596 DC Buck Converter step-down power moduÌe - - «+ «<+«+ 11 Figure 10 Jetson Nano developer Kit ccesccesccssceseeeseceseceeeeeeeseceneeeseeeeeeeeceaeceneeeeeseaees 12 Figure 11 The four-wheeled mobile robot kinematic model , «+ s+++s*++s++sx+++ 13 Figure 12 Folder layer structure in RÖS - - 5 «+ HT HH tr Hư 19 Figure 13 The architecture of a package - G1 HH ng ng rưy 20 Figure 14 The architecture Of a SfACK s5 HH cư 20 Figure 15 the trade information between two nOđ€§ s5 + se, 21 Figure 16 ROS topic .eccccecseceesesseeseseceeseeseesecsceesessecsececeesessesseeeceeaeeaeseeeaeeaeeaeseeeeaeeaeeenees 23 Figure 17 Rviz in ROS and real SC€I 5 5 5E 3 E231 E930 E910 1911 91 9 nh ng ng rưy 24 Figure 18 Experiment System - - c1 919911911191 TH cưy 24
Trang 5Researching and Developing based 2D map for the Mobile Robot
Project Code: CN.NC.SV.23_02
1 Member List:
Full Name Class ID
Le Thi Thu Huyen AAI2021B 21070198
Pham Tuan Minh AAI2021A 21070741
Nguyen Ngoc Anh AAI2021A 21070304
2 Advisor(s): Ph D Nguyen Dang Khoa — Faculty of Applied Sciences
3 Abstract (300 words or less):
The field of mobile robots is still a topic of interest to many scientists due to its ability
to move, explore, and learn about places that humans cannot reach Which, Slam withrobot operating system (ROS) is the main development trend However, most studiesfocus on algorithm simulation or based on the two-wheeled robot model sold in themarket This research presents the design and development of slams for four-wheeled
mobile robots The first part of the report will briefly present a mobile robot model
and methods to control the motor Then the basic filters such as Extended KalmanFilter (EKF), and Particle Filter (PF) will be applied to estimate the position and speed
of motors Test results in the laboratory and an artificial maze show that the robotworks well, and the robot can also move within the map at the request of the operator
4 Keywords (3 — 5 words)
Mobile robot, Robot Operating System (ROS), Simultaneous Localization and
Mapping (Slam)
Trang 6SUMMARY REPORT IN STUDENT RESEARCH,
2023-2024 ACADEMIC YEAR
1 Literature Review
Nowadays, many practical applications of Mobile Robots have been appliedworldwide Mobile Robots can be found in logistic systems to carry and store goods,navigate, monitor, and control quality In research, the Slam (Simultaneous
Localization and Mapping) problem is a major but still relatively new area of robotics.The first research on intelligent robot systems was presented by Leonard in 1990
Following that, two studies on the robot Slam introduced by Durrant-Whyte andBailey became the foundation of Slam research in the world In this literature review,
we will explore some of the research that has been conducted in this area
There is some previous research focusing on designing a fuzzy controller for mobilerobots or a position controller The characteristics of these studies are that theenvironment is predictable and does not present many obstacles Besides, anyresearch about the Slam also focuses on building development algorithms based onavailable mobile robot models, and most of these models are two-wheeled vehiclemodels with a constant kinematic model Therefore, the solutions for movementcontrol and velocity calculation are relatively the same
In this research, we will present a robot Slam design model by robot operating systemROS A mobile robot is designed through a software design SolidWorks and printed
to set up control circuits and executive structure The low-level controller includes anSTM32F4 microcontroller that controls four motors through L298 power circuits.The high-level controller includes a laptop and a Jetson Nano, both installed withROS Mobile robots are capable of seft-mapping and seft-moving to update the map.After the map-building process is completed, the operator can control the robot tomove to the desired location
CHAPTER 1: OVERVIEW OF SLAM
SLAM (Simultaneous Localization and Mapping) is the algorithm that practices
parallel geolocate and map build
The computation model SLAM is defined as:
Setting the Robot on one does not identify the environment The robot will move in
this environment and feel the environment through sensors that are set up in the robot
Trang 7SLAM is the mapping build problem as well as identifying the location of the robot
compared with this mapping
To autonomously move the robot and identify the current location, we need tosimulate the map movement place of the robot — called the Mapping After havingthis map, we need also to identify locate of it in that place — called Localization Tocontinue, we will identify the road for the robot and control it following the righttrajectory — called the Path-planning The computation model for two problemsLocalization and Mapping is called the computation model SLAM
Figure 1 The relationship between these computation models in mobile robots.
The robot will autonomously move and identify position as well as around place how
it After that, it can be autonomously moved on to any other position and self-updatearound the environment Moreover, when the location of it changes, it will also self-identify
Robot Position
C===e' observed
} unknown
Figure 2 The parameters in SLAM
Firstly, we will define:
- Timet
Trang 8- X, 1S characterized by two position variables in 2D space and rotation of the robot.
Then, the series of postures are combined into 1 set x, = {X1,%2, Xz }
- U, is the quantity that characterizes motion between time t-1 and time t, that data
can be obtained from the robot’s wheel encoder or from the controller thatsupplied for those engines After that, the series of data are combined U; ={uz Uz, u„} characterizes motion the robot.
- mis the environment mapping The environment can include the benchmark, and
objects and m is the description of it
- 2Z, is the measurement of the sensors The series of measurements is listed as:
Zp = (24, Zo, Z4}.
Hector SLAM is a powerful Simultaneous Localization and Mapping (SLAM)approach within the Robot Operating System (ROS) ecosystem Hector_slam is the2D SLAM technique that was developed in 2018 In the ROS, hector_slam is a smallpackage to set up hector_mapping and other concern packages The main packagesinclude:
- hector_mapping: node SLAM based on LiDAR
- hector_geotiff: save the map and trajectory robot in the geography image file
- hector_trajectory_server: save the trajectory based on tf.
Figure 3 presents the relationship between the nodes of hector SLAM that areintegrated into ROS Which, the parameters of node hector_mapping can becategorized:
- tf parameter: includes parameters to adjust tf frame;
- Mapping parameter: includes parameters to set the map attributes as size,
Trang 9The main idea: a mobile robot model is designed through a robot operating systemROS and uses algorithms to identify its position in place as well as identify the road
for mobile robots and controls following the right trajectory
CHAPTER 2: DESIGN THE ROBOT SLAM FRAME USE ROS
Design Methodology
An overview of the system is presented in Figure 4 Users use the computer to control,observe the map creation results, and command the robot to move to the locationthrough the Linux computer (Jetson Nano) Both two devices are installed with theRobot Operating System (ROS) on Ubuntu 20.04 and connected to a common WiFisystem, communicating via SSH standard Jetson Nano received the output signal
from the LiDar sensor to build mapping and communicate with board Arduino Mega
through USB standard, and at the same time to control the executive structureincluding four DC motors based on the PID controller
Bên trong SLAM Robot
Figure 4 Overview of the Mobile Robot System
Mechanical Design
The shaped steel materials is used for the frame design, and the material used to makethe wheels is rubber, with the weight of the vehicle is 5.9kilograms and thetransmission range is 1:27 The size of the mobile robot is 445*363, idle speed is1.3m/s, and the loadcell is 10kilograms The robot frame is calculated and designedwith the vehicle lid including an RPLidar Lidar sensor, the vehicle body including aJetson Nano, an Arduino mega microcontroller circuit, and a gear motor with the
following technical specifications:
Trang 10- Maximum speed: 12V
- Idle speed: 325rpm
- Maximum current: 2.3A
(a) Orthographic (b) Axonometric (c) Oblique
Figure 6 Cross-sectional diagram of mobile robot
Figure 7 3D design of mobile robot
The Servo motor is the next version that is updated from the MG995 servo about thevelocity, traction (Fk), and accuracy Some parameters of the devices are as:
e Traction: 4.8V (9.4kg/cm respectively), 6V (1 1kg/c respectively)
10
Trang 11e The speed of MG996R is faster than MG946R, but have size is smaller.
e Rotation speed: 0.17s/60° (4.8V respectively), 0.14s/60° (6V respectively)
Figure 8 Servo MG996R 180°
The LM2596 regulator is a monolithic integrated circuit ideally suited for the easyand convenient design of a step-down switching regulator (buck converter) It iscapable of driving a 3.0V load with excellent line and load regulation This device isavailable in an adjustable output version and it is internally compensated to minimizethe number of external components to simplify the power supply design
Figure 9 LM2596 DC Buck Converter step-down power module.
The Jetson Nano module is a small AI computer that gives you the performance and
power efficiency to take on modern AI workloads, run multiple neural networks inparallel, and process data from several high-resolution sensors simultaneously
11
Trang 12Figure 10 Jetson Nano developer kit
SLAM Process of Mobile Robot
With the SLAM robot, the process of building mapping in the not-identifiedenvironment is the best factor The SLAM process includes many steps: identifybenchmarks, collect distance data in the environment, estimate state values, associatedata, and move and update the robot with new positions and states SLAM synthesis
is a process in which individual parts of each process are performed using manydifferent algorithms All of the SLAM process in this research includes steps:
- Set up a fixed coordinate system with the observation environment
- Set up a mobile coordinate system located on the robot
- Set up the kinematic equation for the robot (the wheeled control velocity and the
distance moved)
1.1 Set up the PID controller for the motor
To control the moving robot, the PID controller is installed for four-wheeled drivemotors The input signal is the number of set pulses (rpm), the output signal is themotor speed in the form of pulse width, and the feedback signal is the number ofpulses measured from the encoder (rpm)
The PID function for the motor system:
RPM = Kp * Err + K,* integral + Kp * derivative (1)
Err = setppy -— RPM (1.1)
prev_etror = error (1.2)
derivative = Err = prev_error (1.3)
integral = integral + error (1.4)
12
Trang 13e RPM is the revolutions per minute
e Err, prev_error is the difference in the revolutions per minute of the motor in time
t
© setppy is the number of set pulses
e Using the trial and error method, PID coefficient Kp =0.3 ,K; =
0.001 ,Kp = 3 respectively
1.2 Kinematic Model
The mobile robot kinematic model uses a wheeled coordinate system Descarte is
presented in Figure 11
Figure 11 The four-wheeled mobile robot kinematic model
The robot SLAM kinematic model in this research is presented as:
1 Set the fixed coordinate system for the observation environment: The board sends
the coordinate 0(X0, YO, Z0) to ROS
2 Set the coordinate system for the mobile robot (x, y, Ø)
3 ROS sends the velocity to the robot The convert equation of the long velocity
into the velocity of four-wheeled is described as:
Trang 14© Vx, Vy, Vg are velocity values that received from ROS (m/s), max 0.5m/s
e r,dis the radius and diameter of the wheel (mm)
e L,,Ly is the distance between two wheels according x and y direction (mm)
¢ rpMix,TpMy is the speed and direction of rotation.
CHAPTER 3: SLAM
Filtering is a processing process that removes what is of no value or no interest and
retains what has value In signal processing, a filter is designed to filter out a clean
signal (to be found) from mixed signals between clean signals and dirty signals
14
Trang 151 The Extended Kalman Filter (EKF)
Most of the robot’s state transition functions and measurements are non-linearfunctions
Firstly, we assume the state transition function and measurement are non-linearfunctions defined by the formula:
Xp = g(w,,x¿_+) + & 3.1)
Zp = h(,) + 6; (3.2)
The main idea underlying the EKF filter is linearization We will use the first-orderTaylor formula to linearize:
GU Xp-1) & Ge Me-1) + Gg! Ue Me-1) Me-1 — Me-1) (3.3)
= gue, Me-1) + Ge (Xp-4 — Mẹ—1)
h(x,) ~h (ut) +h' (ue) (x: — Me) (3.4)
=h (ue) + Hị (Xt — Ut)
From here, we will also derive the following formula:
e State transition probability:
P(X¢|Ur, X-1) =
det det 2nR,)> ; =“x n Ge(Xe-a- Mea)" Re *[Xe-9 Ue Me-1)-Ge-Xe-1- Hẹ—1)]
(3,5)
e Measurement probability:
p(x,) = det (2mQ,) 73 e_zlZt—h(e)=He(Xe~e) f0 ze (ue) He (xe-He)] (3.6)
Algorithms: Algorithm Extended_Kalman_filter (u;_1, 24-4, Uz, Zt)