1
Watch
1
Star
1
Fork
0
Issue

Robot path planning using breadth-first-search algorithm

tjfy1992
tjfy1992
pushedAt 4 years ago

tjfy1992/Robot-Path-planning-BFS

Robot-Path-planning-BFS

Robot path planning using breadth-first-search algorithm

扫地机器人自动寻路实现(使用广度优先搜索算法)

地图实例(Sample map of room):
*#_*
_*__
_#[email protected]

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:
3
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:
_#[email protected]

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

56

字母表示机器人走的路径。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.

ucloud ads