#include <map_grid_cost_function.h>
Public Member Functions | |
double | getCellCosts (unsigned int cx, unsigned int cy) |
MapGridCostFunction (costmap_2d::Costmap2D *costmap, double xshift=0.0, double yshift=0.0, bool is_local_goal_function=false, CostAggregationType aggregationType=Last) | |
double | obstacleCosts () |
bool | prepare () |
double | scoreTrajectory (Trajectory &traj) |
void | setStopOnFailure (bool stop_on_failure) |
If true, failures along the path cause the entire path to be rejected. More... | |
void | setTargetPoses (std::vector< geometry_msgs::PoseStamped > target_poses) |
void | setXShift (double xshift) |
void | setYShift (double yshift) |
double | unreachableCellCosts () |
~MapGridCostFunction () | |
Public Member Functions inherited from base_local_planner::TrajectoryCostFunction | |
double | getScale () |
void | setScale (double scale) |
virtual | ~TrajectoryCostFunction () |
Private Attributes | |
CostAggregationType | aggregationType_ |
costmap_2d::Costmap2D * | costmap_ |
bool | is_local_goal_function_ |
base_local_planner::MapGrid | map_ |
bool | stop_on_failure_ |
std::vector< geometry_msgs::PoseStamped > | target_poses_ |
double | xshift_ |
xshift and yshift allow scoring for different More... | |
double | yshift_ |
Additional Inherited Members | |
Protected Member Functions inherited from base_local_planner::TrajectoryCostFunction | |
TrajectoryCostFunction (double scale=1.0) | |
This class provides cost based on a map_grid of a small area of the world. The map_grid covers a the costmap, the costmap containing the information about sensed obstacles. The map_grid is used by setting certain cells to distance 0, and then propagating distances around them, filling up the area reachable around them.
The approach using grid_maps is used for computational efficiency, allowing to score hundreds of trajectories very quickly.
This can be used to favor trajectories which stay on a given path, or which approach a given goal.
costmap_ros | Reference to object giving updates of obstacles around robot |
xshift | where the scoring point is with respect to robot center pose |
yshift | where the scoring point is with respect to robot center pose |
is_local_goal_function,scores | for local goal rather than whole path |
aggregationType | how to combine costs along trajectory |
Definition at line 108 of file map_grid_cost_function.h.
base_local_planner::MapGridCostFunction::MapGridCostFunction | ( | costmap_2d::Costmap2D * | costmap, |
double | xshift = 0.0 , |
||
double | yshift = 0.0 , |
||
bool | is_local_goal_function = false , |
||
CostAggregationType | aggregationType = Last |
||
) |
Definition at line 77 of file map_grid_cost_function.cpp.
|
inline |
Definition at line 116 of file map_grid_cost_function.h.
double base_local_planner::MapGridCostFunction::getCellCosts | ( | unsigned int | cx, |
unsigned int | cy | ||
) |
Definition at line 105 of file map_grid_cost_function.cpp.
|
inline |
return a value that indicates cell is in obstacle
Definition at line 141 of file map_grid_cost_function.h.
|
virtual |
propagate distances
Implements base_local_planner::TrajectoryCostFunction.
Definition at line 94 of file map_grid_cost_function.cpp.
|
virtual |
return a score for trajectory traj
Implements base_local_planner::TrajectoryCostFunction.
Definition at line 110 of file map_grid_cost_function.cpp.
|
inline |
If true, failures along the path cause the entire path to be rejected.
Default is true.
Definition at line 129 of file map_grid_cost_function.h.
void base_local_planner::MapGridCostFunction::setTargetPoses | ( | std::vector< geometry_msgs::PoseStamped > | target_poses | ) |
set line segments on the grid with distance 0, resets the grid
Definition at line 90 of file map_grid_cost_function.cpp.
|
inline |
Definition at line 123 of file map_grid_cost_function.h.
|
inline |
Definition at line 124 of file map_grid_cost_function.h.
|
inline |
returns a value indicating cell was not reached by wavefront propagation of set cells. (is behind walls, regarding the region covered by grid)
Definition at line 149 of file map_grid_cost_function.h.
|
private |
Definition at line 161 of file map_grid_cost_function.h.
|
private |
Definition at line 158 of file map_grid_cost_function.h.
|
private |
Definition at line 169 of file map_grid_cost_function.h.
|
private |
Definition at line 160 of file map_grid_cost_function.h.
|
private |
Definition at line 170 of file map_grid_cost_function.h.
|
private |
Definition at line 157 of file map_grid_cost_function.h.
|
private |
xshift and yshift allow scoring for different
Definition at line 166 of file map_grid_cost_function.h.
|
private |
Definition at line 167 of file map_grid_cost_function.h.