|
Nav2 Navigation Stack - lyrical
lyrical
ROS 2 Navigation Stack
|
Layer to convolve costmap by robot's radius or footprint using Eigen-based Felzenszwalb-Huttenlocher O(n) distance transform for improved performance. More...
#include <nav2_costmap_2d/include/nav2_costmap_2d/inflation_layer.hpp>


Public Member Functions | |
| InflationLayer () | |
| A constructor. | |
| ~InflationLayer () | |
| A destructor. | |
| void | onInitialize () override |
| Initialization process of layer on startup. | |
| void | deactivate () override |
| Deactivate the layer. | |
| void | activate () override |
| Activate the layer. | |
| void | updateBounds (double robot_x, double robot_y, double robot_yaw, double *min_x, double *min_y, double *max_x, double *max_y) override |
| Update the bounds of the master costmap by this layer's update dimensions. More... | |
| void | updateCosts (nav2_costmap_2d::Costmap2D &master_grid, int min_i, int min_j, int max_i, int max_j) override |
| Update the costs in the master costmap in the window. More... | |
| void | matchSize () override |
| Match the size of the master costmap. | |
| bool | isClearable () override |
| If clearing operations should be processed on this layer or not. | |
| void | reset () override |
| Reset this costmap. | |
| unsigned char | computeCost (double distance) const override |
| Given a distance, compute a cost. More... | |
| mutex_t * | getMutex () override |
| Get the mutex of the inflation information. | |
| double | getCostScalingFactor () override |
| Get the cost scaling factor. More... | |
| double | getInflationRadius () override |
| Get the inflation radius. More... | |
Public Member Functions inherited from nav2_costmap_2d::Layer | |
| Layer () | |
| A constructor. | |
| virtual | ~Layer () |
| A destructor. | |
| void | initialize (LayeredCostmap *parent, std::string name, nav2::TransformBuffer *tf, const nav2::LifecycleNode::WeakPtr &node, rclcpp::CallbackGroup::SharedPtr callback_group) |
| Initialization process of layer on startup. | |
| std::string | getName () const |
| Get the name of the costmap layer. | |
| bool | isCurrent () const |
| Check to make sure all the data in the layer is up to date. If the layer is not up to date, then it may be unsafe to plan using the data from this layer, and the planner may need to know. More... | |
| void | setCurrent (bool current) |
| Set whether the data in the layer is up to date. More... | |
| bool | isEnabled () const |
| Gets whether the layer is enabled. | |
| const std::vector< geometry_msgs::msg::Point > & | getFootprint () const |
| Convenience function for layered_costmap_->getFootprint(). | |
| std::string | getFullName (const std::string ¶m_name) |
| Convenience functions for declaring ROS parameters. | |
| std::string | joinWithParentNamespace (const std::string &topic) |
Protected Member Functions | |
| void | applyInflation (unsigned char *master_array, const MatrixXfRM &distance_map, int min_i, int min_j, int max_i, int max_j, int roi_min_i, int roi_min_j, unsigned int size_x) |
| Apply inflation costs from distance map to costmap. More... | |
| void | onFootprintChanged () override |
| Process updates on footprint changes to the inflation layer. | |
| unsigned int | cellDistance (double world_dist) |
| Convert world distance to cell distance. | |
| void | computeCaches () |
| Generate cost lookup table for distance to cost mapping. | |
| int | getOptimalThreadCount () |
| Determine optimal thread count based on system resources. More... | |
| rcl_interfaces::msg::SetParametersResult | validateParameterUpdatesCallback (const std::vector< rclcpp::Parameter > ¶meters) |
| Validate incoming parameter updates before applying them. This callback is triggered when one or more parameters are about to be updated. It checks the validity of parameter values and rejects updates that would lead to invalid or inconsistent configurations. More... | |
| void | updateParametersCallback (const std::vector< rclcpp::Parameter > ¶meters) |
| Apply parameter updates after validation This callback is executed when parameters have been successfully updated. It updates the internal configuration of the node with the new parameter values. More... | |
| void | updateInscribedRadius () |
| Update inscribed_radius_ from custom_inscribed_radius_ or the footprint, logging a warning when the custom value is in use. | |
Protected Attributes | |
| double | inflation_radius_ |
| double | inscribed_radius_ |
| double | custom_inscribed_radius_ |
| double | cost_scaling_factor_ |
| bool | inflate_unknown_ |
| bool | inflate_around_unknown_ |
| unsigned int | cell_inflation_radius_ |
| int | num_threads_ |
| double | resolution_ |
| std::vector< unsigned char > | cost_lut_ |
| double | last_min_x_ |
| double | last_min_y_ |
| double | last_max_x_ |
| double | last_max_y_ |
| bool | need_reinflation_ |
| mutex_t * | access_ |
| rclcpp::node_interfaces::PostSetParametersCallbackHandle::SharedPtr | post_set_params_handler_ |
| rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr | on_set_params_handler_ |
Protected Attributes inherited from nav2_costmap_2d::Layer | |
| LayeredCostmap * | layered_costmap_ |
| std::string | name_ |
| nav2::TransformBuffer * | tf_ |
| rclcpp::CallbackGroup::SharedPtr | callback_group_ |
| nav2::LifecycleNode::WeakPtr | node_ |
| rclcpp::Clock::SharedPtr | clock_ |
| rclcpp::Logger | logger_ {rclcpp::get_logger("nav2_costmap_2d")} |
| std::atomic_bool | current_ |
| bool | enabled_ |
Static Protected Attributes | |
| static constexpr int | COST_LUT_PRECISION = 100 |
Additional Inherited Members | |
Public Types inherited from nav2_costmap_2d::InflationLayerInterface | |
| typedef std::recursive_mutex | mutex_t |
Static Public Member Functions inherited from nav2_costmap_2d::InflationLayerInterface | |
| static std::shared_ptr< InflationLayerInterface > | getInflationLayer (std::shared_ptr< nav2_costmap_2d::Costmap2DROS > &costmap_ros, const std::string layer_name="") |
| Get the inflation layer from a costmap, checking for both InflationLayer and LegacyInflationLayer implementations. More... | |
Layer to convolve costmap by robot's radius or footprint using Eigen-based Felzenszwalb-Huttenlocher O(n) distance transform for improved performance.
Definition at line 43 of file inflation_layer.hpp.
|
protected |
Apply inflation costs from distance map to costmap.
| master_array | Pointer to the costmap data |
| distance_map | Distance transform result |
| min_i | Minimum x index of update region |
| min_j | Minimum y index of update region |
| max_i | Maximum x index of update region |
| max_j | Maximum y index of update region |
| roi_min_i | ROI minimum x offset |
| roi_min_j | ROI minimum y offset |
| size_x | Width of the costmap |
Definition at line 237 of file inflation_layer.cpp.
References getOptimalThreadCount().
Referenced by updateCosts().


