Loading...
Searching...
No Matches
ATRRT.cpp
50 Planner::declareParam<double>("range", this, &ATRRT::setRange, &ATRRT::getRange, "0.:1.:10000.");
51 Planner::declareParam<double>("goal_bias", this, &ATRRT::setGoalBias, &ATRRT::getGoalBias, "0.:.05:1.");
60 Planner::declareParam<double>("temp_change_factor", this, &ATRRT::setTempChangeFactor, &ATRRT::getTempChangeFactor,
62 Planner::declareParam<double>("init_temperature", this, &ATRRT::setInitTemperature, &ATRRT::getInitTemperature);
67 Planner::declareParam<double>("cost_threshold", this, &ATRRT::setCostThreshold, &ATRRT::getCostThreshold);
99 OMPL_INFORM("%s: No optimization objective specified. Defaulting to mechanical work minimization.",
125 nearestNeighbors_->setDistanceFunction([this](const Motion *a, const Motion *b) { return distanceFunction(a, b); });
148ompl::base::PlannerStatus ompl::geometric::ATRRT::solve(const base::PlannerTerminationCondition &ptc)
169 // Input States ---------------------------------------------------------------------------------
210 // Solver variables ------------------------------------------------------------------------------------
222 gamma_ = 2.5 * 2 * std::pow((1.0 + 1.0 / d), 1.0 / d) * std::pow(volumeFreeSpace / volumeUnitBall2D, 1.0 / d);
239 // Begin sampling --------------------------------------------------------------------------------------
269 // Computes the state that lies at time t in [0, 1] on the segment that connects *from* state to *to* state.
270 // The memory location of *state* is not required to be different from the memory of either *from* or *to*.
271 si_->getStateSpace()->interpolate(nearMotion->state, randState, maxDistance_ / randMotionDistance,
284 // this stage integrates collision detections in the presence of obstacles and checks for collisions
289 // A possible side effect may appear when the tree expansion toward unexplored regions remains slow, and the
311 if (opt_->isCostBetterThan(motion->cost, bestCost_)) // motion->cost is better than the existing best
313 if (opt_->isCostBetterThan(worstCost_, motion->cost)) // motion->cost is worse than the existing worst
340 // Finish solution processing --------------------------------------------------------------------
489std::vector<ompl::geometric::ATRRT::Motion *> ompl::geometric::ATRRT::computeDijkstraLowestCostPath(Motion *a,
492 std::priority_queue<std::pair<Motion *, base::Cost>, std::vector<std::pair<Motion *, base::Cost>>,
514 if (costMap.find(neighbor) == costMap.end() || opt_->isCostBetterThan(newCost, costMap[neighbor]))
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition Cost.h:48
Abstract definition of a goal region that can be sampled.
Definition GoalSampleableRegion.h:48
virtual bool isSatisfied(const State *st) const =0
Return true if the state satisfies the goal constraints.
Base class for a vertex in the PlannerData structure. All derived classes must implement the clone an...
Definition PlannerData.h:59
Object containing planner generated vertex and edge data. It is assumed that all vertices are unique,...
Definition PlannerData.h:175
unsigned int addStartVertex(const PlannerDataVertex &v)
Adds the given vertex to the graph data, and marks it as a start vertex. The vertex index is returned...
Definition PlannerData.cpp:405
unsigned int addGoalVertex(const PlannerDataVertex &v)
Adds the given vertex to the graph data, and marks it as a start vertex. The vertex index is returned...
Definition PlannerData.cpp:414
virtual bool addEdge(unsigned int v1, unsigned int v2, const PlannerDataEdge &edge=PlannerDataEdge(), Cost weight=Cost(1.0))
Adds a directed edge between the given vertex indexes. An optional edge structure and weight can be s...
Definition PlannerData.cpp:424
Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whe...
Definition PlannerTerminationCondition.h:64
virtual void checkValidity()
Check to see if the planner is in a working state (setup has been called, a goal was set,...
Definition Planner.cpp:106
std::vector< Motion * > neighbors
The connected motions in the exploration graph.
Definition ATRRT.h:243
double frontierThreshold_
The distance between an old state and a new state that qualifies it as a frontier state.
Definition ATRRT.h:353
double getCostThreshold() const
Get the cost threshold (default is infinity). Any motion cost that is not better than this cost (acco...
Definition ATRRT.h:162
base::Cost worstCost_
The least desirable (e.g., maximum) cost value in the search tree.
Definition ATRRT.h:322
double getFrontierNodeRatio() const
Get the ratio between adding nonfrontier nodes to frontier nodes, for example .1 is 1/10 or one nonfr...
Definition ATRRT.h:204
double getInitTemperature() const
Get the temperature at the start of planning.
Definition ATRRT.h:176
double distanceFunction(const Motion *a, const Motion *b) const
Compute distance between motions (actually distance between contained states).
Definition ATRRT.h:253
ompl::base::OptimizationObjectivePtr opt_
The optimization objective being optimized by ATRRT.
Definition ATRRT.h:335
Motion * lastGoalMotion_
The most recent goal motion. Used for PlannerData computation.
Definition ATRRT.h:295
ompl::base::Cost computeCostLowestCostPath(Motion *a, Motion *b)
Compute cost of lowest-cost path found by Dijkstra.
Definition ATRRT.cpp:531
double goalBias_
The fraction of time the goal is picked as the state to expand towards (if such a state is available)...
Definition ATRRT.h:286
void setInitTemperature(double initTemperature)
Set the initial temperature at the beginning of the algorithm. Should be high to allow for initial ex...
Definition ATRRT.h:169
bool transitionTest(const base::Cost &motionCost)
Filter irrelevant configuration regarding the search of low-cost paths before inserting into tree.
Definition ATRRT.cpp:401
bool minExpansionControl(double randMotionDistance)
Use ratio to prefer frontier nodes to nonfrontier ones.
Definition ATRRT.cpp:428
double getFrontierThreshold() const
Get the distance between a new state and the nearest neighbor that qualifies that state as being a fr...
Definition ATRRT.h:190
double temp_
Temperature parameter used to control the difficulty level of transition tests. Low temperatures limi...
Definition ATRRT.h:316
double neighborhoodRadiusFactor_
Factor of maxDistance_ used to calculate neighborhood radius TODO: temporary solution.
Definition ATRRT.h:344
base::Cost bestCost_
The most desirable (e.g., minimum) cost value in the search tree.
Definition ATRRT.h:319
void getPlannerData(base::PlannerData &data) const override
Get information about the current run of the motion planner. Repeated calls to this function will upd...
Definition ATRRT.cpp:380
void setFrontierThreshold(double frontier_threshold)
Set the distance between a new state and the nearest neighbor that qualifies that state as being a fr...
Definition ATRRT.h:183
void clear() override
Clear all internal datastructures. Planner settings are not affected. Subsequent calls to solve() wil...
Definition ATRRT.cpp:75
base::Cost costThreshold_
All motion costs must be better than this cost (default is infinity).
Definition ATRRT.h:325
base::PlannerStatus solve(const base::PlannerTerminationCondition &plannerTerminationCondition) override
Function that can solve the motion planning problem. This function can be called multiple times on th...
Definition ATRRT.cpp:148
double getTempChangeFactor() const
Get the factor by which the temperature rises based on current acceptance/rejection rate.
Definition ATRRT.h:146
double frontierNodeRatio_
Target ratio of non-frontier nodes to frontier nodes. rho.
Definition ATRRT.h:355
void setFrontierNodeRatio(double frontierNodeRatio)
Set the ratio between adding nonfrontier nodes to frontier nodes, for example .1 is 1/10 or one nonfr...
Definition ATRRT.h:197
double tempChangeFactor_
The value of the expression exp^T_rate. The temperature is increased by this factor whenever the tran...
Definition ATRRT.h:329
void setup() override
Perform extra configuration steps, if needed. This call will also issue a call to ompl::base::SpaceIn...
Definition ATRRT.cpp:92
std::vector< ompl::geometric::ATRRT::Motion * > computeDijkstraLowestCostPath(Motion *a, Motion *b)
Compute lowest-cost path in graph between two motions.
Definition ATRRT.cpp:489
void setCostThreshold(double maxCost)
Set the cost threshold (default is infinity). Any motion cost that is not better than this cost (acco...
Definition ATRRT.h:154
std::shared_ptr< NearestNeighbors< Motion * > > nearestNeighbors_
A nearest-neighbors datastructure containing the tree of motions.
Definition ATRRT.h:282
void addUsefulCycles(Motion *newMotion, Motion *nearMotion)
improve solution found by TRRT
Definition ATRRT.cpp:451
void addEdge(Motion *a, Motion *b)
Add bidirectional edge between two motions.
Definition ATRRT.cpp:483
void setTempChangeFactor(double factor)
Set the factor by which the temperature is increased after a failed transition test....
Definition ATRRT.h:140
This class contains methods that automatically configure various parameters for motion planning....
Definition SelfConfig.h:59
static NearestNeighbors< _T > * getDefaultNearestNeighbors(const base::Planner *planner)
Select a default nearest neighbor datastructure for the given space.
Definition SelfConfig.h:105
void configurePlannerRange(double &range)
Compute what a good length for motion segments is.
Definition SelfConfig.cpp:225
This namespace contains sampling based planning routines shared by both planning under geometric cons...
Definition ConstrainedSpaceInformation.h:55
static const double COST_MAX_MOTION_LENGTH_AS_SPACE_EXTENT_FRACTION
For cost-based planners it has been observed that smaller ranges are typically suitable....
Definition MagicConstants.h:79
A class to store the exit status of Planner::solve().
Definition PlannerStatus.h:49
@ UNRECOGNIZED_GOAL_TYPE
The goal is of a type that a planner does not recognize.
Definition PlannerStatus.h:60
bool stating which motion cost is better
Definition ATRRT.h:299