You are on page 1of 8

Autonomous Navigation of an Indoor Mobile Robot

RBE 550 Motion Planning - Spring 2021

Vrushabh Desai Akash Krishnagiri Sridharan Eleanor Foltan


MS, Robotics Engineering MS, Robotics Engineering MS, Robotics Engineering
Worcester Polytechnic Institute Worcester Polytechnic Institute Worcester Polytechnic Institute
vmdesai@wpi.edu akrishnagirisrid@wpi.edu edfoltan@wpi.edu

Abstract—Autonomous navigation of an indoor mobile robot


has become a field of paramount importance in recent years
owing to the increased usage of small robots in households and
research. However, there exists a multitude of steps before full
autonomy is achieved. This project aims to solve the subsection
of indoor navigation using various motion planning algorithms
to provide an analysis and a comparative study of the different
algorithms utilized.

I. I NTRODUCTION

Finding the right motion planning algorithm for an indoor


mobile robot is an integral aspect in designing the system. It
dictates the complexity of the system in terms of computa-
tional power and time. For real-world applications, time is an
important factor, and being able to react quickly is a necessary Figure 1: Sample indoor environment filled with static
trait for an indoor mobile robot. There exists a plethora of obstacles
motion planning algorithms such as Dijkstra’s, Breadth-first,
Depth-first, A*, etc. This work aims to implement a few major
algorithms, analyse them, and perform a comparative study A reach goal of this project is to implement planning
to provide users with information to choose an appropriate algorithms in an indoor environment with dynamic obstacles
motion planning algorithm for their mobile robot. on Turtle-bot 3 with a velocity planner.

II. P ROJECT S COPE


III. L ITERATURE R EVIEW
The principal goal of this project is to implement various
motion planning algorithms in an indoor environment with
static obstacles for a mobile robot using ROS and Gazebo. While there has been a significant amount of work done
Further, the work also involves a detailed analysis and a in developing novel algorithms and architecture for solving
comparative study of the planning algorithms to measure their the motion planning problem [9], equal amounts of work is
efficacy. The following algorithms will be implemented and being done in devising strategies which combine the already
analysed in this work: existing algorithms for robust and effective planning in indoor
environments. In the process of global path planning of the
• BFS mobile robot, the following steps should be followed in the
• Dijkstra’s Algorithm general case. (1) Environmental modeling. The environmental
• A* Algorithm modeling is built according to the known map information:
• Probabilisitc Roadmap (PRM) Algorithm the actual environment for the mobile robot to perform task
This work solely focuses on implementing and analysing the is converted to the map feature information. (2) Optimization
motion planning algorithms and will hence assume that the criteria, which involves designing a specify cost function. (3)
map of the indoor environment is already available from Path search algorithm.[5] The path search algorithm is adopted
the perception/SLAM output. Due to the constraints posed to find a collision free path between the starting point and the
by COVID-19, this project will primarily be executed in target point in the state space which must satisfy a set of cost
simulation using ROS and Gazebo. The planning algorithms optimization criteria such as path length, smoothness, safety
will be deployed and tested on the Turtle-bot 3, available in degree, etc. The principle of mobile robot global path planning
ROS in an indoor environment such as Fig. 1. is shown in Fig. 2 [12].
A. Simulation and Software Tools for Verification
Several methodologies for visualizing the outputs of the
motion planning algorithms were developed in order to check
their functionality before integration into the full simulation
framework. These methods include using the PIL, Python
Imaging Library, and using RVIZ within a ROS Structure.
Figure 2: The principle of mobile robot global/local path
planning 1) PIL Verification: The Python Imaging Library, PIL, is
used to verify the motion planning algorithms in a standalone
manner, prior to being integrated with ROS and the Turtlebot.
Before the mobile robot global path planning, a suit-
It is achieved by using the algorithms to solve mazes. Mazes
able environmental model will help to better understand the
of varying dimensions are loaded and parsed to the search
environmental variables, reduce unnecessary planning and
algorithm function to evaluate cost and time. An example maze
greatly reduce the number of computations.Common methods
is shown in Fig. 4. A maze along with its size, starting position,
of environmental modeling have framework space approach,
and goal position is provided for the algorithm to search for
free space approach, cell decomposition approach, topological
an optimal path.
method and probabilistic road map method. In order to sim-
plify the problem, the mobile robot is usually reduced to a
point, the obstacles around the mobile robot are scaled, the
mobile robot can move freely in the obstacle space without
colliding with obstacles and boundary. There are various path
planning algorithm’s like Dijkstra’s, A*, RRT, RRT* etc.
which can be used to solve indoor mobile navigation.[9]
This paper proposes a novel framework of using RRT* as a
global planner to compute the high-level route avoiding static
obstacles and again uses RRT* as a local planner to avoid
dynamic obstacles as and when they appear. [6] This paper
uses A* as a global planner to generate a high-level path and
again uses A* as a local planner to avoid dynamic obstacle
locally. Fig. 3 [12] provides a generalize Classification of path Figure 4: An example maze to be visualized using PIL
planning which can be used in solving planning problem.
Several algorithms were tested with PIL including:
(1) Breadth-First Search (BFS)
Breadth-First Search, BFS, is a search algorithm that is used
for traversing graphs, trees, etc. It starts at a given position
and searches all the neighbouring positions at the current level
before moving onto the next. A Queue data structure is used
to implement it in Python. As discussed above, a sample maze
is used to test the algorithm using the PIL. A solved example
using the BFS algorithm is displayed in in Fig. 5. The cost for
the displayed maze using BFS was evaluated to be 55 units
and the time taken for the algorithm was 0.0019 seconds.

