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.

Data Fields

double xmin = 0.0
double xmax = 100.0
double ymin = 0.0
double ymax = 100.0
double step = 2.0
int width = 0
int height = 0

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.

Definition at line 57 of file dipla_gp_belief_planner.hpp.

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.

Definition at line 173 of file dipla_gp_belief_planner.cpp.

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.

Definition at line 203 of file dipla_gp_belief_planner.cpp.

◆ 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.

Definition at line 215 of file dipla_gp_belief_planner.cpp.

◆ 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.

Definition at line 192 of file dipla_gp_belief_planner.cpp.

◆ 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.

Definition at line 194 of file dipla_gp_belief_planner.cpp.

◆ 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.

Definition at line 196 of file dipla_gp_belief_planner.cpp.

Field Documentation

◆ height

int aipp::Grid::height = 0

Number of rows.

Definition at line 71 of file dipla_gp_belief_planner.hpp.

◆ step

double aipp::Grid::step = 2.0

Uniform spacing in metres.

Definition at line 67 of file dipla_gp_belief_planner.hpp.

◆ width

int aipp::Grid::width = 0

Number of columns.

Definition at line 69 of file dipla_gp_belief_planner.hpp.

◆ xmax

double aipp::Grid::xmax = 100.0

Inclusive, grid-aligned upper east bound in metres.

Definition at line 61 of file dipla_gp_belief_planner.hpp.

◆ xmin

double aipp::Grid::xmin = 0.0

Inclusive lower east bound in metres.

Definition at line 59 of file dipla_gp_belief_planner.hpp.

◆ ymax

double aipp::Grid::ymax = 100.0

Inclusive, grid-aligned upper north bound in metres.

Definition at line 65 of file dipla_gp_belief_planner.hpp.

◆ ymin

double aipp::Grid::ymin = 0.0

Inclusive lower north bound in metres.

Definition at line 63 of file dipla_gp_belief_planner.hpp.


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