append
Add states to end of path
Syntax
Description
Examples
Create navPath Based on Multiple Waypoints
Create a navPath object based on multiple waypoints in a Dubins space.
dubinsSpace = stateSpaceDubins([0 25; 0 25; -pi pi])
dubinsSpace = stateSpaceDubins with properties: SE2 Properties Name: 'SE2 Dubins' StateBounds: [3x2 double] NumStateVariables: 3 Dubins Vehicle Properties MinTurningRadius: 1
pathobj = navPath(dubinsSpace)
pathobj = navPath with properties: StateSpace: [1x1 stateSpaceDubins] States: [0x3 double] NumStates: 0
waypoints = [...
8 10 pi/2;
10 12 pi/4;
12 17 pi/2;
11 10 -pi];
append(pathobj, waypoints);
Interpolate that path so that it contains exactly 250 points.
interpolate(pathobj, 250)
Visualize the interpolated path and the original waypoints.
figure; grid on; axis equal; hold on; plot(pathobj.States(:,1), pathobj.States(:,2), ".b"); plot(waypoints(:,1), waypoints(:,2), "*r", "MarkerSize", 10)
Calculate length of path.
len = pathLength(pathobj);
disp("Path length = " + num2str(len))
Path length = 19.37
Input Arguments
path
— path object
navPath
object
Path object, specified as a navPath
object.
Data Types: object
states
— states of path
real-valued M-by-N matrix
States of the path, specified as a real-valued
M-by-N matrix. M is the
number of states appended to the path, and N is the dimension of
each state. The dimension of each state is governed by the state space defined in the
StateSpace
property of navPath
. States
outside of the StateBounds
of the state space of path are pruned to
the bounds.
Example: [ 0 0 0; 1 1 1]
Data Types: double
Version History
See Also
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)