Figure 3: Classification of path planning.

It uses a coarse grid of the map to generate a high-level


path and successively refines the grid for generating optimal
path locally avoiding dynamic obstacles.
IV. M ETHODOLOGY
The first portion of the project focused on the development Figure 5: An example maze solved using the BFS algorithm,
of Python scripts and ROS Nodes for implementing and testing start = (0, 1) end = (19, 18)
motion planning algorithms.

Page 2 of 8
(2) A* Algorithm
A* search is a method of search in which the planner decides
the steps based on the cost of movement and with a sense
of direction towards the goal state. Each step is decided by
a function that is the sum of the cost + heuristic, where the
heuristic is the distance/direction measure to the goal from
that point. To achieve this, the algorithm uses a priority queue
data structure. It is planning ahead at each step to ensure that
the goal is reached optimally. A solved example using the A*
algorithm is displayed in Fig. 6. The cost for the displayed
maze using A* was evaluated to be 3228 units and the time
taken for the algorithm was 0.212 seconds. (a) (1,99) to (99,1), 30% Obstacles (b) (1,1) to (51,99), 20% Obstacles
Figure 7: Dijkstra’s Algorithm Results

B. Additional Algorithms Implemented


1) Probabilistic Roadmap (PRM): The Probabilistic
Roadmap Algorithm is a method of searching through
environments that occurs in two steps. First, a tree is
constructed. This occurs by selecting a predetermined number
of random free samples within the environment. Then, a
local path planner is used to connect each node with a
specified number of its closest neighbors. For this project,
the PRM tree construction algorithm was implemented in
the PRM Construct.py ROS node. A* algorithm code from
Section IV-A1 was implemented as the local path planner,
and 100 nodes were connected to 6 neighbors each. The
PRM Construct.py node publishes its tree information for the
Figure 6: An example maze solved using the A* algorithm, second half of the algorithm - querying - to utilize.
start = (8, 201) end = (110, 1) During the querying portion of the PRM Algorithm, the
start and goal node are each connected locally to the tree.
Then, a path planning algorithm is applied to the tree to find
the overall path from start to goal. In this implementation
the A* algorithm, described in Section IV-A1, was utilized
to connect the two end nodes and search the tree. This step
2) RVIZ and ROS Verification: A simple ROS-RVIZ struc- occurred in the PRM Search.py node. The advantages of PRM
ture was developed in order to verify the proposed framework include simplifying high-dimensional environments where a
and algorithm implementation. In this structure, a map with C-Space calculation such as Minkowski Sum would be too
randomly placed obstacles, specified as a percent coverage computationally intensive to be effective. The algorithm is
of the map, is published to a topic and received by path probabilistically complete, in that, as the number of vertices
planning nodes. Each path planning node runs its algorithm, increases, the optimality and completeness of the exploration
and publishs the path to a GridCell topic in order to be result improves.
visualized in RVIZ. C. Metrics to use
This was tested on Dijkstra’s Algorithm:
The Dijkstra’s algorithm was implemented in a ROSpy node The following metrics were implemented and examined
structure Dijkstra.py. The Dijkstra’s algorithm expands the through the ROS framework and RVIZ visualization tool.
node reached with the minimum distance g(x) from the starting • Computational Time - the total time the algorithm takes

