Robot-Path-planning-AStar

Robot path planning using A* algorithm

扫地机器人自动寻路实现(使用A*算法)

地图实例(Sample map of room):
*#_*
_*__
_#_@

It shows that in a room with 3 rows and 4 columns where * reprensents dirty cell, # represens obstacles, _ represents for empty cell and @ is the location of the cleaning robot.
该地图表示为在3×4的房间内,星号(*)代表脏东西的格子,井号(#)代表障碍物格子,下划线(_)代表空格子,@代表机器人所在位置。

程序输入实例(The example input for the sample map)
Please Enter Row Number:
4
Please Enter Colomn Number:
4
Please Enter the Elements in row 1:
@#*_
Please Enter the Elements in row 2:
_#_*
Please Enter the Elements in row 3:
_*_#
Please Enter the Elements in row 4:
_#__

输出结果(output):
S
S
E
C
E
N
E
C
N
W
C

53

字母表示机器人走的路径。N表示向上,S表示向下,W表示向左,E表示向右。数字表示算法遍历过的节点数量。
The letters (N, S, W and E) represents the direction of each step the robot walked. The number represens the number of nodes which have been traversed.