48 namespace ompl
87 base::PlannerStatus solve(const base::PlannerTerminationCondition &ptc) override;
88 void clear() override;
89 void setup() override;
92 void getPlannerData(base::PlannerData &data) const override;
97 projectionEvaluator_ = projectionEvaluator;
109 return projectionEvaluator_;
121 goalBias_ = goalBias;
126 return goalBias_;
148 Motion(base::State *startState, base::State *endState, Control *control, unsigned int controlDuration,
149 double priority, Motion *parent)
150 : startState_(startState)
151 , endState_(endState)
152 , control_(control)
153 , controlDuration_(controlDuration)
154 , priority_(priority)
155 , parent_(parent)
156 , cell_(nullptr)
157 , heapElement_(nullptr)
158 , isSplit_(false)
163 : startState_(state)
164 , endState_(state)
165 , control_(nullptr)
166 , controlDuration_(0)
167 , priority_(0.)
168 , parent_(nullptr)
169 , cell_(nullptr)
170 , heapElement_(nullptr)
171 , isSplit_(false)
209 : volume_(volume)
210 , splitDimension_(splitDimension)
211 , splitValue_(0.0)
212 , left_(nullptr)
213 , right_(nullptr)
214 , bounds_(std::move(bounds))
220 if (left_ != nullptr)
222 delete left_;
223 delete right_;
228 void subdivide(unsigned int spaceDimension);
233 auto *containingCell = const_cast<Cell *>(this);
237 containingCell = containingCell->left_;
239 containingCell = containingCell->right_;
247 motion->cell_ = this;
254 if (left_ != nullptr)
277 void addMotion(Motion *motion, Cell *cell, base::State *, base::State *, Eigen::Ref<Eigen::VectorXd>,
282 if (motion->heapElement_ != nullptr)
309 RNG rng_;
A bounding box for this cell.
unsigned int controlDuration_
The duration that the control was applied to arrive at this state from the parent.
void clear() override
Clear all internal datastructures. Planner settings are not affected. Subsequent calls to solve() wil...
Motion * propagateFrom(Motion *motion, base::State *, base::State *)
Select a state along motion and propagate a new motion from there. Return nullptr if no valid motion ...
unsigned int iteration_
Iteration number and priority of the next Motion that will be generated.
Priority for selecting this path to extend from in the future.
void setProjectionEvaluator(const base::ProjectionEvaluatorPtr &projectionEvaluator)
Set the projection evaluator. This class is able to compute the projection of a given state...
Directed control sampler.
const SpaceInformation * siC_
SpaceInformation convenience pointer.
A shared pointer wrapper for ompl::base::StateSampler.
BinaryHeap< Motion *, MotionCompare > priorityQueue_
Priority queue of motions.
void setProjectionEvaluator(const std::string &name)
Set the projection evaluator (select one from the ones registered with the state space).
Class representing the tree of motions exploring the state space.
base::State * startState_
The starting point of this motion.
The midpoint between the bounds_ at the splitDimension_.
base::GoalSampleableRegion * goalSampler_
Objected used to sample the goal.
base::PlannerStatus solve(const base::PlannerTerminationCondition &ptc) override
Function that can solve the motion planning problem. This function can be called multiple times on th...
double getGoalBias() const
Get the goal bias the planner is using */.
constructor for start states
BinaryHeap< Motion *, MotionCompare >::Element * heapElement_
Handle to the element of the priority queue for this Motion.
void update(Element *element)
Update an element in the heap.
Motion * lastGoalMotion_
Closest motion to the goal.
This class provides an implementation of an updatable min-heap. Using it is a bit cumbersome...
Abstract definition of a goal region that can be sampled.
Cell * right_
The right child cell (nullptr for a leaf cell)
Random number generation. An instance of this class cannot be used by multiple threads at once (membe...
Cell * stab(const Eigen::Ref< Eigen::VectorXd > projection) const
Locates the cell that this motion begins in.
A shared pointer wrapper for ompl::control::DirectedControlSampler.
Cell * cell_
Pointer to the cell that contains this path.
void updateHeapElement(Motion *motion)
Either update heap after motion's priority has changed or insert motion into heap.
const base::ProjectionEvaluatorPtr & getProjectionEvaluator() const
Get the projection evaluator.
A shared pointer wrapper for ompl::base::ProjectionEvaluator.
std::vector< Motion * > motions_
The motions contained in this cell. Motions are stored only in leaf nodes.
void addMotion(Motion *motion)
Add a motion.
bool operator()(Motion *p1, Motion *p2) const
returns true if m1 is lower priority than m2
control::Control * control_
The control that was applied to arrive at this state from the parent.
void subdivide(unsigned int spaceDimension)
Subdivides this cell.
The lower and upper bounds for an Rn space.
std::vector< Motion * > startMotions_
Vector holding all of the start states supplied for the problem Each start motion is the root of its ...
unsigned int findDurationAndAncestor(Motion *motion, base::State *state, base::State *scratch, Motion *&ancestor) const
Find the max. duration that the control_ in motion can be applied s.t. the trajectory passes through ...
Comparator used to order motions in the priority queue.
void addMotion(Motion *motion, Cell *cell, base::State *, base::State *, Eigen::Ref< Eigen::VectorXd >, Eigen::Ref< Eigen::VectorXd >)
Inserts the motion into the appropriate cells, splitting the motion as necessary. motion is assumed t...
Projection evaluator for the problem.
void setup() override
Perform extra configuration steps, if needed. This call will also issue a call to ompl::base::SpaceIn...
The space information for which planning is done.
void getPlannerData(base::PlannerData &data) const override
Extracts the planner data from the priority queue into data.
Cell * left_
The left child cell (nullptr for a leaf cell)
Space information containing necessary information for planning with controls. setup() needs to be ca...
unsigned int splitDimension_
Dimension along which the cell is split into smaller cells.
Element * insert(const _T &data)
Add a new element.
Motion * parent_
Parent motion from which this one started.
double score() const
The score is used to order motions in a priority queue.
Number between 0 and 1 specifying the probability with which the goal should be sampled.
base::State * endState_
The state reached by this motion.
*void setGoalBias(double goalBias)
In the process of randomly selecting states in the state space to attempt to go towards, the algorithm may in fact choose the actual goal state, if it knows it, with some probability. This probability is a real number between 0.0 and 1.0; its value should usually be around 0.05 and should not be too large. It is probably a good idea to use the default value.