创建概率路线图路径计划者
ThemobileRobotPRM
对象是环境图的路径图路径计划对象Map
property. The object uses the map to generate a roadmap, which is a network graph of possible paths in the map based on free and occupied spaces. You can customize the number of nodes,NumNodes
, and the connection distance,连接限制
,为了适应地图的复杂性,并找到从启动到最终位置的无障碍路径。
定义地图后,mobileRobotPRM
path planner generates the specified number of nodes throughout the free spaces in the map. A connection between nodes is made when a line between two nodes contains no obstacles and is within the specified connection distance.
After defining a start and end location, to find an obstacle-free path using this network of connections, use thefindpath
方法。如果findpath
does not find a connected path, it returns an empty array. By increasing the number of nodes or the connection distance, you can improve the likelihood of finding a connected path, but tuning these properties is necessary. To see the roadmap and the generated path, use the visualization options inshow
. If you change any of themobileRobotPRM
properties, callupdate
,show
, orfindpath
to recreate the roadmap.
creates an empty roadmap with default properties. Before you can use the roadmap, you must specify aplanner
= mobileRobotPRMbinaryOccupancyMap
对象Map
property.
creates a roadmap withplanner
= mobileRobotPRM(map
)map
设置为Map
财产,哪里map
is abinaryOccupancyMap
目的。
sets the maximum number of nodes,planner
= mobileRobotPRM(map
,numnodes
)numnodes
, to theNumNodes
property.
binaryOccupancyMap
|控制器Pursuit
|occupancyMap
(Navigation Toolbox)