EasyNav Plugins
Loading...
Searching...
No Matches
InflationFilter Class Reference

#include <InflationFilter.hpp>

Inheritance diagram for InflationFilter:
Collaboration diagram for InflationFilter:

Classes

struct  StaticGeomSignature

Public Member Functions

unsigned char computeCost (double distance) const
 Given a distance, compute a cost.
double getCostScalingFactor ()
double getInflationRadius ()
 InflationFilter ()
void matchSize (easynav::Costmap2D &costmap)
 Match the size of the master costmap.
virtual void on_initialize ()
virtual void update (NavState &nav_state)
void updateBounds (double robot_x, double robot_y, double robot_yaw, double *min_x, double *min_y, double *max_x, double *max_y)
 Update the bounds of the master costmap by this layer's update dimensions.
void updateCosts (easynav::Costmap2D &master_grid, int min_i, int min_j, int max_i, int max_j)
 Update the costs in the master costmap in the window.
Public Member Functions inherited from CostmapFilter
 CostmapFilter ()
const std::string & get_plugin_name () const
void initialize (const std::shared_ptr< rclcpp_lifecycle::LifecycleNode > parent_node, const std::string &plugin_name)

Protected Member Functions

unsigned int cellDistance (easynav::Costmap2D &costmap, double world_dist)
 Compute cached dsitances.
void computeCaches ()
 Compute cached dsitances.
unsigned char costLookup (unsigned int mx, unsigned int my, unsigned int src_x, unsigned int src_y)
 Lookup pre-computed costs.
double distanceLookup (unsigned int mx, unsigned int my, unsigned int src_x, unsigned int src_y)
 Lookup pre-computed distances.
void enqueue (unsigned int index, unsigned int mx, unsigned int my, unsigned int src_x, unsigned int src_y)
 Given an index of a cell in the costmap, place it into a list pending for obstacle inflation.
int generateIntegerDistances ()
 Compute cached dsitances.
bool needs_recompute_static_ (const Costmap2D &static_map) const
void recompute_static_inflation_ (const Costmap2D &static_map)
Protected Member Functions inherited from CostmapFilter
std::shared_ptr< rclcpp_lifecycle::LifecycleNode > get_node () const

Protected Attributes

unsigned int cache_length_
unsigned int cached_cell_inflation_radius_
std::vector< unsigned char > cached_costs_
std::vector< double > cached_distances_
unsigned int cell_inflation_radius_
double cost_scaling_factor_
std::vector< std::vector< int > > distance_matrix_
bool has_static_inflated_ {false}
bool inflate_around_unknown_
bool inflate_unknown_
std::vector< std::vector< CellData > > inflation_cells_
double inflation_radius_
double inscribed_radius_
double last_max_x_
double last_max_y_
double last_min_x_
double last_min_y_
bool matchedSize_ {false}
bool need_reinflation_
double resolution_
std::vector< bool > seen_
Costmap2D static_inflated_
struct easynav::InflationFilter::StaticGeomSignature static_sig_
Protected Attributes inherited from CostmapFilter
std::shared_ptr< rclcpp_lifecycle::LifecycleNode > parent_node_ {nullptr}
std::string plugin_name_

Constructor & Destructor Documentation

◆ InflationFilter()

InflationFilter ( )

Member Function Documentation

◆ cellDistance()

unsigned int cellDistance ( easynav::Costmap2D & costmap,
double world_dist )
protected

Compute cached dsitances.

◆ computeCaches()

void computeCaches ( )
protected

Compute cached dsitances.

◆ computeCost()

unsigned char computeCost ( double distance) const

Given a distance, compute a cost.

Parameters
distanceThe distance from an obstacle in cells
Returns
A cost value for the distance

◆ costLookup()

unsigned char costLookup ( unsigned int mx,
unsigned int my,
unsigned int src_x,
unsigned int src_y )
protected

Lookup pre-computed costs.

Parameters
mxThe x coordinate of the current cell
myThe y coordinate of the current cell
src_xThe x coordinate of the source cell
src_yThe y coordinate of the source cell
Returns

◆ distanceLookup()

