model
Vehicles.Cubs2.Test.Scenarios.Mission
Base classes
Vehicles.Cubs2.ClosedLoopVehicle
Follow base classes for inherited declarations; this page lists explicit declarations only.
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| output | lapCount | Integer | (start = 0, fixed = true) |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
model Mission
extends Vehicles.Cubs2.ClosedLoopVehicle(
initialQuaternion =
{0.38268343236508984, 0.0, 0.0, -0.9238795325112867},
engaged = true,
armed = true,
stickOverrideActive = false,
stickOverride = zeros(4));
discrete output Integer lapCount(start = 0, fixed = true);
protected
discrete Integer previousWaypoint(start = 1, fixed = true);
algorithm
when sample(0.0, 0.02) then
if pre(previousWaypoint) == route.nSegments and currentWaypoint == 1 then
lapCount := pre(lapCount) + 1;
else
lapCount := pre(lapCount);
end if;
previousWaypoint := currentWaypoint;
end when;
end Mission;