|
inlineoverridevirtual |
Given a distance, compute a cost.
| distance | The distance from an obstacle in cells. |
Implements nav2_costmap_2d::InflationLayerInterface.
Definition at line 121 of file inflation_layer.hpp.
Referenced by computeCaches().

|
inlineoverridevirtual |
Get the cost scaling factor.
Implements nav2_costmap_2d::InflationLayerInterface.
Definition at line 145 of file inflation_layer.hpp.
Referenced by updateParametersCallback().

|
inlineoverridevirtual |
Get the inflation radius.
Implements nav2_costmap_2d::InflationLayerInterface.
Definition at line 150 of file inflation_layer.hpp.
|
protected |
Determine optimal thread count based on system resources.
Definition at line 182 of file inflation_layer.cpp.
Referenced by applyInflation(), and updateCosts().

|
overridevirtual |
Update the bounds of the master costmap by this layer's update dimensions.
| robot_x | X pose of robot |
| robot_y | Y pose of robot |
| robot_yaw | Robot orientation |
| min_x | X min map coord of the window to update |
| min_y | Y min map coord of the window to update |
| max_x | X max map coord of the window to update |
| max_y | Y max map coord of the window to update |
Implements nav2_costmap_2d::Layer.
Definition at line 149 of file inflation_layer.cpp.
References getMutex().

|
overridevirtual |
Update the costs in the master costmap in the window.
| master_grid | The master costmap grid to update |
| min_x | X min map coord of the window to update |
| min_y | Y min map coord of the window to update |
| max_x | X max map coord of the window to update |
| max_y | Y max map coord of the window to update |
Implements nav2_costmap_2d::Layer.
Definition at line 283 of file inflation_layer.cpp.
References applyInflation(), nav2_costmap_2d::DistanceTransform::distanceTransform2D(), nav2_costmap_2d::DistanceTransform::DT_INF, nav2_costmap_2d::Costmap2D::getCharMap(), getMutex(), getOptimalThreadCount(), nav2_costmap_2d::Costmap2D::getSizeInCellsX(), nav2_costmap_2d::Costmap2D::getSizeInCellsY(), and nav2_costmap_2d::Layer::setCurrent().

|
protected |
Apply parameter updates after validation This callback is executed when parameters have been successfully updated. It updates the internal configuration of the node with the new parameter values.
| parameters | List of parameters that have been updated. |
Definition at line 396 of file inflation_layer.cpp.
References getCostScalingFactor(), getMutex(), matchSize(), nav2_costmap_2d::Layer::setCurrent(), and updateInscribedRadius().
Referenced by activate().


|
protected |
Validate incoming parameter updates before applying them. This callback is triggered when one or more parameters are about to be updated. It checks the validity of parameter values and rejects updates that would lead to invalid or inconsistent configurations.
| parameters | List of parameters that are being updated. |
Definition at line 369 of file inflation_layer.cpp.
Referenced by activate().
