function
Planning.Bezier.septicControlPoints
Construct a degree-seven curve from endpoint derivatives through jerk
The eight endpoint constraints uniquely determine the eight control points. The resulting segment is suitable for position trajectories whose snap must also be evaluated.
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | startDerivative | Real | [:, 4] | Columns are position, velocity, acceleration, and jerk at t=0 |
| input | endDerivative | Real | [size(startDerivative, 1), 4] | Columns are position, velocity, acceleration, and jerk at t=duration |
| input | duration | Real | (unit = "s") | Curve duration |
| output | controlPoint | Real | [size(startDerivative, 1), 8] | Degree-seven Bezier control points |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
function septicControlPoints
"Construct a degree-seven curve from endpoint derivatives through jerk"
input Real startDerivative[:, 4]
"Columns are position, velocity, acceleration, and jerk at t=0";
input Real endDerivative[size(startDerivative, 1), 4]
"Columns are position, velocity, acceleration, and jerk at t=duration";
input Real duration(unit = "s") "Curve duration";
output Real controlPoint[size(startDerivative, 1), 8]
"Degree-seven Bezier control points";
algorithm
assert(duration > 0.0, "Bezier duration must be positive");
controlPoint[:, 1] := startDerivative[:, 1];
controlPoint[:, 2] := controlPoint[:, 1]
+ duration * startDerivative[:, 2] / 7.0;
controlPoint[:, 3] := duration^2 * startDerivative[:, 3] / 42.0
+ 2.0 * controlPoint[:, 2] - controlPoint[:, 1];
controlPoint[:, 4] := duration^3 * startDerivative[:, 4] / 210.0
+ 3.0 * controlPoint[:, 3] - 3.0 * controlPoint[:, 2]
+ controlPoint[:, 1];
controlPoint[:, 8] := endDerivative[:, 1];
controlPoint[:, 7] := controlPoint[:, 8]
- duration * endDerivative[:, 2] / 7.0;
controlPoint[:, 6] := duration^2 * endDerivative[:, 3] / 42.0
+ 2.0 * controlPoint[:, 7] - controlPoint[:, 8];
controlPoint[:, 5] := controlPoint[:, 8] - 3.0 * controlPoint[:, 7]
+ 3.0 * controlPoint[:, 6]
- duration^3 * endDerivative[:, 4] / 210.0;
annotation(Documentation(info="<html>
<p>The eight endpoint constraints uniquely determine the eight control
points. The resulting segment is suitable for position trajectories
whose snap must also be evaluated.</p>
</html>"));
end septicControlPoints;