Go to the documentation of this file.
15 #ifndef BELUGA_SENSOR_DATA_SPARSE_VALUE_GRID_HPP
16 #define BELUGA_SENSOR_DATA_SPARSE_VALUE_GRID_HPP
20 #include <type_traits>
45 template <
typename MapType,
int NDim>
71 [[nodiscard]] std::size_t
size()
const {
return data_.size(); }
78 const auto itr =
data_.find(cell_index);
79 if (itr ==
data_.end()) {
96 template <
typename MapType>
100 template <
typename MapType>
std::optional< mapped_type > data_at(const Eigen::Vector< int, NDim > &cell_index) const
Gets grid data at cell_index or std::nullopt if it's not present.
std::size_t size() const
Gets grid size (ie. number of grid cells).
const map_type & data() const
Gets grid data.
typename map_type::key_type key_type
Key type for the key-value pairs.
MapType map_type
Underlying associative container.
Eigen::Vector< int, NDim > cell_near(const Eigen::Vector< double, NDim > &p) const
Compute nearest grid cell coordinates given plane coordinates.
std::optional< mapped_type > data_near(const Eigen::Vector< double, NDim > &coordinates) const
Gets grid data at real coordinates 'coordinates' or std::nullopt if it's not present.
Regularly spaced N dimensional grid base type.
SparseValueGrid()=default
Construct without data and with a 1 cell/meter resolution.
Generic N dimensional sparse value regular grid.
SparseValueGrid(map_type data, double resolution=1.)
Constructs the grid.
double resolution() const
Gets grid resolution.
Eigen::Matrix< Scalar, Dims, 1 > Vector
Type alias for single-column matrices, available starting Eigen 3.4.
Concepts and abstract implementations of regular grids.
typename map_type::mapped_type mapped_type
Value type of the key-value pairs stored in the data.
The main Beluga namespace.
beluga
Author(s):
autogenerated on Tue Jul 16 2024 02:59:53