Generates a local plan using the given generator and cost functions. Assumes less cost are best, and negative costs indicate infinite costs. More...
#include <simple_scored_sampling_planner.h>
Public Member Functions | |
bool | findBestTrajectory (Trajectory &traj, std::vector< Trajectory > *all_explored=0) |
double | scoreTrajectory (Trajectory &traj, double best_traj_cost) |
SimpleScoredSamplingPlanner () | |
SimpleScoredSamplingPlanner (std::vector< TrajectorySampleGenerator * > gen_list, std::vector< TrajectoryCostFunction * > &critics, int max_samples=-1) | |
~SimpleScoredSamplingPlanner () | |
Public Member Functions inherited from base_local_planner::TrajectorySearch | |
virtual | ~TrajectorySearch () |
Private Attributes | |
std::vector< TrajectoryCostFunction * > | critics_ |
std::vector< TrajectorySampleGenerator * > | gen_list_ |
int | max_samples_ |
Additional Inherited Members | |
Protected Member Functions inherited from base_local_planner::TrajectorySearch | |
TrajectorySearch () | |
Generates a local plan using the given generator and cost functions. Assumes less cost are best, and negative costs indicate infinite costs.
This is supposed to be a simple and robust implementation of the TrajectorySearch interface. More efficient search may well be possible using search heuristics, parallel search, etc.
Definition at line 93 of file simple_scored_sampling_planner.h.
|
inline |
Definition at line 96 of file simple_scored_sampling_planner.h.
|
inline |
Definition at line 98 of file simple_scored_sampling_planner.h.
base_local_planner::SimpleScoredSamplingPlanner::SimpleScoredSamplingPlanner | ( | std::vector< TrajectorySampleGenerator * > | gen_list, |
std::vector< TrajectoryCostFunction * > & | critics, | ||
int | max_samples = -1 |
||
) |
Takes a list of generators and critics. Critics return costs > 0, or negative costs for invalid trajectories. Generators other than the first are fallback generators, meaning they only get to generate if the previous generator did not find a valid trajectory. Will use every generator until it stops returning trajectories or count reaches max_samples. Then resets count and tries for the next in the list. passing max_samples = -1 (default): Each Sampling planner will continue to call generator until generator runs out of samples (or forever if that never happens)
Definition at line 79 of file simple_scored_sampling_planner.cpp.
|
virtual |
Calls generator until generator has no more samples or max_samples is reached. For each generated traj, calls critics in turn. If any critic returns negative value, that value is assumed as costs, else the costs are the sum of all critics result. Returns true and sets the traj parameter to the first trajectory with minimal non-negative costs if sampling yields trajectories with non-negative costs, else returns false.
traj | The container to write the result to |
all_explored | pass NULL or a container to collect all trajectories for debugging (has a penalty) |
Implements base_local_planner::TrajectorySearch.
Definition at line 116 of file simple_scored_sampling_planner.cpp.
double base_local_planner::SimpleScoredSamplingPlanner::scoreTrajectory | ( | Trajectory & | traj, |
double | best_traj_cost | ||
) |
runs all scoring functions over the trajectory creating a weigthed sum of positive costs, aborting as soon as a negative cost are found or costs greater than positive best_traj_cost accumulated
Definition at line 85 of file simple_scored_sampling_planner.cpp.
|
private |
Definition at line 134 of file simple_scored_sampling_planner.h.
|
private |
Definition at line 133 of file simple_scored_sampling_planner.h.
|
private |
Definition at line 136 of file simple_scored_sampling_planner.h.