Help CenterHelp Center
Interpolate path based on propagator step size
Since R2021b
interpolate(pathObj)
example
interpolate(pathObj) evaluates the path based on the ControlStepSize property of pathObj, and adds all intermediate points to the path.
pathObj
ControlStepSize
collapse all
Create a navPath object based on multiple waypoints in a Dubins space.
navPath
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 MaxNumStates: Inf
waypoints = [8 10 pi/2; 7 14 pi/4; 10 17 pi/2; 10 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.4722
navControlPath
Control path, specified as a navPathControl object.
navPathControl
Data Types: double
double
Introduced in R2021b
mobileRobotPropagator
append
pathDuration
您曾对此示例进行过修改。是否要打开带有您的编辑的示例?
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office