37 #include "ompl/control/PlannerData.h"
55 unsigned int index = vertexIndex (st);
56 if (index == INVALID_INDEX)
59 std::map<unsigned int, const base::PlannerDataEdge*> edgeMap;
60 getEdges(index, edgeMap);
62 for (std::map<unsigned int, const base::PlannerDataEdge*>::iterator edgemapit = edgeMap.begin(); edgemapit != edgeMap.end(); ++edgemapit)
66 std::set<Control*>::iterator it = decoupledControls_.find(ctrl);
67 if (it != decoupledControls_.end())
69 siC_->freeControl(*it);
70 decoupledControls_.erase(it);
84 unsigned int index1, index2;
85 index1 = vertexIndex(v1);
86 index2 = vertexIndex(v2);
88 if (index1 == INVALID_INDEX || index2 == INVALID_INDEX)
94 std::set<Control*>::iterator it = decoupledControls_.find(ctrl);
95 if (it != decoupledControls_.end())
97 siC_->freeControl(*it);
98 decoupledControls_.erase(it);
109 decoupledControls_.clear();
116 for (
unsigned int i = 0; i < numVertices(); ++i)
118 for (
unsigned int j = 0; j < numVertices(); ++j)
120 if (edgeExists(i, j))
125 if (decoupledControls_.find(ctrl) == decoupledControls_.end())
127 Control *clone = siC_->cloneControl(ctrl);
128 decoupledControls_.insert(clone);
147 void ompl::control::PlannerData::freeMemory(
void)
149 for (std::set<Control*>::iterator it = decoupledControls_.begin(); it != decoupledControls_.end(); ++it)
150 siC_->freeControl(*it);
Definition of an abstract control.
Object containing planner generated vertex and edge data. It is assumed that all vertices are unique...
Representation of an edge in PlannerData for planning with controls. This structure encodes a specifi...
PlannerData(const SpaceInformationPtr &siC)
Constructor. Accepts a SpaceInformationPtr for the space planned in.
virtual bool hasControls(void) const
Returns true if this PlannerData instance has controls associated with it.
Base class for a vertex in the PlannerData structure. All derived classes must implement the clone an...
virtual bool removeVertex(const PlannerDataVertex &st)
Removes the vertex associated with the given data. If the vertex does not exist, false is returned...
const SpaceInformationPtr & getSpaceInformation(void) const
Return the instance of SpaceInformation used in this PlannerData.
const Control * getControl(void) const
Return the control associated with this edge.
virtual void decoupleFromPlanner(void)
Creates a deep copy of the states contained in the vertices of this PlannerData structure so that whe...
virtual bool removeVertex(const base::PlannerDataVertex &st)
Removes the vertex associated with the given data. If the vertex does not exist, false is returned...
virtual ~PlannerData(void)
Destructor.
virtual bool removeEdge(unsigned int v1, unsigned int v2)
Removes the edge between vertex indexes v1 and v2. Success is returned.
virtual void clear(void)
Clears the entire data structure.
virtual void decoupleFromPlanner(void)
Creates a deep copy of the states contained in the vertices of this PlannerData structure so that whe...
virtual bool removeEdge(unsigned int v1, unsigned int v2)
Removes the edge between vertex indexes v1 and v2. Success is returned.
virtual void clear(void)
Clears the entire data structure.