CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

function

SLAM.Mapping.RGBDSpatialIndex.Cell

Public declarations

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

RoleNameTypeDimensions / attributes / defaultDescription
inputpointReal[3]
inputvoxelWidthReal
outputcellInteger[3]
outputvalidBoolean

Modelica declarations and implementation

Show parameters, interfaces and source

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

function Cell
    input Real point[3];
    input Real voxelWidth;
    output Integer cell[3];
    output Boolean valid;
  algorithm
    cell := fill(0,3);
    valid := voxelWidth >= 0.001 and voxelWidth <= 10.0;
    for axis in 1:3 loop
      valid := valid and abs(point[axis]) <= coordinateLimit;
    end for;
    if valid then
      for axis in 1:3 loop
        cell[axis] := integer(floor(point[axis]/voxelWidth));
      end for;
    end if;
  end Cell;