function
SLAM.PoseGraph.RGBDGraphSelectedGauge.ContextFromLedger
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | previous | Context | | |
| input | ledger | RGBDGraphCaptureLedger.State | | |
| input | catalog | RGBDKeyframes.Catalog | | |
| input | graph | RGBDGraphMeasurements.State | | |
| input | sourceRevision | Integer | | |
| input | step | Integer | | |
| input | catalogPoseRevision | Integer | | |
| input | requested | Boolean | = true | |
| output | context | Context | | |
| output | accepted | Boolean | | |
| output | reason | Integer | |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
function ContextFromLedger
input Context previous;
input RGBDGraphCaptureLedger.State ledger;
input RGBDKeyframes.Catalog catalog;
input RGBDGraphMeasurements.State graph;
input Integer sourceRevision; input Integer step; input Integer catalogPoseRevision;
input Boolean requested = true;
output Context context; output Boolean accepted; output Integer reason;
protected Boolean valid;
algorithm
context := previous; accepted := false; reason := 1;
if requested then
reason := 2;
valid := RGBDGraphCaptureLedger.Valid(ledger,catalog,sourceRevision,step);
if valid then
reason := 3;
valid := graph.generation == catalog.generation
and graph.revision > 0 and graph.revision <= identifierLimit
and catalogPoseRevision >= 0 and catalogPoseRevision < identifierLimit;
end if;
if valid then
context.generation := catalog.generation; context.sourceRevision := sourceRevision;
context.graphRevision := graph.revision; context.catalogPoseRevision := catalogPoseRevision;
context.captureIds := ledger.ids; context.captureSequences := ledger.sequences;
accepted := true; reason := 0;
end if;
end if;
end ContextFromLedger;