Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
aipp::Grid Struct Reference

Rectangular, evenly spaced local map grid. More...

#include <dipla_gp_belief_planner.hpp>

Public Member Functions

 Grid (double xminimum=0.0, double xmaximum=100.0, double yminimum=0.0, double ymaximum=100.0, double spacing=2.0)
 Create a grid and align its effective upper bounds.
int size () const
 Return the number of grid cells.
double x (int column) const
 Convert a column index to its east coordinate.
double y (int row) const
 Convert a row index to its north coordinate.
int nearest_x (double value) const
 Find the nearest clamped column; half-cell ties round downward.
int nearest_y (double value) const
 Find the nearest clamped row; half-cell ties round downward.

Public Attributes

double xmin = 0.0
 Inclusive lower east bound in metres.
double xmax = 100.0
 Inclusive, grid-aligned upper east bound in metres.
double ymin = 0.0
 Inclusive lower north bound in metres.
double ymax = 100.0
 Inclusive, grid-aligned upper north bound in metres.
double step = 2.0
 Uniform spacing in metres.
int width = 0
 Number of columns.
int height = 0
 Number of rows.

Detailed Description

Rectangular, evenly spaced local map grid.

The upper bounds are snapped to the last grid coordinate that fits the requested spacing. Construction rejects grids larger than 2601 cells to bound dense covariance memory on the target board.

Constructor & Destructor Documentation

◆ Grid()

aipp::Grid::Grid ( double xminimum = 0.0,
double xmaximum = 100.0,
double yminimum = 0.0,
double ymaximum = 100.0,
double spacing = 2.0 )

Create a grid and align its effective upper bounds.

Dimensions include only complete spacing intervals; effective upper bounds become the final sampled grid coordinates.

Parameters
xminimumInclusive lower east coordinate.
xmaximumRequested upper east coordinate.
yminimumInclusive lower north coordinate.
ymaximumRequested upper north coordinate.
spacingPositive uniform sample interval.
Exceptions
std::invalid_argumentIf bounds/spacing are invalid or exceed the dense-grid cap.

Validate geometry before converting dimensions to integers or allocating any dense GP matrix. The four-step width check accommodates the planner's two-step inset on both sides; the cell cap limits quadratic storage.

Note
The small tolerance in interval counting avoids losing a final sample to floating-point noise near an exact spacing multiple. Effective upper bounds are then the last lattice coordinates, not unsampled requested edges.
Warning
The cell cap is not a whole-board 512 MB admission check. Enlarging it requires budgeting covariance copies and solver workspaces, not just one matrix.

Member Function Documentation

◆ nearest_x()

int aipp::Grid::nearest_x ( double value) const

Find the nearest clamped column; half-cell ties round downward.

The explicit tie rule avoids dependence on the process rounding mode.

Parameters
valueEast coordinate in metres.
Returns
Valid zero-based column.
Exceptions
std::invalid_argumentFor a nonfinite coordinate.

ceil(offset - 0.5) deliberately sends exact half-cell ties to the lower index, independent of the process rounding mode. This is the research grid rule, not the neural input marker's separate NumPy-style rounding rule.

Exceptions
std::invalid_argumentFor nonfinite coordinates.

◆ nearest_y()

int aipp::Grid::nearest_y ( double value) const

Find the nearest clamped row; half-cell ties round downward.

The explicit tie rule avoids dependence on the process rounding mode.

Parameters
valueNorth coordinate in metres.
Returns
Valid zero-based row.
Exceptions
std::invalid_argumentFor a nonfinite coordinate.

Apply the same lower-index tie rule as nearest_x() so axis changes do not change which cell a half-grid pose selects.

Exceptions
std::invalid_argumentFor nonfinite coordinates.

◆ size()

int aipp::Grid::size ( ) const

Return the number of grid cells.

The grid is stored as a dense row-major domain.

Returns
width * height.

All field vectors and covariance axes share row * width + column ordering.

◆ x()

double aipp::Grid::x ( int column) const

Convert a column index to its east coordinate.

Uses the affine grid mapping xmin + column * step.

Parameters
columnZero-based column.
Returns
East coordinate in metres.

Use the grid's affine mapping everywhere; an array index is not a metre coordinate.

◆ y()

double aipp::Grid::y ( int row) const

Convert a row index to its north coordinate.

Uses the affine grid mapping ymin + row * step.

Parameters
rowZero-based row.
Returns
North coordinate in metres.

North is the row coordinate, consistent with field flattening and sensor indices.

Member Data Documentation

◆ height

int aipp::Grid::height = 0

Number of rows.

◆ step

double aipp::Grid::step = 2.0

Uniform spacing in metres.

◆ width

int aipp::Grid::width = 0

Number of columns.

◆ xmax

double aipp::Grid::xmax = 100.0

Inclusive, grid-aligned upper east bound in metres.

◆ xmin

double aipp::Grid::xmin = 0.0

Inclusive lower east bound in metres.

◆ ymax

double aipp::Grid::ymax = 100.0

Inclusive, grid-aligned upper north bound in metres.

◆ ymin

double aipp::Grid::ymin = 0.0

Inclusive lower north bound in metres.


The documentation for this struct was generated from the following files: