function
SLAM.Simulation.landmarkGrid
Fixed planar landmarks with stable row-major identities
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | rows | Integer | (min=1) | |
| input | columns | Integer | (min=1) | |
| input | spacing_m | Real | (min=0.0) | |
| input | centerWorld_m | Real | [3] = zeros(3) | |
| output | landmarksWorld_m | Real | [rows * columns, 3] |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
function landmarkGrid "Fixed planar landmarks with stable row-major identities"
input Integer rows(min=1);
input Integer columns(min=1);
input Real spacing_m(min=0.0);
input Real centerWorld_m[3] = zeros(3);
output Real landmarksWorld_m[rows * columns, 3];
protected
Integer row;
Integer column;
algorithm
row := 1;
column := 1;
for landmark in 1:rows * columns loop
landmarksWorld_m[landmark, :] := centerWorld_m
+ {(column - 0.5 * (columns + 1)) * spacing_m,
(row - 0.5 * (rows + 1)) * spacing_m, 0.0};
column := column + 1;
if column > columns then
column := 1;
row := row + 1;
end if;
end for;
end landmarkGrid;