CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

function

SLAM.Mapping.RGBDMapAnchorUncertainty.ValidBinding

Public declarations

Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.

RoleNameTypeDimensions / attributes / defaultDescription
inputbBinding
outputvalidBoolean

Modelica declarations and implementation

Show parameters, interfaces and source

Parameters, inputs, outputs, defaults and equations from the source file.

function ValidBinding
    input Binding b; output Boolean valid;
  algorithm
    valid := b.generation > 0 and b.sourceRevision > 0 and b.landmarkSlot >= 1 and b.landmarkSlot <= landmarkCapacity
      and b.anchorId > 0 and b.anchorId <= identifierLimit and b.anchorSlot >= 1 and b.anchorSlot <= anchorCapacity
      and b.anchorEpoch >= 0 and b.anchorPoseRevision >= 0 and b.rawObservationEpoch >= b.anchorEpoch
      and b.rawObservationProvenance > 0 and b.localBoundProvenance > 0 and b.anchorBoundProvenance > 0
      and b.anchorTime >= 0 and b.observationTime <= 1e12
      and (if b.rawObservationEpoch == b.anchorEpoch then b.observationTime == b.anchorTime
        else b.observationTime > b.anchorTime);
    if valid then
      // Certify domains before subtraction/modulo. Slot reuse never preserves
      // a stable anchor identity, even when the caller repeats bad metadata.
      valid := b.anchorSlot == mod(b.anchorId-1,anchorCapacity)+1;
    end if;
  end ValidBinding;