node. As the frontier expands, neighboring nodes are added to to explore the space and generate a path.
the OPEN list, and their g(x) scores are calculated and updated. • Path Length - the total number of nodes on the generated

Dijkstra’s algorithm minimizes the distance to reach the goal path.


node, but unlike A* or its successors, does not provide a • Number of Visited Cells - the total number of cells visited

sense of ”direction” towards the goal. Two example Dijkstra’s by the algorithm before termination.
algorithm solutions are shown in Fig. 7. The length of the first • Visited Cells vs. Time - the rate of progression of

example - Fig. 7a - is 203 nodes, with a computational time exploration of each algorithm.
of 1.556 seconds. The length of the second example - Fig. 7b The BFS, Dijkstra’s, A*, and PRM algorithms were analyzed
- is 149 nodes, with a computational time of 1.177 seconds. and compared against these metrics utilizing the framework

Page 3 of 8
established in Section V-A. The results of this analysis are
explored in Section VI.
V. S IMULATION E NVIRONMENT
A. RVIZ and ROS Framework
In order to compare the key performance metrics of the
various motion planning algorithms, a comprehensive ROS
framework was developed to run each algorithm on a sample Figure 10: Binary Floorplan Representation
floor plan, shown in Fig. 8 [14].

∴ 1pixel = 2inches (2)

RT urtleBot = 105mm = 4.13inches (3)

DT urtleBot = 8.26inches = 4.13pixels (4)


Based on these calculations, a C-Space width of 4 pixels was
chosen.The resulting C-Space, displayed in RVIZ, is shown in
Fig. 11. The floorplan is shown in teal, and the C-Space is
shown in black.
Within the ROS structure, all path planning algorithms were
Figure 8: Floor plan used in ROS Implementation [14] implemented in their own nodes - Bfs.py, dijkstra.py, A star.py,
PRM Construct.py, and PRM Search.py. These algorithms
On this floor plan, several starting points were chosen to read in the map information and the start and goal nodes
serve as default options for start and goal node positions for from the /map info topic. They perform the search algorithm,
the path planning algorithms. These points are shown in Fig. and publish the set of visited nodes and nodes on the path as
9. GridCell objects to be visualized in RVIZ. The PRM algorithm
is implemented as two nodes - one to construct the tree and the
second to search it. All path planning nodes also publish to a
special results topic with a custom message type Results.msg.
This message includes information on key performance met-
rics such as computational time, path length, and number of
nodes visited. A final node Results Output.py compiles and
displays this data for all algorithms, and writes .csv files
containing all graphable data. The entire ROS structure is
represented in the Appendix, in Fig. 22.

Figure 9: Available Start and End Nodes

Under the ROS framework, a node Map.py was developed


to read a binary version of the floorplan, shown in Fig.
10, using the PIL library. The map is processed, and the
obstacles are saved as a GridCells object and published to a
topic /floorplan. Other map information, including dimensions,
obstacle locations, and start and end nodes are published to
a /map info topic for path planning nodes to access. The
Map.py node also handles the calculation of the C-Space. This
calculation was performed by growing each node belonging to
the edge of an obstacle by the robot’s diameter - 210 mm [15].
Growing by the robot’s diameter ensures that the path planning
Figure 11: Floorplan and C-Space in RVIZ
algorithm will not extend into areas too small for the TurtleBot
to navigate. A conversion equation was used to determine the
equivalent number of pixels to the TurtleBot’s diameter. The B. Gazebo Simulation Framework
pixel width of a doorway was measured and correlated to a
To test the proposed algorithms on a robot in an environment
standard doorway width of 30 inches [16].
comparable to a real-world, indoor setting, a virtual, indoor
1doorway = 15pixels = 30inches (1) domain was simulated in Gazebo comprising of various static

