function
Estimation.StrapdownINS.ESKF.TickUpdates.ReseedStateTick
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | previous | State | | |
| input | requested | Boolean | | |
| input | anchorSource | Integer | | |
| input | mocap | Avionics.MocapSample | | |
| input | gps | Avionics.GpsSample | | |
| input | variances | Estimation.StrapdownINS.InitialVariances | | |
| output | next | State | | |
| output | reseeded | Boolean | | |
| output | source | Integer | |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
function ReseedStateTick
input State previous;
input Boolean requested;
input Integer anchorSource;
input Avionics.MocapSample mocap;
input Avionics.GpsSample gps;
input Estimation.StrapdownINS.InitialVariances variances;
output State next;
output Boolean reseeded;
output Integer source;
protected
Real position[3]; Real velocity[3];
algorithm
reseeded := requested;
source := if requested then anchorSource else SourceNone;
if requested then
position := if anchorSource == SourceMocap then mocap.positionWorldEnu_m else gps.positionWorldEnu_m;
velocity := if anchorSource == SourceGps and gps.velocityValid then gps.velocityWorldEnu_m_s else previous.velocityWorldEnu_m_s;
next := reseed(previous, position, velocity, variances);
else
next := copyState(previous);
end if;
end ReseedStateTick;