How is the acceleration computed in "waypointTrajectory"?

2 Ansichten (letzte 30 Tage)
I am working with the waypointTrajectory:
https://de.mathworks.com/help/nav/ref/waypointtrajectory-system-object.html 
I want to simulate a trajectory for an "autonomous safe stop".
Since I pass in velocities, for example, I get confusing acceleration values that I can't explain.
How is the acceleration calculated in this function?

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 27 Mär. 2023
The important excerpt from the documentaion page is the following (numbering inserted):
[1] The planar path of the trajectory (the x-y plane projection) consists of piecewise, clothoid curves. The curvature of the curve between two consecutive waypoints varies linearly with the curve length between them. The tangent direction of the path at each waypoint is chosen to minimize discontinuities in the curvature, unless the course is specified explicitly via the Course property or implicitly via the Velocities property.  [2] Once the path is established, the object uses cubic Hermite interpolation to compute the location of the vehicle throughout the path as a function of time and the planar distance travelled.
To say this a different way, interpolation in the x-y plane is done in two stages:
1. compute the (planar) path parameterized by curve length.
2. compute the arclength in the plane as a (piecewise-cubic) function of time.
In the second step there are three cases:
1. You specify time-of-arrival and groundspeed (either explicitly via the 'Groundspeed' parameter or by the norm of the x-y component of the 'Velocity' parameter). You can get the distance travelled in the x-y plane as a function of time via a piecewise cubic hermite polynomial. See section 3.3 here: 
https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/moler/interp.pdf 
Since you know the derivatives you can just plug them in, and you get a piecewise cubic polynomial of distance as a function of time.  
2. You only specify time-of-arrival without any velocity information. Then the derivatives (groundspeeds) are computed as in section 3.4 of the aforementioned paper (pchip) using the arclength between each waypoint.
3. You only specify groundspeed but not time-of-arrival. (In MATLAB R2023a and later) That uses the trapezoidal profile specified in the doc:
If the JerkLimit property is specified, the object produces a horizontal trapezoidal acceleration profile for any segment that is between two waypoints. The trapezoidal acceleration profile consists of three subsegments:
A constant-magnitude jerk subsegment
A constant-magnitude acceleration subsegment
A constant-magnitude jerk subsegment   
Note that if you specify an infinite JerkLimit, then you'll get piecewise-constant acceleration paths.
If you specify just time of arrival, you will get a very smooth velocity and acceleration profile. 
If you specify both velocity and time of arrival, then you will get a continuous acceleration profile (but it will be considerably less smooth since the chosen velocities require more acceleration to reach given the distance and time-of-arrival constraints). 
If you have MATLAB R2023a, and you know the groundspeed (but not time-of-arrival), then you can have waypointTrajectory automatically compute it (with an optional jerk limit constraint).

Weitere Antworten (0)

Kategorien

Mehr zu Least Squares finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Produkte


Version

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by