Page 4 of 8
obstacles like tables, pillars, etc. as shown in Fig. 13. The
simulated environment closely equates to a static real-world
setting that provides a good benchmark to test and compare
the various motion planning algorithms.
The algorithms are tested by implementing them on the
TurtleBot3 available in ROS and Gazebo. TurtleBot3 is a
new generation mobile robot that is modular, concise, and
customizable. The start and the goal position of the Turtlebot
is decided, based on the selected algorithm the Turtlebot
navigates in this indoor static environment as shown in Fig.
12. To generate a graphical visualization of the generated path
we used Open-CV. A real-world version of the robot is shown
in Fig. 14 [13]. The simulated TurtleBot3 is shown in Fig. 13
at the center as a black object with a green box around it. Figure 14: TurtleBot3

VI. R ESULTS AND C OMPARATIVE A NALYSIS


The following results represent a comparison of the key
metrics identified in Section IV-C. Data was collected in three
different start-end goal scenarios in the ROS/RVIZ simulation
structure.

A. General Results
In Figures 15, 16, and 17, the results of three path finding
queries for BFS, Dijkstra’s Algorithm, and A* are shown. The
visited cells are shown in white, and the path is shown in pink.
In Fig. 18, the same three scenarios are demonstrated for PRM,
with the tree shown in white, the path shown in pink, and
the visited cells shown in green. The three scenarios were:
(1) Bathroom to Bedroom, (2) Kitchen to Bathroom, and (3)
Closet to Kitchen.
Figure 12: Path generated in by A* Algorithm

Figure 15: BFS Results

Figure 16: Dijkstra’s Results

Figure 13: Indoor Testing Environment simulated in Gazebo Figure 17: A* Results

Page 5 of 8
because PRM represents only a portion of the C-Space in its
tree. BFS and Dijkstra’s, which are not strategic in their choice
of frontier nodes, share a similar number of nodes visited. The
A* algorithm has a reduction of nodes visited compared to
BFS and Dijkstra’s - between 59 and 72 percent - which can
be attributed to its heuristic and sense of direction towards the
goal. This is also observable in Fig. 17, where you can see
the targeted expansion of the A* algorithm.
The final metric reported from the three scenarios is Path
Length. In each trial BFS reported the lowest path length
Figure 18: PRM Results between the start and the goal node, while A* and Dijkstra’s
algorithm reported higher costs. This may in part be due to
B. Key Metrics a limitation in the implementation of these two algorithms,
Computational time, path length, and nodes visited for each which only searched the 4 connected neighbors of each cell,
path planning algorithm were recorded for each scenario. Note rather than the 8, which produce a shorter path. BFS will
that for the PRM algorithm - the computation time reflected consistently produce the optimal path in the environment. The
does not include the time cost to construct the tree. These PRM algorithm however, which was run using 100 nodes
times were 178.28 s, 221.08 s, and 295.34 s for each scenario. with 6 connections each, is not likely to return the optimal
In each scenario the tree consisted of 100 nodes with 6 path. This is reflected in the Path Lengths data for all three
connections each. The metric comparison results are shown scenarios, in which PRM produced paths between 42 and 175
in Tables I, II, and III. nodes longer than the optimal BFS path.
These metrics and their impact on mobile indoor robots are
Algorithm Computational Time (s) Path Length Nodes Visited
BFS 0.09 99 6096 discussed further in Section VII.
Dijkstra 37.59 140 7162 C. Rate of Exploration
A* 7.86 140 1730
PRM 3.36 274 1000 The rate of exploration of each algorithm was also measured
and calculated in order to compare their application to indoor
Table I: Scenario 1 Metrics
mobile robots. The rate of exploration is defined as the rate at
which the algorithm visits and evaluates nodes in the graph -
Algorithm Computational Time (s) Path Length Nodes Visited units are nodes/second. At each iteration of the algorithm the
BFS 0.16 147 9066
Dijkstra 56.91 204 9352
time and the overall number of visited nodes were recorded.
A* 17.9 204 3428 These results were graphed and used to find the rate of
PRM 4.56 238 1101 exploration. Fig. 19, 20, 21 show these values, which are also
Table II: Scenario 2 Metrics captured in Table IV.

