plan

Plan path between two states

Description

path = plan(planner,startState,goalState) returns a path from the start state to the goal state.

[path,solutionInfo] = plan(planner,startState,goalState) also returns solInfo that contains the solution information of the path planning.

Input Arguments

collapse all

Path planner, specified as a plannerRRT object or a plannerRRTStar object.

Data Types: object

Start state of the path, specified as an N-element real-valued vector. N is the dimension of the state space.

Example: [1 1 pi/6]

Data Types: single | double

Goal state of the path, specified as an N-element real-valued vector. N is the dimension of the state space.

Example: [2 2 pi/3]

Data Types: single | double

Output Arguments

collapse all

An object that holds the planned path information, returned as a navPath object.

Data Types: object

Solution Information, returned as a structure. The fields of the structure are:

Fields of solutionInfo

FieldsDescription
IsPathFoundIndicates whether a path is found. It returns as 1 if a path is found. Otherwise, it returns 0.
ExistFlag

Indicates the terminate status of the planner, returned as

  • 1 — if the goal is reached

  • 2 — if the maximum number of iterations is reached

  • 3 — if the maximum number of nodes is reached

NumNodesNumber of nodes in the search tree when the planner terminates (excluding the root node).
NumIterationsNumber of "extend" routines executed.
TreeDataA collection of explored states that reflects the status of the search tree when planner terminates. Note that NaN values are inserted as delimiters to separate each individual edge.

Data Types: structure

Introduced in R2019b