All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
RRTstar.cpp
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2011, Rice University
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of the Rice University nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34 
35 /* Authors: Alejandro Perez, Sertac Karaman, Ryan Luna, Luis G. Torres, Ioan Sucan */
36 
37 #include "ompl/geometric/planners/rrt/RRTstar.h"
38 #include "ompl/base/goals/GoalSampleableRegion.h"
39 #include "ompl/tools/config/SelfConfig.h"
40 #include "ompl/base/objectives/PathLengthOptimizationObjective.h"
41 #include <algorithm>
42 #include <limits>
43 #include <map>
44 #include <boost/math/constants/constants.hpp>
45 
46 ompl::geometric::RRTstar::RRTstar(const base::SpaceInformationPtr &si) : base::Planner(si, "RRTstar")
47 {
49  specs_.optimizingPaths = true;
50 
51  goalBias_ = 0.05;
52  maxDistance_ = 0.0;
53  delayCC_ = true;
54  lastGoalMotion_ = NULL;
55 
56  iterations_ = 0;
57  collisionChecks_ = 0;
58  bestCost_ = base::Cost(std::numeric_limits<double>::quiet_NaN());
59  distanceDirection_ = FROM_NEIGHBORS;
60 
61  Planner::declareParam<double>("range", this, &RRTstar::setRange, &RRTstar::getRange, "0.:1.:10000.");
62  Planner::declareParam<double>("goal_bias", this, &RRTstar::setGoalBias, &RRTstar::getGoalBias, "0.:.05:1.");
63  Planner::declareParam<bool>("delay_collision_checking", this, &RRTstar::setDelayCC, &RRTstar::getDelayCC, "0,1");
64 
65  addPlannerProgressProperty("iterations INTEGER",
66  boost::bind(&RRTstar::getIterationCount, this));
67  addPlannerProgressProperty("collision checks INTEGER",
68  boost::bind(&RRTstar::getCollisionCheckCount, this));
69  addPlannerProgressProperty("best cost REAL",
70  boost::bind(&RRTstar::getBestCost, this));
71 }
72 
73 ompl::geometric::RRTstar::~RRTstar(void)
74 {
75  freeMemory();
76 }
77 
79 {
80  Planner::setup();
81  tools::SelfConfig sc(si_, getName());
82  sc.configurePlannerRange(maxDistance_);
83 
84  if (!nn_)
85  nn_.reset(tools::SelfConfig::getDefaultNearestNeighbors<Motion*>(si_->getStateSpace()));
86  nn_->setDistanceFunction(boost::bind(&RRTstar::distanceFunction, this, _1, _2));
87 
88 
89  // Setup optimization objective
90  //
91  // If no optimization objective was specified, then default to
92  // optimizing path length as computed by the distance() function
93  // in the state space.
94  if (pdef_->hasOptimizationObjective())
95  opt_ = pdef_->getOptimizationObjective();
96  else
97  {
98  OMPL_INFORM("%s: No optimization objective specified. Defaulting to optimizing path length for the allowed planning time.", getName().c_str());
99  opt_.reset(new base::PathLengthOptimizationObjective(si_));
100  }
101 }
102 
104 {
105  Planner::clear();
106  sampler_.reset();
107  freeMemory();
108  if (nn_)
109  nn_->clear();
110 
111  lastGoalMotion_ = NULL;
112  goalMotions_.clear();
113 
114  iterations_ = 0;
115  collisionChecks_ = 0;
116  bestCost_ = base::Cost(std::numeric_limits<double>::quiet_NaN());
117 
118 }
119 
121 {
122  checkValidity();
123  base::Goal *goal = pdef_->getGoal().get();
124  base::GoalSampleableRegion *goal_s = dynamic_cast<base::GoalSampleableRegion*>(goal);
125 
126  bool symDist = si_->getStateSpace()->hasSymmetricDistance();
127  bool symInterp = si_->getStateSpace()->hasSymmetricInterpolate();
128  bool symCost = opt_->isSymmetric();
129 
130  while (const base::State *st = pis_.nextStart())
131  {
132  Motion *motion = new Motion(si_);
133  si_->copyState(motion->state, st);
134  motion->cost = opt_->identityCost();
135  nn_->add(motion);
136  }
137 
138  if (nn_->size() == 0)
139  {
140  OMPL_ERROR("%s: There are no valid initial states!", getName().c_str());
142  }
143 
144  if (!sampler_)
145  sampler_ = si_->allocStateSampler();
146 
147  OMPL_INFORM("%s: Starting with %u states", getName().c_str(), nn_->size());
148 
149  Motion *solution = lastGoalMotion_;
150 
151  // \TODO Make this variable unnecessary, or at least have it
152  // persist across solve runs
153  base::Cost bestCost = opt_->infiniteCost();
154 
155  Motion *approximation = NULL;
156  double approximatedist = std::numeric_limits<double>::infinity();
157  bool sufficientlyShort = false;
158 
159  Motion *rmotion = new Motion(si_);
160  base::State *rstate = rmotion->state;
161  base::State *xstate = si_->allocState();
162 
163  // e+e/d. K-nearest RRT*
164  double k_rrg = boost::math::constants::e<double>() + (boost::math::constants::e<double>()/(double)si_->getStateSpace()->getDimension());
165 
166  std::vector<Motion*> nbh;
167 
168  std::vector<base::Cost> costs;
169  std::vector<base::Cost> incCosts;
170  std::vector<std::size_t> sortedCostIndices;
171 
172  std::vector<int> valid;
173  unsigned int rewireTest = 0;
174  unsigned int statesGenerated = 0;
175 
176  if (solution)
177  OMPL_INFORM("%s: Starting with existing solution of cost %.5f", getName().c_str(), solution->cost.v);
178  OMPL_INFORM("%s: Initial k-nearest value of %u", getName().c_str(), (unsigned int)std::ceil(k_rrg * log((double)(nn_->size()+1))));
179 
180 
181  // our functor for sorting nearest neighbors
182  CostIndexCompare compareFn(costs, *opt_);
183 
184  while (ptc == false)
185  {
186  iterations_++;
187  // sample random state (with goal biasing)
188  // Goal samples are only sampled until maxSampleCount() goals are in the tree, to prohibit duplicate goal states.
189  if (goal_s && goalMotions_.size() < goal_s->maxSampleCount() && rng_.uniform01() < goalBias_ && goal_s->canSample())
190  goal_s->sampleGoal(rstate);
191  else
192  sampler_->sampleUniform(rstate);
193 
194  // Set directionality of nearest neighbors computation to be
195  // FROM neighbors TO new state
196  if (!symDist)
197  distanceDirection_ = FROM_NEIGHBORS;
198 
199  // find closest state in the tree
200  Motion *nmotion = nn_->nearest(rmotion);
201 
202  base::State *dstate = rstate;
203 
204  // find state to add to the tree
205  double d = si_->distance(nmotion->state, rstate);
206  if (d > maxDistance_)
207  {
208  si_->getStateSpace()->interpolate(nmotion->state, rstate, maxDistance_ / d, xstate);
209  dstate = xstate;
210  }
211 
212  // Check if the motion between the nearest state and the state to add is valid
213  ++collisionChecks_;
214  if (si_->checkMotion(nmotion->state, dstate))
215  {
216  // create a motion
217  Motion *motion = new Motion(si_);
218  si_->copyState(motion->state, dstate);
219  motion->parent = nmotion;
220  motion->incCost = opt_->motionCost(nmotion->state, motion->state);
221  motion->cost = opt_->combineCosts(nmotion->cost, motion->incCost);
222 
223  // Find nearby neighbors of the new motion - k-nearest RRT*
224  unsigned int k = std::ceil(k_rrg * log((double)(nn_->size()+1)));
225  nn_->nearestK(motion, k, nbh);
226 
227  rewireTest += nbh.size();
228  statesGenerated++;
229 
230  // cache for distance computations
231  //
232  // Our cost caches only increase in size, so they're only
233  // resized if they can't fit the current neighborhood
234  if (costs.size() < nbh.size())
235  {
236  costs.resize(nbh.size());
237  incCosts.resize(nbh.size());
238  sortedCostIndices.resize(nbh.size());
239  }
240 
241  // cache for motion validity (only useful in a symmetric space)
242  //
243  // Our validity caches only increase in size, so they're
244  // only resized if they can't fit the current neighborhood
245  if (symDist && symInterp)
246  {
247  if (valid.size() < nbh.size())
248  valid.resize(nbh.size());
249  std::fill(valid.begin(), valid.begin()+nbh.size(), 0);
250  }
251 
252  // Finding the nearest neighbor to connect to
253  // By default, neighborhood states are sorted by cost, and collision checking
254  // is performed in increasing order of cost
255  if (delayCC_)
256  {
257  // calculate all costs and distances
258  for (std::size_t i = 0 ; i < nbh.size(); ++i)
259  {
260  incCosts[i] = opt_->motionCost(nbh[i]->state, motion->state);
261  costs[i] = opt_->combineCosts(nbh[i]->cost, incCosts[i]);
262  }
263 
264  // sort the nodes
265  //
266  // we're using index-value pairs so that we can get at
267  // original, unsorted indices
268  for (std::size_t i = 0; i < nbh.size(); ++i)
269  sortedCostIndices[i] = i;
270  std::sort(sortedCostIndices.begin(), sortedCostIndices.begin()+nbh.size(),
271  compareFn);
272 
273  // collision check until a valid motion is found
274  //
275  // ASYMMETRIC CASE: it's possible that none of these
276  // neighbors are valid. This is fine, because motion
277  // already has a connection to the tree through
278  // nmotion (with populated cost fields!).
279  for (std::vector<std::size_t>::const_iterator i = sortedCostIndices.begin();
280  i != sortedCostIndices.begin()+nbh.size();
281  ++i)
282  {
283  if (nbh[*i] != nmotion)
284  ++collisionChecks_;
285  if (nbh[*i] == nmotion || si_->checkMotion(nbh[*i]->state, motion->state))
286  {
287  motion->incCost = incCosts[*i];
288  motion->cost = costs[*i];
289  motion->parent = nbh[*i];
290  if (symDist && symInterp)
291  valid[*i] = 1;
292  break;
293  }
294  else if (symDist && symInterp)
295  valid[*i] = -1;
296  }
297  }
298  else // if not delayCC
299  {
300  motion->incCost = opt_->motionCost(nmotion->state, motion->state);
301  motion->cost = opt_->combineCosts(nmotion->cost, motion->incCost);
302  // find which one we connect the new state to
303  for (std::size_t i = 0 ; i < nbh.size(); ++i)
304  {
305  if (nbh[i] != nmotion)
306  {
307  incCosts[i] = opt_->motionCost(nbh[i]->state, motion->state);
308  costs[i] = opt_->combineCosts(nbh[i]->cost, incCosts[i]);
309  if (opt_->isCostBetterThan(costs[i], motion->cost))
310  {
311  ++collisionChecks_;
312  if (si_->checkMotion(nbh[i]->state, motion->state))
313  {
314  motion->incCost = incCosts[i];
315  motion->cost = costs[i];
316  motion->parent = nbh[i];
317  if (symDist && symInterp)
318  valid[i] = 1;
319  }
320  else if (symDist && symInterp)
321  valid[i] = -1;
322  }
323  }
324  else
325  {
326  incCosts[i] = motion->incCost;
327  costs[i] = motion->cost;
328  if (symDist && symInterp)
329  valid[i] = 1;
330  }
331  }
332  }
333 
334  // add motion to the tree
335  nn_->add(motion);
336  motion->parent->children.push_back(motion);
337 
338  bool checkForSolution = false;
339  // rewire tree if needed
340  //
341  // Set directionality of distance function to be FROM new
342  // state TO neighbors, since this is how the routing
343  // should occur in tree rewiring
344  if (!symDist)
345  {
346  distanceDirection_ = TO_NEIGHBORS;
347  nn_->nearestK(motion, k, nbh);
348  rewireTest += nbh.size();
349  }
350 
351  for (std::size_t i = 0; i < nbh.size(); ++i)
352  {
353  if (nbh[i] != motion->parent)
354  {
355  base::Cost nbhIncCost;
356  if (symDist && symCost)
357  nbhIncCost = incCosts[i];
358  else
359  nbhIncCost = opt_->motionCost(motion->state, nbh[i]->state);
360  base::Cost nbhNewCost = opt_->combineCosts(motion->cost, nbhIncCost);
361  if (opt_->isCostBetterThan(nbhNewCost, nbh[i]->cost))
362  {
363  bool motionValid;
364  if (symDist && symInterp)
365  {
366  if (valid[i] == 0)
367  {
368  ++collisionChecks_;
369  motionValid = si_->checkMotion(motion->state, nbh[i]->state);
370  }
371  else
372  motionValid = (valid[i] == 1);
373 
374  }
375  else
376  {
377  ++collisionChecks_;
378  motionValid = si_->checkMotion(motion->state, nbh[i]->state);
379  }
380  if (motionValid)
381  {
382  // Remove this node from its parent list
383  removeFromParent (nbh[i]);
384 
385  // Add this node to the new parent
386  nbh[i]->parent = motion;
387  nbh[i]->incCost = nbhIncCost;
388  nbh[i]->cost = nbhNewCost;
389  nbh[i]->parent->children.push_back(nbh[i]);
390 
391  // Update the costs of the node's children
392  updateChildCosts(nbh[i]);
393 
394  checkForSolution = true;
395  }
396  }
397  }
398  }
399 
400  // Add the new motion to the goalMotion_ list, if it satisfies the goal
401  double distanceFromGoal;
402  if (goal->isSatisfied(motion->state, &distanceFromGoal))
403  {
404  goalMotions_.push_back(motion);
405  checkForSolution = true;
406  }
407 
408  // Checking for solution or iterative improvement
409  if (checkForSolution)
410  {
411  for (size_t i = 0; i < goalMotions_.size(); ++i)
412  {
413  if (opt_->isCostBetterThan(goalMotions_[i]->cost, bestCost))
414  {
415  bestCost = goalMotions_[i]->cost;
416  bestCost_ = bestCost;
417  }
418 
419  sufficientlyShort = opt_->isSatisfied(goalMotions_[i]->cost);
420  if (sufficientlyShort)
421  {
422  solution = goalMotions_[i];
423  break;
424  }
425  else if (!solution ||
426  opt_->isCostBetterThan(goalMotions_[i]->cost,solution->cost))
427  solution = goalMotions_[i];
428  }
429  }
430 
431  // Checking for approximate solution (closest state found to the goal)
432  if (goalMotions_.size() == 0 && distanceFromGoal < approximatedist)
433  {
434  approximation = motion;
435  approximatedist = distanceFromGoal;
436  }
437  }
438 
439  // terminate if a sufficient solution is found
440  if (solution && sufficientlyShort)
441  break;
442  }
443 
444  bool approximate = (solution == 0);
445  bool addedSolution = false;
446  if (approximate)
447  solution = approximation;
448  else
449  lastGoalMotion_ = solution;
450 
451  if (solution != 0)
452  {
453  // construct the solution path
454  std::vector<Motion*> mpath;
455  while (solution != 0)
456  {
457  mpath.push_back(solution);
458  solution = solution->parent;
459  }
460 
461  // set the solution path
462  PathGeometric *geoPath = new PathGeometric(si_);
463  for (int i = mpath.size() - 1 ; i >= 0 ; --i)
464  geoPath->append(mpath[i]->state);
465 
466  base::PathPtr path(geoPath);
467  // Add the solution path, whether it is approximate (not reaching the goal), and the
468  // distance from the end of the path to the goal (-1 if satisfying the goal).
469  base::PlannerSolution psol(path, approximate, approximate ? approximatedist : -1.0);
470  // Does the solution satisfy the optimization objective?
471  psol.optimized_ = sufficientlyShort;
472 
473  pdef_->addSolutionPath (psol);
474 
475  addedSolution = true;
476  }
477 
478  si_->freeState(xstate);
479  if (rmotion->state)
480  si_->freeState(rmotion->state);
481  delete rmotion;
482 
483  OMPL_INFORM("%s: Created %u new states. Checked %u rewire options. %u goal states in tree.", getName().c_str(), statesGenerated, rewireTest, goalMotions_.size());
484 
485  return base::PlannerStatus(addedSolution, approximate);
486 }
487 
489 {
490  std::vector<Motion*>::iterator it = m->parent->children.begin ();
491  while (it != m->parent->children.end ())
492  {
493  if (*it == m)
494  {
495  it = m->parent->children.erase(it);
496  it = m->parent->children.end ();
497  }
498  else
499  ++it;
500  }
501 }
502 
504 {
505  for (std::size_t i = 0; i < m->children.size(); ++i)
506  {
507  m->children[i]->cost = opt_->combineCosts(m->cost, m->children[i]->incCost);
508  updateChildCosts(m->children[i]);
509  }
510 }
511 
513 {
514  if (nn_)
515  {
516  std::vector<Motion*> motions;
517  nn_->list(motions);
518  for (std::size_t i = 0 ; i < motions.size() ; ++i)
519  {
520  if (motions[i]->state)
521  si_->freeState(motions[i]->state);
522  delete motions[i];
523  }
524  }
525 }
526 
528 {
529  Planner::getPlannerData(data);
530 
531  std::vector<Motion*> motions;
532  if (nn_)
533  nn_->list(motions);
534 
535  if (lastGoalMotion_)
536  data.addGoalVertex(base::PlannerDataVertex(lastGoalMotion_->state));
537 
538  for (std::size_t i = 0 ; i < motions.size() ; ++i)
539  {
540  if (motions[i]->parent == NULL)
541  data.addStartVertex(base::PlannerDataVertex(motions[i]->state));
542  else
543  data.addEdge(base::PlannerDataVertex(motions[i]->parent->state),
544  base::PlannerDataVertex(motions[i]->state));
545  }
546  data.properties["iterations INTEGER"] = boost::lexical_cast<std::string>(iterations_);
547  data.properties["collision_checks INTEGER"] =
548  boost::lexical_cast<std::string>(collisionChecks_);
549 }
550 
551 std::string ompl::geometric::RRTstar::getIterationCount(void) const
552 {
553  return boost::lexical_cast<std::string>(iterations_);
554 }
555 std::string ompl::geometric::RRTstar::getCollisionCheckCount(void) const
556 {
557  return boost::lexical_cast<std::string>(collisionChecks_);
558 }
559 std::string ompl::geometric::RRTstar::getBestCost(void) const
560 {
561  return boost::lexical_cast<std::string>(bestCost_.v);
562 }
bool approximateSolutions
Flag indicating whether the planner is able to compute approximate solutions.
Definition: Planner.h:212
void addPlannerProgressProperty(const std::string &progressPropertyName, const PlannerProgressProperty &prop)
Add a planner progress property called progressPropertyName with a property querying function prop to...
Definition: Planner.h:386
bool canSample(void) const
Return true if maxSampleCount() > 0, since in this case samples can certainly be produced.
bool getDelayCC(void) const
Get the state of the delayed collision checking option.
Definition: RRTstar.h:145
Object containing planner generated vertex and edge data. It is assumed that all vertices are unique...
Definition: PlannerData.h:164
void log(const char *file, int line, LogLevel level, const char *m,...)
Root level logging function. This should not be invoked directly, but rather used via a logging macro...
Definition: Console.cpp:104
void setDelayCC(bool delayCC)
Option that delays collision checking procedures. When it is enabled, all neighbors are sorted by cos...
Definition: RRTstar.h:139
bool optimized_
True of the solution was optimized to meet the specified optimization criterion.
Representation of a solution to a planning problem.
void updateChildCosts(Motion *m)
Updates the cost of the children of this node if the cost up to this node has changed.
Definition: RRTstar.cpp:503
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...
Abstract definition of goals.
Definition: Goal.h:63
base::Cost cost
The cost up to this motion.
Definition: RRTstar.h:185
Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whe...
void setRange(double distance)
Set the range the planner is supposed to use.
Definition: RRTstar.h:114
double getGoalBias(void) const
Get the goal bias the planner is using.
Definition: RRTstar.h:104
void append(const base::State *state)
Append state to the end of this path. The memory for state is copied.
Representation of a motion.
Definition: RRTstar.h:164
virtual void sampleGoal(State *st) const =0
Sample a state in the goal region.
double maxDistance_
The maximum length of a motion to be added to a tree.
Definition: RRTConnect.h:173
base::State * state
The state contained by the motion.
Definition: RRTstar.h:179
Base class for a vertex in the PlannerData structure. All derived classes must implement the clone an...
Definition: PlannerData.h:60
Invalid start state or no start state specified.
Definition: PlannerStatus.h:56
Abstract definition of a goal region that can be sampled.
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition: Cost.h:47
double getRange(void) const
Get the range the planner is using.
Definition: RRTstar.h:120
#define OMPL_ERROR(fmt,...)
Log a formatted error string.
Definition: Console.h:64
virtual void getPlannerData(base::PlannerData &data) const
Get information about the current run of the motion planner. Repeated calls to this function will upd...
Definition: RRTstar.cpp:527
A class to store the exit status of Planner::solve()
Definition: PlannerStatus.h:48
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...
An optimization objective which corresponds to optimizing path length.
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 of an abstract state.
Definition: State.h:50
virtual unsigned int maxSampleCount(void) const =0
Return the maximum number of samples that can be asked for before repeating.
virtual bool isSatisfied(const State *st) const =0
Return true if the state satisfies the goal constraints.
std::vector< Motion * > children
The set of motions descending from the current motion.
Definition: RRTstar.h:191
PlannerSpecs specs_
The specifications of the planner (its capabilities)
Definition: Planner.h:404
void configurePlannerRange(double &range)
Compute what a good length for motion segments is.
Definition: SelfConfig.cpp:226
void freeMemory(void)
Free the memory allocated by this planner.
Definition: RRTstar.cpp:512
Motion * parent
The parent motion in the exploration tree.
Definition: RRTstar.h:182
This class contains methods that automatically configure various parameters for motion planning...
Definition: SelfConfig.h:56
bool optimizingPaths
Flag indicating whether the planner attempts to optimize the path and reduce its length until the max...
Definition: Planner.h:216
virtual base::PlannerStatus solve(const base::PlannerTerminationCondition &ptc)
Function that can solve the motion planning problem. This function can be called multiple times on th...
Definition: RRTstar.cpp:120
void removeFromParent(Motion *m)
Removes the given motion from the parent's child list.
Definition: RRTstar.cpp:488
void setGoalBias(double goalBias)
Set the goal bias.
Definition: RRTstar.h:98
Definition of a geometric path.
Definition: PathGeometric.h:55
virtual void clear(void)
Clear all internal datastructures. Planner settings are not affected. Subsequent calls to solve() wil...
Definition: RRTstar.cpp:103
virtual void setup(void)
Perform extra configuration steps, if needed. This call will also issue a call to ompl::base::SpaceIn...
Definition: RRTstar.cpp:78
base::Cost incCost
The incremental cost of this motion's parent to this motion (this is stored to save distance computat...
Definition: RRTstar.h:188
A boost shared pointer wrapper for ompl::base::Path.
std::map< std::string, std::string > properties
Any extra properties (key-value pairs) the planner can set.
Definition: PlannerData.h:394
double distanceFunction(const Motion *a, const Motion *b) const
Compute distance between motions (actually distance between contained states)
Definition: RRTstar.h:215
#define OMPL_INFORM(fmt,...)
Log a formatted information string.
Definition: Console.h:68