Algorithm Computational Time (s) Path Length Nodes Visited


BFS 0.14 161 7820
Dijkstra 40.56 201 7521
A* 14.61 201 3056
PRM 2.96 203 763

Table III: Scenario 3 Metrics

Tables I, II, and III reflect some of the important differences


between the various algorithms. First, observe Dijkstra’s algo- Figure 19: Rate of Exploration Scenario 1
rithm - in all three scenarios, this algorithm took the longest
to compute the path. This intuitively makes sense - Dijkstra’s
algorithm requires more computational power than BFS, and
requires the sorting of the OPEN list in priority order. It visits
every node and calculates its cost from the start node; it has no
sense of direction towards the goal. On the other hand, BFS is
a fast algorithm - this is largely due to its simplicity in visiting
nodes - there are no computationally intense calculations. PRM
also reports a low time cost, as it searches through fewer nodes
than the other three algorithms.
In fact, the scenarios prove PRM searches between 42
percent to 75 percent fewer nodes across the scenarios. This is Figure 20: Rate of Exploration Scenario 2

Page 6 of 8
• Authorship of section III.
• Demo video
Akash Krishnagiri Sridharan
• Implementation of the BFS A* Algorithms
• Visualization using the PIL
• Gazebo Simulation Environment
• Authorship of Sections I, IV A1, IV B1, IV B3, V B
VIII.
Figure 21: Rate of Exploration Scenario 3 • Powerpoint Slides: Introduction, PIL, BFS, A*, Software
Platform, Simulation Environment
• Demo video
Algorithm Rate Scenario 1 Rate Scenario 2 Rate Scenario 3
BFS 63773 56318 57653 Eleanor Foltan
Dijkstra 192.31 165.2 185.6 • Implementation of Dijkstra’s Algorithm.
A* 211.08 187.1 203.23
• Implementation of PRM tree construction, and PRM tree
PRM 296.18 244.35 258.91
search algorithms (utilizes Akash’s A* code)
Table IV: Rate of Exploration by Algorithm • Created ROSpy structure, adapted BFS, Dijkstra’s, A*,
and PRM algorithms to work in ROS/RVIZ.
From these graphs, the progression exploration rate is clear - • Created results node to display all relevant metrics and
BFS achieves the quickest exploration rate, followed by PRM, write .csv file of graphical data.
A*, and Dijkstra’s algorithm. • Generated data for algorithm comparison for report (Sec-

VII. C ONCLUSION tion VI)


