function
Planning.Bezier.evaluateMultirotor
Evaluate position through snap and yaw through angular acceleration
Combines the translational and heading curves into the conventional flat-output derivative set for a quadrotor.
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | positionControlPoint | Real | [3, 8] | Septic control points for world-frame position |
| input | yawControlPoint | Real | [1, 4] | Cubic control points for yaw |
| input | duration | Real | (unit = "s") | Segment duration |
| input | t | Real | (unit = "s") | Time relative to the segment start |
| output | trajectory | Planning.Bezier.MultirotorTrajectory | |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
function evaluateMultirotor
"Evaluate position through snap and yaw through angular acceleration"
input Real positionControlPoint[3, 8]
"Septic control points for world-frame position";
input Real yawControlPoint[1, 4] "Cubic control points for yaw";
input Real duration(unit = "s") "Segment duration";
input Real t(unit = "s") "Time relative to the segment start";
output Planning.Bezier.MultirotorTrajectory trajectory;
protected
Real yawValue[1];
Real yawRateValue[1];
Real yawAccelerationValue[1];
algorithm
trajectory.position := Planning.Bezier.evaluate(
positionControlPoint, duration, t);
trajectory.velocity := Planning.Bezier.evaluateDerivative(
positionControlPoint, duration, t, 1);
trajectory.acceleration := Planning.Bezier.evaluateDerivative(
positionControlPoint, duration, t, 2);
trajectory.jerk := Planning.Bezier.evaluateDerivative(
positionControlPoint, duration, t, 3);
trajectory.snap := Planning.Bezier.evaluateDerivative(
positionControlPoint, duration, t, 4);
yawValue := Planning.Bezier.evaluate(yawControlPoint, duration, t);
yawRateValue := Planning.Bezier.evaluateDerivative(
yawControlPoint, duration, t, 1);
yawAccelerationValue := Planning.Bezier.evaluateDerivative(
yawControlPoint, duration, t, 2);
trajectory.yaw := yawValue[1];
trajectory.yawRate := yawRateValue[1];
trajectory.yawAcceleration := yawAccelerationValue[1];
annotation(Documentation(info="<html>
<p>Combines the translational and heading curves into the conventional
flat-output derivative set for a quadrotor.</p>
</html>"));
end evaluateMultirotor;