Map Operations
These functions can be used to find extreme values which lie in a polygon on a GridMap . After comparing the values of each cell in a polygon, the maximum or minimum value is returned. Furthermore, one can look for extreme values and their indices. There are three different implementations available
Find Minimum
-
template<typename Scalar>
Scalar hector_math::findMinimum(const Eigen::Ref<const GridMap<Scalar>> &map, const Polygon<Scalar> &polygon) Finds the minimum value in the map inside the given polygon. This method is robust against NaN values in the map.
- Template Parameters:
Scalar – The floating point type that is used.
- Parameters:
map – The GridMap in which we are looking for the minimum value.
polygon – The region in which we are looking for the minimum map value. Needs to be in map coordinates.
- Returns:
The minimum value or NaN if the entire polygon is outside of the map or the map has no non-NaN value inside the polygon.
Find Maximum
-
template<typename Scalar>
Scalar hector_math::findMaximum(const Eigen::Ref<const GridMap<Scalar>> &map, const Polygon<Scalar> &polygon) Finds the maximum value in the map inside the given polygon. This method is robust against NaN values in the map.
- Template Parameters:
Scalar – The floating point type that is used.
- Parameters:
map – The GridMap in which we are looking for the maximum value.
polygon – The region in which we are looking for the maximum map value. Needs to be in map coordinates.
- Returns:
The maximum value or NaN if the entire polygon is outside of the map or the map has no non-NaN value inside the polygon.
Find Minimum and Index
-
template<typename EigenType>
EigenType::Scalar hector_math::findMinimumAndIndex(const EigenType &map, Eigen::Index &row, Eigen::Index &col) Finds the minimum value in the map and the location in the form of row and col index. This method is robust against NaN values in the map.
- Template Parameters:
Scalar – The floating point type that is used.
- Parameters:
map – The GridMap in which we are looking for the minimum value.
row – The row index of the minimum.
col – The column index of the minimum.
- Returns:
The minimum value inside the map.
Find Maximum and Index
-
template<typename EigenType>
EigenType::Scalar hector_math::findMaximumAndIndex(const EigenType &map, Eigen::Index &row, Eigen::Index &col) Finds the maximum value in the map and the location in the form of row and col index. This method is robust against NaN values in the map.
- Template Parameters:
Scalar – The floating point type that is used.
- Parameters:
map – The GridMap in which we are looking for the maximum value.
row – The row index of the maximum.
col – The column index of the maximum.
- Returns:
The maximum value inside the map.