Local GridMap#
#include "navground/sim/state_estimations/grimap_state_estimation.h"
A state estimation that integrates scans and optional odometry in a local grid map.
Uses one of the simplest mapping algorithms, following the implementation of the obstacle layer in nav2 local costmap, see ros-navigation/navigation2.
recenter the map at the agent, setting new cells to 128 (= unknown)
set the footprint of the agent to 255 (= free)
using raycasting, for each lidar ranging measurement, sets the internal cells of the ray to 255 (= free), and the vertex of the ray (if contained in the map) to 0 (= occupied)
Registered properties:
width
(int, get_width)height
(int, get_height)resolution
(float, get_resolution) [meter / cell]include_transformation
(bool, get_include_transformation)external_lidars
(list[str], get_external_lidars)external_odometry
(str, get_external_odometry)footprint
(str, set_footprint)
Public Types
The type of footprint to use.
Values:
a rectangular area
a circular are
no footprint
Public Functions
Constructs a new instance.
- Parameters:
lidars – [in] The lidars sensor
external_lidars – [in] The name of lidars sensor
odometry – [in] The odometry sensor
external_odometry – [in] The name of odometry sensor
width – [in] The map width in pixels
height – [in] The map height in pixels
resolution – [in] The size of a cell in meters
include_transformation – [in] Whether to include the transformation between map and world frames.
footprint – [in] Which type of footprint to use.
name – [in] The name to use as a prefix
Reads a grid map from a core::SensingState.
Calls read_gridmap_with_name, passing Sensor::get_name.
- Parameters:
state – The state
- Returns:
A grid map or null if none was found.
Reads a transformation from a core::SensingState.
Calls read_transform_with_name, passing Sensor::get_name.
- Parameters:
state – The state
- Returns:
A pose or null if none was found.
Sets the size of a cell.
- Parameters:
value – [in] The new value in meters
Gets the size of a cell.
- Returns:
The size in meters.
Sets the width of the gridmap in cells.
- Parameters:
value – [in] The new number of cells.
Gets the width of the gridmap in cells.
- Returns:
The number of cells.
Sets the height of the gridmap in cells.
- Parameters:
value – [in] The new number of cells.
Gets the height of the gridmap in cells.
- Returns:
The number of cells.
Sets the names of the (external) lidars.
- Parameters:
value – [in] The new names.
Gets the names of the (external) lidars.
- Returns:
A vector of names.
Sets the (internal) lidars.
- Parameters:
value – [in] The new lidars.
Gets the (external) lidars.
- Returns:
A vector of lidars.
Sets the names of the (external) odometry.
- Parameters:
value – [in] The new name.
Gets the names of the (external) odometry.
- Returns:
A valid name.
Sets the (internal) odometry.
- Parameters:
value – [in] The new odometry.
Gets the (external) odometry.
- Returns:
An odometry sensor.
Sets whether to include the transformation between map and world frames.
- Parameters:
value – [in] The desired value.
Gets whether to include the transformation between map and world frames.
- Returns:
True if it includes the transformation.
Sets footprint type.
- Parameters:
value – [in] The desired value
Gets the footprint type.
- Returns:
The footprint type
Sets footprint type.
- Parameters:
value – [in] The value: one of “circular”, “rectangular”, “none”
Gets the footprint type: one of “circular”, “rectangular”, “none”.
- Returns:
The footprint type
Public Static Functions
Reads a grid map from a core::SensingState.
- Parameters:
state – The state
name – [in] The namespace of the map
- Returns:
A grid map or null if none was found.
Reads a transformation from a core::SensingState.
- Parameters:
state – The state
name – [in] The namespace of the transformation
- Returns:
A pose or null if none was found.
Public Static Attributes
The default map width in meters
The default map height in meters
The default map resolution in meter per pixel
The name of the buffer set by the sensor