• Authorship of Sections: IV-A2, IV-B, V-A, IV-C, VI
Simulated BFS, Dijkstra, A* and PRM based on the results • Powerpoint Slides: 5, 7, 8, 9, 13, 14, 15, 16
PRM finds the desired path exploring less number of nodes, • Creation and Editing of ROS/RVIZ Demonstration video.
where as BFS takes largest amount of nodes to reach the goal
node. Based on the Computational Time, BFS out performs R EFERENCES
all the other algorithms as it reaches the goal position in
[1] K. Macek, I. Petrovic and E. Ivanjko, ”An approach to motion planning
less than 1sec in all the three scenario. Out of all the four of indoor mobile robots,” IEEE International Conference on Industrial
algorithms, A* is the most efficient algorithm as it main- Technology, 2003, Maribor, Slovenia, 2003, pp. 969-973 Vol.2, doi:
tains a balance between computational time and numbers of 10.1109/ICIT.2003.1290792.
[2] S. A. Fadzli, S. I. Abdulkadir, M. Makhtar and A. A. Jamal, ”Robotic
node visited. In order to incorporate actual robot dynamics Indoor Path Planning Using Dijkstra’s Algorithm with Multi-Layer
of Turtlebot3 into this discretized planning algorithms, BFS Dictionaries,” 2015 2nd International Conference on Information Sci-
and A* where implemented in Gazebo indoor environment. ence and Security (ICISS), Seoul, Korea (South), 2015, pp. 1-4, doi:
10.1109/ICISSEC.2015.7371031.
Future work could possibly include performance analysis of [3] M. Lin, K. Yuan, C. Shi and Y. Wang, ”Path planning of mobile
RRT* in all the three different scenarios and incorporating robot based on improved A algorithm,” 2017 29th Chinese Control And
continuous planning algorithms like Hybrid A* on Gazebo Decision Conference (CCDC), Chongqing, China, 2017, pp. 3570-3576,
doi: 10.1109/CCDC.2017.7979125.
using Turtlebot3. [4] D. Mokwele, S. Du and J. Benade, ”Comparative Study of Autonomous
Path Planning Methods for Mobile Robot,” 2020 International Confer-
VIII. T IMELINE ence on Artificial Intelligence, Big Data, Computing and Data Commu-
The project timeline is listed in Table V. nication Systems (icABCD), Durban, South Africa, 2020, pp. 1-6, doi:
10.1109/icABCD49160.2020.9183839.
Mar 1 - Mar 14 Literature review, [5] K. Zhao and Y. Li, ”Path planning in large-scale indoor environment
Simulation environment set-up using RRT,” Proceedings of the 32nd Chinese Control Conference,
Mar 15 - Mar 31 Dijkstra’s and A* algorithm Xi’an, China, 2013, pp. 5993-5998.
formulation and simulation [6] J. K. Goyal and K. S. Nagla, ”A new approach of path planning
Apr 1 - Apr 15 RRT and RRT* algorithm for mobile robots,” 2014 International Conference on Advances in
formulation and simulation Computing, Communications and Informatics (ICACCI), Delhi, India,
Apr 16 - Apr 30 Analysis and Comparative study 2014, pp. 863-867, doi: 10.1109/ICACCI.2014.6968200.
May 1 - May 7 Final Report, presentation, [7] Lim Chee Wang, Lim Ser Yong and M. H. Ang, ”Hybrid of global
and video preparation path planning and local navigation implemented on a mobile robot in
indoor environment,” Proceedings of the IEEE Internatinal Symposium
Table V: Project Timeline on Intelligent Control, Vancouver, BC, Canada, 2002, pp. 821-826, doi:
10.1109/ISIC.2002.1157868.
[8] M. Seder, K. Macek and I. Petrovic, ”An integrated approach to
IX. C ONTRIBUTION AND AUTHORSHIP real-time mobile robot control in partially known indoor environ-
ments,” 31st Annual Conference of IEEE Industrial Electronics Soci-
Vrushabh Desai ety, 2005. IECON 2005., Raleigh, NC, USA, 2005, pp. 6 pp.-, doi:
• Created an indoor environment in gazebo and setting up 10.1109/IECON.2005.1569176.
[9] Vemula, Anirudh, Katharina Muelling, and Jean Oh. ”Path planning
a publisher and subscriber in ROS. in dynamic environments with adaptive dimensionality.” Ninth Annual
• Developing a global planner. Symposium on Combinatorial Search. 2016.

Page 7 of 8
[10] ”ROS Tutorials.” ROS.org. http://wiki.ros.org/ROS/Tutorials. [Accessed
22 Mar. 2021].
[11] ”rviz.” ROS.org. http://wiki.ros.org/rviz. [Accessed 22 Mar. 2021].
[12] Liu, Y.F.; Qiu, Y.H. Robot path planning based on genetic algorithms
with two-layer encoding. Control Theory Appl. 2000, 17, 429–432
[13] https://www.roscomponents.com/en/mobile-robots/214-turtlebot-
3.html/courses-no
[14] ”Floor Plan Services.” RoomSketcher. https://www.roomsketcher.com/
floor-plan-services/ (accessed Apr. 26, 2021).
[15] ”Robotis e-Manual: TurtleBot 3 Specifications.” ROBOTIS.
https://emanual.robotis.com/docs/en/platform/turtlebot3/features/
#specifications (accessed Apr. 27, 2021).
[16] ”The Rustica Blog: Standard Door Size — Standard Door Height
and Width.” Rustica. https://rustica.com/standard-door-sizes/#:∼:
text=In%20both%20commercial%20buildings%20and,between%2028%
20and%2032%20inches (Accessed Apr. 27, 2021).

A PPENDIX

Figure 22: ROS and RVIZ Structure

Page 8 of 8

You might also like