43 namespace ompl
69 RRT(const base::SpaceInformationPtr &si, bool addIntermediateStates = false);
71 ~RRT() override;
77 void clear() override;
90 goalBias_ = goalBias;
96 return goalBias_;
103 return addIntermediateStates_;
110 addIntermediateStates_ = addIntermediateStates;
120 maxDistance_ = distance;
126 return maxDistance_;
134 OMPL_WARN("Calling setNearestNeighbors will clear all states.");
136 nn_ = std::make_shared<NN<Motion *>>();
140 void setup() override;
150 Motion() = default;
157 ~Motion() = default;
167 void freeMemory();
Random number generation. An instance of this class cannot be used by multiple threads at once (membe...
Object containing planner generated vertex and edge data. It is assumed that all vertices are unique,...
Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whe...
The space information for which planning is done.
Motion * parent
The parent motion in the exploration tree.
Motion(const base::SpaceInformationPtr &si)
Constructor that allocates memory for the state.
base::State * state
The state contained by the motion.
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...
void setup() override
Perform extra configuration steps, if needed. This call will also issue a call to ompl::base::SpaceIn...
Flag indicating whether intermediate states are added to the built tree of motions.
Set a different nearest neighbors datastructure.
void setGoalBias(double goalBias)
Set the goal bias.
void setIntermediateStates(bool addIntermediateStates)
Specify whether the intermediate states generated along motions are to be added to the tree itself.
double distanceFunction(const Motion *a, const Motion *b) const
Compute distance between motions (actually distance between contained states)
double getGoalBias() const
Get the goal bias the planner is using.
bool getIntermediateStates() const
Return true if the intermediate states generated along motions are to be added to the tree itself.
RRT(const base::SpaceInformationPtr &si, bool addIntermediateStates=false)
void clear() override
Clear all internal datastructures. Planner settings are not affected. Subsequent calls to solve() wil...
void getPlannerData(base::PlannerData &data) const override
Get information about the current run of the motion planner. Repeated calls to this function will upd...
The maximum length of a motion to be added to a tree.
Motion * lastGoalMotion_
The most recent goal motion. Used for PlannerData computation.
void setRange(double distance)
Set the range the planner is supposed to use.
Free the memory allocated by this planner.
The fraction of time the goal is picked as the state to expand towards (if such a state is available)
std::shared_ptr< NearestNeighbors< Motion * > > nn_
A nearest-neighbors datastructure containing the tree of motions.
double getRange() const
Get the range the planner is using.