Public Member Functions | Private Attributes | List of all members
base_local_planner::SimpleScoredSamplingPlanner Class Reference

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>

Inheritance diagram for base_local_planner::SimpleScoredSamplingPlanner:
Inheritance graph
[legend]

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 ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~SimpleScoredSamplingPlanner()

base_local_planner::SimpleScoredSamplingPlanner::~SimpleScoredSamplingPlanner ( )
inline

Definition at line 96 of file simple_scored_sampling_planner.h.

◆ SimpleScoredSamplingPlanner() [1/2]

base_local_planner::SimpleScoredSamplingPlanner::SimpleScoredSamplingPlanner ( )
inline

Definition at line 98 of file simple_scored_sampling_planner.h.

◆ SimpleScoredSamplingPlanner() [2/2]

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.

Member Function Documentation

◆ findBestTrajectory()

bool base_local_planner::SimpleScoredSamplingPlanner::findBestTrajectory ( Trajectory traj,
std::vector< Trajectory > *  all_explored = 0 
)
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.

Parameters
trajThe container to write the result to
all_exploredpass 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.

◆ scoreTrajectory()

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.

Member Data Documentation

◆ critics_

std::vector<TrajectoryCostFunction*> base_local_planner::SimpleScoredSamplingPlanner::critics_
private

Definition at line 134 of file simple_scored_sampling_planner.h.

◆ gen_list_

std::vector<TrajectorySampleGenerator*> base_local_planner::SimpleScoredSamplingPlanner::gen_list_
private

Definition at line 133 of file simple_scored_sampling_planner.h.

◆ max_samples_

int base_local_planner::SimpleScoredSamplingPlanner::max_samples_
private

Definition at line 136 of file simple_scored_sampling_planner.h.


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


base_local_planner
Author(s): Eitan Marder-Eppstein, Eric Perko, contradict@gmail.com
autogenerated on Mon Mar 6 2023 03:50:24