breadth-first scoring of all the cells in the costmap More...
#include <map_grid.h>
Classes | |
class | MapGridQueue |
Subclass of CostmapQueue that avoids Obstacles and Unknown Values. More... | |
Public Member Functions | |
void | addCriticVisualization (sensor_msgs::PointCloud &pc) override |
double | getScale () const override |
double | getScore (unsigned int x, unsigned int y) |
Retrieve the score for a particular cell of the costmap. More... | |
MapGridCritic () | |
void | onInit () override |
virtual double | scorePose (const geometry_msgs::Pose2D &pose) |
Retrieve the score for a single pose. More... | |
double | scoreTrajectory (const dwb_msgs::Trajectory2D &traj) override |
void | setAsObstacle (unsigned int x, unsigned int y) |
Sets the score of a particular cell to the obstacle cost. More... | |
Public Member Functions inherited from dwb_local_planner::TrajectoryCritic | |
virtual void | debrief (const nav_2d_msgs::Twist2D &cmd_vel) |
std::string | getName () |
void | initialize (const ros::NodeHandle &planner_nh, std::string name, nav_core2::Costmap::Ptr costmap) |
virtual bool | prepare (const geometry_msgs::Pose2D &pose, const nav_2d_msgs::Twist2D &vel, const geometry_msgs::Pose2D &goal, const nav_2d_msgs::Path2D &global_plan) |
void | setScale (const double scale) |
virtual | ~TrajectoryCritic () |
Protected Types | |
enum | ScoreAggregationType { ScoreAggregationType::Last, ScoreAggregationType::Sum, ScoreAggregationType::Product } |
Separate modes for aggregating scores across the multiple poses in a trajectory. More... | |
Protected Member Functions | |
void | propogateManhattanDistances () |
Go through the queue and set the cells to the Manhattan distance from their parents. More... | |
void | reset () override |
Clear the queue and set cell_values_ to the appropriate number of unreachableCellScore. More... | |
Protected Attributes | |
ScoreAggregationType | aggregationType_ |
nav_grid::VectorNavGrid< double > | cell_values_ |
double | obstacle_score_ |
std::shared_ptr< MapGridQueue > | queue_ |
bool | stop_on_failure_ |
double | unreachable_score_ |
Special cell_values. More... | |
Protected Attributes inherited from dwb_local_planner::TrajectoryCritic | |
nav_core2::Costmap::Ptr | costmap_ |
ros::NodeHandle | critic_nh_ |
std::string | name_ |
ros::NodeHandle | planner_nh_ |
double | scale_ |
Additional Inherited Members | |
Public Types inherited from dwb_local_planner::TrajectoryCritic | |
typedef std::shared_ptr< dwb_local_planner::TrajectoryCritic > | Ptr |
breadth-first scoring of all the cells in the costmap
This TrajectoryCritic assigns a score to every cell in the costmap based on the distance to the cell from some set of source points. The cells corresponding with the source points are marked with some initial score, and then every other cell is updated with a score based on its relation to the closest source cell, based on a breadth-first exploration of the cells of the costmap.
This approach was chosen for computational efficiency, such that each trajectory need not be compared to the list of source points.
Definition at line 58 of file map_grid.h.
|
strongprotected |
Separate modes for aggregating scores across the multiple poses in a trajectory.
Last returns the score associated with the last pose in the trajectory Sum returns the sum of all the scores Product returns the product of all the (non-zero) scores
Enumerator | |
---|---|
Last | |
Sum | |
Product |
Definition at line 100 of file map_grid.h.
|
inline |
Definition at line 61 of file map_grid.h.
|
overridevirtual |
Reimplemented from dwb_local_planner::TrajectoryCritic.
Definition at line 181 of file map_grid.cpp.
|
inlineoverridevirtual |
Reimplemented from dwb_local_planner::TrajectoryCritic.
Reimplemented in dwb_critics::PathAlignCritic.
Definition at line 67 of file map_grid.h.
|
inline |
Retrieve the score for a particular cell of the costmap.
x | x-coordinate within the costmap |
y | y-coordinate within the costmap |
Definition at line 83 of file map_grid.h.
|
overridevirtual |
Reimplemented from dwb_local_planner::TrajectoryCritic.
Reimplemented in dwb_critics::PathAlignCritic.
Definition at line 60 of file map_grid.cpp.
|
protected |
Go through the queue and set the cells to the Manhattan distance from their parents.
Definition at line 110 of file map_grid.cpp.
|
overrideprotectedvirtual |
Clear the queue and set cell_values_ to the appropriate number of unreachableCellScore.
Reimplemented from dwb_local_planner::TrajectoryCritic.
Definition at line 94 of file map_grid.cpp.
|
virtual |
Retrieve the score for a single pose.
pose | The pose to score, assumed to be in the same frame as the costmap |
Reimplemented in dwb_critics::PathAlignCritic, and dwb_critics::GoalAlignCritic.
Definition at line 170 of file map_grid.cpp.
|
overridevirtual |
Implements dwb_local_planner::TrajectoryCritic.
Definition at line 121 of file map_grid.cpp.
void dwb_critics::MapGridCritic::setAsObstacle | ( | unsigned int | x, |
unsigned int | y | ||
) |
Sets the score of a particular cell to the obstacle cost.
x | X coordinate of cell |
y | Y coordinate of cell |
Definition at line 89 of file map_grid.cpp.
|
protected |
Definition at line 130 of file map_grid.h.
|
protected |
Definition at line 127 of file map_grid.h.
|
protected |
Definition at line 128 of file map_grid.h.
|
protected |
Definition at line 126 of file map_grid.h.
|
protected |
Definition at line 129 of file map_grid.h.
|
protected |
Special cell_values.
Definition at line 128 of file map_grid.h.