Parasol Planning Library (PPL)
|
#include <QueryMethod.h>
Public Types | |
Local Types | |
enum | GraphSearchAlg { DIJKSTRAS , ASTAR } |
Motion Planning Types | |
typedef MPBaseObject::RoadmapType | RoadmapType |
typedef RoadmapType::VID | VID |
typedef RoadmapType::VertexSet | VertexSet |
typedef std::unordered_set< size_t > | VIDSet |
Public Types inherited from MapEvaluatorMethod | |
typedef std::unordered_map< size_t, std::unordered_map< size_t, std::vector< Range< double > > > > | EdgeIntervals |
Public Types inherited from MPBaseObject | |
typedef DefaultWeight< Cfg > | WeightType |
typedef GenericStateGraph< Cfg, WeightType > | RoadmapType |
typedef GroupCfg< RoadmapType > | GroupCfgType |
typedef GroupLocalPlan< RoadmapType > | GroupWeightType |
typedef GroupRoadmap< GroupCfgType, GroupWeightType > | GroupRoadmapType |
Public Member Functions | |
Construction | |
QueryMethod () | |
QueryMethod (XMLNode &_node) | |
virtual | ~QueryMethod ()=default |
MPBaseObject Overrides | |
virtual void | Print (std::ostream &_os) const override |
virtual void | Initialize () override |
MapEvaluator Interface | |
virtual bool | operator() () override |
Query Interface | |
std::vector< VID > | GeneratePath (const VID _start, const VIDSet &_end) |
void | SetDMLabel (const std::string &_dmLabel) |
virtual void | SetPathWeightFunction (SSSPPathWeightFunction< RoadmapType > _f) |
void | SetLastConstraintTime (double _last) |
void | SetLastGoalConstraintTime (double _time) |
void | SetStartTime (double _start) |
void | SetEndTime (double _end) |
Public Member Functions inherited from MapEvaluatorMethod | |
virtual void | SetEdgeIntervals (EdgeIntervals _edgeIntervals) |
Set the edge intervals of a roadmap. More... | |
virtual void | SetMinEndtime (double _minEndtime) |
Set the minimum end time of a path. More... | |
void | SetActiveRobots (const std::vector< size_t > &_activeRobots) |
Set the active robots. More... | |
std::vector< size_t > | GetActiveRobots () const |
Get the active robots. More... | |
MapEvaluatorMethod ()=default | |
MapEvaluatorMethod (XMLNode &_node) | |
virtual | ~MapEvaluatorMethod ()=default |
Public Member Functions inherited from MPBaseObject | |
MPBaseObject (const std::string &_label="", const std::string &_name="", bool _debug=false) | |
MPBaseObject (XMLNode &_node) | |
virtual | ~MPBaseObject () |
const std::string & | GetName () const |
Get the class name for this object. More... | |
const std::string & | GetLabel () const |
Get the unique label for this object. More... | |
std::string | GetNameAndLabel () const |
Get the unique string identifier for this object "m_name::m_label". More... | |
void | SetLabel (const std::string &) |
Set the unique label for this object. More... | |
void | SetMPLibrary (MPLibrary *) noexcept |
Set the owning MPLibrary. More... | |
MPLibrary * | GetMPLibrary () const noexcept |
Get the owning MPLibrary. More... | |
bool | IsRunning () const noexcept |
Check the library's running flag. More... | |
MPProblem * | GetMPProblem () const noexcept |
Get the library's current MPProblem. More... | |
Environment * | GetEnvironment () const noexcept |
Get the current environment. More... | |
MPTask * | GetTask () const noexcept |
Get the current task. More... | |
GroupTask * | GetGroupTask () const noexcept |
Get the current group task. More... | |
MPSolutionType * | GetMPSolution () const noexcept |
RoadmapType * | GetRoadmap (Robot *const _r=nullptr) const noexcept |
Get the current free-space roadmap. More... | |
GroupRoadmapType * | GetGroupRoadmap (RobotGroup *const _g=nullptr) const noexcept |
Get the current free-space group roadmap. More... | |
RoadmapType * | GetBlockRoadmap (Robot *const _r=nullptr) const noexcept |
Get the current obstacle-space roadmap. More... | |
Path * | GetPath (Robot *const _r=nullptr) const noexcept |
GroupPath * | GetGroupPath (RobotGroup *const _g=nullptr) const noexcept |
Get the current best group path. More... | |
StatClass * | GetStatClass () const noexcept |
Get the current StatClass. More... | |
LocalObstacleMap * | GetLocalObstacleMap () const noexcept |
Get the local obstacle map. More... | |
Protected Member Functions | |
Helpers | |
virtual void | Reset (RoadmapType *const _r) |
void | SetSearchAlgViaString (std::string _alg, const std::string &_where) |
virtual bool | PerformSubQuery (const VID _start, const VIDSet &_goal) |
virtual double | StaticPathWeight (typename RoadmapType::adj_edge_iterator &_ei, const double _sourceDistance, const double _targetDistance) const |
virtual double | DynamicPathWeight (typename RoadmapType::adj_edge_iterator &_ei, const double _sourceDistance, const double _targetDistance) const |
std::vector< typename QueryMethod::VID > | TwoVariableQuery (const VID _start, const VIDSet &_goals) |
Protected Member Functions inherited from MPBaseObject | |
void | SetName (const std::string &_s) |
const std::string & | GetBaseFilename () const |
Protected Attributes | |
Internal State | |
RoadmapType * | m_roadmap {nullptr} |
Last roadmap queried. More... | |
MPTask * | m_task {nullptr} |
Last task we looked at. More... | |
size_t | m_goalIndex {0} |
Index of next unreached goal. More... | |
GraphSearchAlg | m_searchAlg {DIJKSTRAS} |
The sssp algorithm to use. More... | |
std::string | m_safeIntervalLabel |
The SafeIntervalTool label. More... | |
std::string | m_dmLabel |
The DistanceMetric label. More... | |
bool | m_twoVariable {false} |
Temporary flag to use two varibale state search. More... | |
SSSPPathWeightFunction< RoadmapType > | m_weightFunction |
The function for computing total path weight. More... | |
double | m_lastConstraint {0} |
The time of the last constraint. More... | |
double | m_lastGoalConstraint {0} |
The time of the last goal constraint. More... | |
double | m_startTime {0} |
The start time of the query. More... | |
double | m_endTime {0} |
The end time of the query. More... | |
Protected Attributes inherited from MapEvaluatorMethod | |
std::vector< size_t > | m_activeRobots |
Protected Attributes inherited from MPBaseObject | |
bool | m_debug |
Print debug info? More... | |
Base class for all query methods. These objects evaluate a roadmap under construction to see if a planning task has been satisfied.
The planning task is defined by the MPTask's Constraint objects. The query searches the current roadmap and aims to find a connecting path between configurations satisfying the task's start and goal constraints.
typedef RoadmapType::VID QueryMethod::VID |
typedef std::unordered_set<size_t> QueryMethod::VIDSet |
QueryMethod::QueryMethod | ( | ) |
QueryMethod::QueryMethod | ( | XMLNode & | _node | ) |
|
virtualdefault |
|
protectedvirtual |
Define a function for computing path weights w.r.t. dynamic obstacles. Here the metric is the number of time steps, and we return infinity if taking an edge would result in a collision with a dynamic obstacle.
_ei | An iterator to the edge we are checking. |
_sourceDistance | The shortest time to the source node. |
_targetDistance | The best known time to the target node. |
Reimplemented in LazyQuery.
std::vector< typename QueryMethod::VID > QueryMethod::GeneratePath | ( | const VID | _start, |
const VIDSet & | _end | ||
) |
Generate a path through the roadmap from a start node to an end node.
_start | The start node. |
_end | The set of allowed end nodes. |
|
overridevirtual |
Initialize this object for the current MPProblem. This should reset any internal state of the algorithms so that they are ready for execution. It is also the place to initialize any state that depends on the current problem.
Reimplemented from MPBaseObject.
Reimplemented in LazyQuery, and ClearanceQuery.
|
overridevirtual |
Evaluate a roadmap.
Implements MapEvaluatorMethod.
Check whether a path connecting a start to one of several goals exists in the roadmap.
_start | The start VID to use. |
_goals | The goal VIDs to use. |
|
overridevirtual |
Print internal state of this object.
_os | The std::ostream to print to. |
Reimplemented from MPBaseObject.
Reimplemented in LazyQuery, and ClearanceQuery.
|
protectedvirtual |
Reset the path and list of undiscovered goals.
_r | The roadmap to use. |
void QueryMethod::SetDMLabel | ( | const std::string & | _dmLabel | ) |
Set an alternate distance metric to use when searching the roadmap (instead of the saved edge weights).
_label | The Distance Metric label to use. Set to empty string to use the saved edge weights. |
void QueryMethod::SetEndTime | ( | double | _end | ) |
Set the end time of the query.
_end | The time to use. |
void QueryMethod::SetLastConstraintTime | ( | double | _last | ) |
Set the time of the last constraint.
_last | The time to use. |
void QueryMethod::SetLastGoalConstraintTime | ( | double | _time | ) |
Set the time of the last goal constraint.
_time | The time to use. |
|
virtual |
Set an alternate path weight function to use when searching the roadmap.
The | path weight function object to use. |
|
protected |
Set the search algorithm choice from a string.
_alg | The search algorithm to use ('astar' or 'dijkstras'). |
_where | Error location info in case _alg isn't recognized. |
void QueryMethod::SetStartTime | ( | double | _start | ) |
Set the start time of the query.
_start | The time to use. |
|
protectedvirtual |
Define a function for computing a path weight for a specific edge, ignoring dynamic obstacles.
_ei | An iterator to the edge we are checking. |
_sourceDistance | The shortest distance to the source node. |
_targetDistance | The best known distance to the target node. |
Reimplemented in LazyQuery, and ClearanceQuery.
|
protected |
Perform a query between start and goal vertices in the roadmap
_start | The start vertex. |
_goal | The goal vertex. |
|
protected |
The DistanceMetric label.
|
protected |
The end time of the query.
|
protected |
Index of next unreached goal.
|
protected |
The time of the last constraint.
|
protected |
The time of the last goal constraint.
|
protected |
Last roadmap queried.
|
protected |
The SafeIntervalTool label.
|
protected |
The sssp algorithm to use.
|
protected |
The start time of the query.
|
protected |
Last task we looked at.
|
protected |
Temporary flag to use two varibale state search.
|
protected |
The function for computing total path weight.