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
-
xminimum Inclusive lower east coordinate. xmaximum Requested upper east coordinate. yminimum Inclusive lower north coordinate. ymaximum Requested upper north coordinate. spacing Positive uniform sample interval.
- Exceptions
-
std::invalid_argument If 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
-
value East coordinate in metres.
- Returns
- Valid zero-based column.
- Exceptions
-
std::invalid_argument For 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_argument For 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
-
value North coordinate in metres.
- Returns
- Valid zero-based row.
- Exceptions
-
std::invalid_argument For 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_argument For nonfinite coordinates.
◆ size()
| int aipp::Grid::size | ( | ) | const |
◆ x()
| double aipp::Grid::x | ( | int | column | ) | const |
◆ y()
| double aipp::Grid::y | ( | int | row | ) | const |
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: