function
SLAM.Mapping.RGBDSpatialIndex.Cell
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | point | Real | [3] | |
| input | voxelWidth | Real | | |
| output | cell | Integer | [3] | |
| output | valid | Boolean | |
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;