double distanceLookup ( unsigned int mx,
unsigned int my,
unsigned int src_x,
unsigned int src_y )
protected

Lookup pre-computed distances.

Parameters
mxThe x coordinate of the current cell
myThe y coordinate of the current cell
src_xThe x coordinate of the source cell
src_yThe y coordinate of the source cell
Returns

◆ enqueue()

void enqueue ( unsigned int index,
unsigned int mx,
unsigned int my,
unsigned int src_x,
unsigned int src_y )
protected

Given an index of a cell in the costmap, place it into a list pending for obstacle inflation.

Parameters
gridThe costmap
indexThe index of the cell
mxThe x coordinate of the cell (can be computed from the index, but saves time to store it)
myThe y coordinate of the cell (can be computed from the index, but saves time to store it)
src_xThe x index of the obstacle point inflation started at
src_yThe y index of the obstacle point inflation started at

◆ generateIntegerDistances()

int generateIntegerDistances ( )
protected

Compute cached dsitances.

◆ getCostScalingFactor()

double getCostScalingFactor ( )

◆ getInflationRadius()

double getInflationRadius ( )

◆ matchSize()

void matchSize ( easynav::Costmap2D & costmap)

Match the size of the master costmap.

◆ needs_recompute_static_()

bool needs_recompute_static_ ( const Costmap2D & static_map) const
protected

◆ on_initialize()

void on_initialize ( )
virtual

Implements CostmapFilter.

◆ recompute_static_inflation_()

void recompute_static_inflation_ ( const Costmap2D & static_map)
protected

◆ update()

void update ( NavState & nav_state)
virtual

Implements CostmapFilter.

◆ updateBounds()

void updateBounds ( double robot_x,
double robot_y,
double robot_yaw,
double * min_x,
double * min_y,
double * max_x,
double * max_y )

Update the bounds of the master costmap by this layer's update dimensions.

Parameters
robot_xX pose of robot
robot_yY pose of robot
robot_yawRobot orientation
min_xX min map coord of the window to update
min_yY min map coord of the window to update
max_xX max map coord of the window to update
max_yY max map coord of the window to update

◆ updateCosts()

void updateCosts ( easynav::Costmap2D & master_grid,
int min_i,
int min_j,
int max_i,
int max_j )

Update the costs in the master costmap in the window.

Parameters
master_gridThe master costmap grid to update
min_xX min map coord of the window to update
min_yY min map coord of the window to update
max_xX max map coord of the window to update
max_yY max map coord of the window to update

Member Data Documentation

◆ cache_length_

unsigned int cache_length_
protected

◆ cached_cell_inflation_radius_

unsigned int cached_cell_inflation_radius_
protected

◆ cached_costs_

std::vector<unsigned char> cached_costs_
protected

◆ cached_distances_

std::vector<double> cached_distances_
protected

◆ cell_inflation_radius_

unsigned int cell_inflation_radius_
protected

◆ cost_scaling_factor_

double cost_scaling_factor_
protected

◆ distance_matrix_

std::vector<std::vector<int> > distance_matrix_
protected

◆ has_static_inflated_

bool has_static_inflated_ {false}
protected

◆ inflate_around_unknown_

bool inflate_around_unknown_
protected

◆ inflate_unknown_

bool inflate_unknown_
protected

◆ inflation_cells_

std::vector<std::vector<CellData> > inflation_cells_
protected

◆ inflation_radius_

double inflation_radius_
protected

◆ inscribed_radius_

double inscribed_radius_
protected

◆ last_max_x_

double last_max_x_
protected

◆ last_max_y_

double last_max_y_
protected

◆ last_min_x_

double last_min_x_
protected

◆ last_min_y_

double last_min_y_
protected

◆ matchedSize_

bool matchedSize_ {false}
protected

◆ need_reinflation_

bool need_reinflation_
protected

◆ resolution_

double resolution_
protected

◆ seen_

std::vector<bool> seen_
protected

◆ static_inflated_

Costmap2D static_inflated_
protected

◆ static_sig_

struct easynav::InflationFilter::StaticGeomSignature static_sig_
protected

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