Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
Public Member Functions | List of all members
nav2_costmap_2d::LayeredCostmap Class Reference

Instantiates different layer plugins and aggregates them into one score. More...

#include <nav2_costmap_2d/include/nav2_costmap_2d/layered_costmap.hpp>

Public Member Functions

 LayeredCostmap (std::string global_frame, bool rolling_window, bool track_unknown)
 Constructor for a costmap.
 
 ~LayeredCostmap ()
 Destructor.
 
void updateMap (double robot_x, double robot_y, double robot_yaw)
 Update the underlying costmap with new data. If you want to update the map outside of the update loop that runs, you can call this.
 
std::string getGlobalFrameID () const
 
void resizeMap (unsigned int size_x, unsigned int size_y, double resolution, double origin_x, double origin_y, bool size_locked=false)
 Resize the map to a new size, resolution, or origin.
 
void getUpdatedBounds (double &minx, double &miny, double &maxx, double &maxy)
 Get the size of the bounds for update.
 
bool isCurrent ()
 If the costmap is current, e.g. are all the layers processing recent data and not stale information for a good state.
 
Costmap2DgetCostmap ()
 Get the costmap pointer to the master costmap.
 
bool isRolling ()
 If this costmap is rolling or not.
 
bool isTrackingUnknown ()
 If this costmap is tracking unknown space or not.
 
std::vector< std::shared_ptr< Layer > > * getPlugins ()
 Get the vector of pointers to the costmap plugins.
 
std::vector< std::shared_ptr< Layer > > * getFilters ()
 Get the vector of pointers to the costmap filters.
 
void addPlugin (std::shared_ptr< Layer > plugin)
 Add a new plugin to the plugins vector to process.
 
void addFilter (std::shared_ptr< Layer > filter)
 Add a new costmap filter plugin to the filters vector to process.
 
bool isSizeLocked ()
 Get if the size of the costmap is locked.
 
void getBounds (unsigned int *x0, unsigned int *xn, unsigned int *y0, unsigned int *yn)
 Get the bounds of the costmap.
 
bool isInitialized ()
 if the costmap is initialized
 
void setFootprint (const std::vector< geometry_msgs::msg::Point > &footprint_spec)
 Updates the stored footprint, updates the circumscribed and inscribed radii, and calls onFootprintChanged() in all layers.
 
const std::vector< geometry_msgs::msg::Point > & getFootprint ()
 Returns the latest footprint stored with setFootprint().
 
double getCircumscribedRadius ()
 The radius of a circle centered at the origin of the robot which just surrounds all points on the robot's footprint. More...
 
double getInscribedRadius ()
 The radius of a circle centered at the origin of the robot which is just within all points and edges of the robot's footprint. More...
 
bool isOutofBounds (double robot_x, double robot_y)
 Checks if the robot is outside the bounds of its costmap in the case of poorly configured setups.
 

Detailed Description

Instantiates different layer plugins and aggregates them into one score.

Definition at line 57 of file layered_costmap.hpp.

Member Function Documentation

◆ getCircumscribedRadius()

double nav2_costmap_2d::LayeredCostmap::getCircumscribedRadius ( )
inline

The radius of a circle centered at the origin of the robot which just surrounds all points on the robot's footprint.

This is updated by setFootprint().

Definition at line 201 of file layered_costmap.hpp.

◆ getInscribedRadius()

double nav2_costmap_2d::LayeredCostmap::getInscribedRadius ( )
inline

The radius of a circle centered at the origin of the robot which is just within all points and edges of the robot's footprint.

This is updated by setFootprint().

Definition at line 208 of file layered_costmap.hpp.

Referenced by nav2_costmap_2d::InflationLayer::onFootprintChanged().

Here is the caller graph for this function:

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