connect
Syntax
Description
[
connects the start and goal poses using the specified pathSegments
,pathCosts
] = connect(connectionObj
,start
,goal
)dubinsConnection
object. The path segment object with the lowest cost is returned.
[
returns all possible path segments as a cell array with their associated costs.pathSegments
,pathCosts
] = connect(connectionObj
,start
,goal
,'PathSegments','all')
Examples
Connect Poses Using Dubins Connection Path
Create a dubinsConnection
object.
dubConnObj = dubinsConnection;
Define start and goal poses as [x y theta]
vectors.
startPose = [0 0 0]; goalPose = [1 1 pi];
Calculate a valid path segment to connect the poses.
[pathSegObj, pathCosts] = connect(dubConnObj,startPose,goalPose);
Show the generated path.
show(pathSegObj{1})
Connect Poses Using ReedsShepp Connection Path
Create a reedsSheppConnection
object.
reedsConnObj = reedsSheppConnection;
Define start and goal poses as [x y theta]
vectors.
startPose = [0 0 0]; goalPose = [1 1 pi];
Calculate a valid path segment to connect the poses.
[pathSegObj,pathCosts] = connect(reedsConnObj,startPose,goalPose);
Show the generated path.
show(pathSegObj{1})
Input Arguments
connectionObj
— Path connection type
dubinsPathSegment
object | reedsSheppPathSegment
object
Path connection type, specified as a dubinsConnection
or reedsSheppConnection
object. This object defines the parameters of the
connection, including the minimum turning radius of the robot and the valid motion
types.
start
— Initial pose of robot
[x, y, Θ] vector or
matrix
This property is read-only.
Initial pose of the robot at the start of the path segment, specified as an [x, y, Θ] vector or matrix. Each row of the matrix corresponds to a different start pose.
x and y are in meters. Θ is in radians.
The connect
function supports:
Singular start pose with singular goal pose.
Multiple start pose with singular goal pose.
Singular start pose with multiple goal pose.
Multiple start pose with multiple goal pose.
The output pathSegments
cell array size reflects the
singular or multiple pose options.
goal
— Goal pose of robot
[x, y, Θ] vector or
matrix
This property is read-only.
Goal pose of the robot at the end of the path segment, specified as an [x, y, Θ] vector or matrix. Each row of the matrix corresponds to a different goal pose.
x and y are in meters. Θ is in radians.
The connect
function supports:
Singular start pose with singular goal pose.
Multiple start pose with singular goal pose.
Singular start pose with multiple goal pose.
Multiple start pose with multiple goal pose.
The output pathSegments
cell array size reflects the
singular or multiple pose options.
Output Arguments
pathSegments
— Path segments
cell array of objects
Path segments, specified as a cell array of objects. The type of object depends on
the input connectionObj
. The size of the cell array depends on
whether you use singular or multiple start
and
goal
poses. By default, the function returns the path with the
lowest cost for each start
and goal
pose. When
call connect
using the 'PathSegments','all'
name-value pair, the cell array contains all valid path segments between the specified
start
and goal
poses.
pathCosts
— Cost of path segment
positive numeric scalar | positive numeric vector | positive numeric matrix
Cost of path segments, specified as a positive numeric scalar, vector, or matrix.
Each element of the cost vector or matrix corresponds to a path segment in
pathSegment
. By default, the function returns the path with the
lowest cost for each start and goal pose.
Example: [7.6484,7.5122]
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2019b
See Also
Functions
Objects
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)