Loading...
Searching...
No Matches
BundleSpaceGraph.cpp
79BundleSpaceGraph::BundleSpaceGraph(const ompl::base::SpaceInformationPtr &si, BundleSpace *parent_) : BaseT(si, parent_)
102 Planner::declareParam<double>("range", this, &BundleSpaceGraph::setRange, &BundleSpaceGraph::getRange,
106 Planner::declareParam<double>("goal_bias", this, &BundleSpaceGraph::setGoalBias, &BundleSpaceGraph::getGoalBias,
124 OMPL_DEBUG("Range distance graph sampling: %f (max extent %f)", maxDistance_, getBundle()->getMaximumExtent());
130 nearestDatastructure_.reset(tools::SelfConfig::getDefaultNearestNeighbors<Configuration *>(this));
138 nearestDatastructure_->setDistanceFunction([this](const Configuration *a, const Configuration *b)
173 base::PathPtr basePath = static_cast<BundleSpaceGraph *>(getChild())->getSolutionPathByReference();
257BundleSpaceGraph::Configuration::Configuration(const ompl::base::SpaceInformationPtr &si) : state(si->allocState())
421void BundleSpaceGraph::interpolate(const Configuration *a, const Configuration *b, Configuration *dest) const
426Configuration *BundleSpaceGraph::steerTowards(const Configuration *from, const Configuration *to)
438Configuration *BundleSpaceGraph::steerTowards_Range(const Configuration *from, Configuration *to)
454Configuration *BundleSpaceGraph::extendGraphTowards_Range(const Configuration *from, Configuration *to)
568const std::pair<BundleSpaceGraph::Edge, bool> BundleSpaceGraph::addEdge(const Vertex a, const Vertex b)
570 base::Cost weight = getOptimizationObjectivePtr()->motionCost(graph_[a]->state, graph_[b]->state);
686ompl::base::PathPtr BundleSpaceGraph::getPath(const Vertex &start, const Vertex &goal, Graph &graph)
689 auto weight = boost::make_transform_value_property_map(std::mem_fn(&EdgeInternalState::getCost),
789void BundleSpaceGraph::getPlannerDataGraph(ompl::base::PlannerData &data, const Graph &graph, const Vertex vStart) const
847 OMPL_DEBUG("Graph (level %d) has %d/%d vertices/edges", getLevel(), boost::num_vertices(graph_),
A nearest neighbors datastructure that uses linear search. The linear search is done over sqrt(n) ele...
Definition NearestNeighborsSqrtApprox.h:58
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition Cost.h:48
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
unsigned int addVertex(const PlannerDataVertex &st)
Adds the given vertex to the graph data. The vertex index is returned. Duplicates are not added....
Definition PlannerData.cpp:383
std::vector< base::State * > & getStates()
Get the states that make up the path (as a reference, so it can be modified, hence the function is no...
Definition PathGeometric.h:239
A configuration in Bundle-space.
Definition BundleSpaceGraph.h:96
normalized_index_type index
Index of configuration in boost::graph. Usually in the interval [0,num_vertices(graph)],...
Definition BundleSpaceGraph.h:140
An edge in Bundle-space.
Definition BundleSpaceGraph.h:161
bool connect(const Configuration *from, const Configuration *to)
Try to connect configuration a to configuration b using the current metric.
Definition BundleSpaceGraph.cpp:476
BundleSpaceGraphSamplerPtr graphSampler_
Pointer to strategy to sample from graph.
Definition BundleSpaceGraph.h:412
bool getSolution(ompl::base::PathPtr &solution) override
Return best solution.
Definition BundleSpaceGraph.cpp:619
BundleSpaceImportancePtr importanceCalculator_
Pointer to strategy to compute importance of this bundle space (which is used to decide which bundle ...
Definition BundleSpaceGraph.h:409
PathRestrictionPtr pathRestriction_
Pointer to current path restriction (the set of points which project onto the best cost path on the b...
Definition BundleSpaceGraph.h:418
Configuration * extendGraphTowards_Range(const Configuration *from, Configuration *to)
Steer system at Configuration *from to Configuration *to while system is valid, stopping if maxDistan...
Definition BundleSpaceGraph.cpp:454
void clear() override
Clear all internal datastructures. Planner settings are not affected. Subsequent calls to solve() wil...
Definition BundleSpaceGraph.cpp:188
virtual Vertex addConfiguration(Configuration *q)
Add configuration to graph. Return its vertex in boost graph.
Definition BundleSpaceGraph.cpp:355
RoadmapNeighborsPtr nearestDatastructure_
Nearest neighbor structure for Bundle space configurations.
Definition BundleSpaceGraph.h:386
void writeToGraphviz(std::string filename) const
Write class to graphviz.
Definition BundleSpaceGraph.cpp:761
double getImportance() const override
Importance of Bundle-space depending on number of vertices in Bundle-graph.
Definition BundleSpaceGraph.cpp:295
Configuration * steerTowards_Range(const Configuration *from, Configuration *to)
Steer system at Configuration *from to Configuration *to, stopping if maxdistance is reached.
Definition BundleSpaceGraph.cpp:438
virtual const std::pair< Edge, bool > addEdge(const Vertex a, const Vertex b)
Add edge between Vertex a and Vertex b to graph.
Definition BundleSpaceGraph.cpp:568
ompl::base::PathPtr getPath(const Vertex &start, const Vertex &goal)
Shortest path on Bundle-graph.
Definition BundleSpaceGraph.cpp:681
virtual void setStartIndex(Vertex)
Set vertex representing the start.
Definition BundleSpaceGraph.cpp:609
Configuration * steerTowards(const Configuration *from, const Configuration *to)
Steer system at Configuration *from to Configuration *to.
Definition BundleSpaceGraph.cpp:426
std::vector< Configuration * > goalConfigurations_
List of configurations that satisfy the goal condition.
Definition BundleSpaceGraph.h:433
virtual void init()
Initialization methods for the first iteration (adding start configuration and doing sanity checks).
Definition BundleSpaceGraph.cpp:300
std::vector< Configuration * > startConfigurations_
List of configurations that satisfy the start condition.
Definition BundleSpaceGraph.h:430
virtual Vertex getStartIndex() const
Get vertex representing the start.
Definition BundleSpaceGraph.cpp:577
virtual void interpolate(const Configuration *a, const Configuration *b, Configuration *dest) const
Interpolate from configuration a to configuration b and store results in dest.
Definition BundleSpaceGraph.cpp:421
virtual Configuration * addBundleConfiguration(base::State *)
Add ompl::base::State to graph. Return its configuration.
Definition BundleSpaceGraph.cpp:343
virtual void printConfiguration(const Configuration *) const
Print configuration to std::cout.
Definition BundleSpaceGraph.cpp:784
virtual Graph & getGraphNonConst()
Get underlying boost graph representation (non const).
Definition BundleSpaceGraph.cpp:383
virtual void addBundleEdge(const Configuration *a, const Configuration *b)
Add edge between configuration a and configuration b to graph.
Definition BundleSpaceGraph.cpp:350
virtual double distance(const Configuration *a, const Configuration *b) const
Distance between two configurations using the current metric.
Definition BundleSpaceGraph.cpp:411
virtual bool checkMotion(const Configuration *a, const Configuration *b) const
Check if we can move from configuration a to configuration b using the current metric.
Definition BundleSpaceGraph.cpp:416
virtual const Graph & getGraph() const
Get underlying boost graph representation.
Definition BundleSpaceGraph.cpp:378
void addGoalConfiguration(Configuration *x)
Add configuration to graph as goal vertex.
Definition BundleSpaceGraph.cpp:582
void print(std::ostream &out) const override
Print class to ostream.
Definition BundleSpaceGraph.cpp:776
bool findSection() override
Call algorithm to solve the find section problem.
Definition BundleSpaceGraph.cpp:169
void getPlannerData(ompl::base::PlannerData &data) const override
Return plannerdata structure, whereby each vertex is marked depending to which component it belongs (...
Definition BundleSpaceGraph.cpp:845
void setup() override
Perform extra configuration steps, if needed. This call will also issue a call to ompl::base::SpaceIn...
Definition BundleSpaceGraph.cpp:117
double graphLength_
Length of graph (useful for determing importance of Bundle-space.
Definition BundleSpaceGraph.h:395
boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, Configuration *, EdgeInternalState, GraphMetaData > Graph
A Bundle-graph structure using boost::adjacency_list bundles.
Definition BundleSpaceGraph.h:196
virtual Vertex getGoalIndex() const
Get vertex representing the goal.
Definition BundleSpaceGraph.cpp:591
virtual void clear() override
Clear all internal datastructures. Planner settings are not affected. Subsequent calls to solve() wil...
Definition BundleSpace.cpp:164
ProjectionPtr getProjection() const
Get ProjectionPtr from Bundle to Base.
Definition BundleSpace.cpp:226
BundleSpacePropagatorPtr propagator_
Propagator (steering or interpolation) on bundle space. Note: currently just a stub for base::StatePr...
Definition BundleSpace.h:275
virtual void setup() override
Perform extra configuration steps, if needed. This call will also issue a call to ompl::base::SpaceIn...
Definition BundleSpace.cpp:134
BundleSpace * getChild() const
Return k-1 th bundle space (locally the base space).
Definition BundleSpace.cpp:389
const ompl::base::SpaceInformationPtr & getBundle() const
Get SpaceInformationPtr for Bundle.
Definition BundleSpace.cpp:323
virtual void print(std::ostream &out) const
Internal function implementing actual printing to stream.
Definition BundleSpace.cpp:469
An annotated vertex, adding information about its level in the multilevel hierarchy....
Definition PlannerDataVertexAnnotated.h:56
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
@ GOAL_SAMPLEABLE_REGION
This bit is set if casting to sampleable goal regions (ompl::base::GoalSampleableRegion) is possible.
Definition GoalTypes.h:56
This namespace contains datastructures and planners to exploit multilevel abstractions,...
Definition MultiLevelPlanarManipulatorDemo.cpp:68