PPL API Reference |
|
---|
Public Member Functions | |
Construction | |
MedialAxisUtility (string _vcLabel="", string _dmLabel="", bool _exactClearance=false, bool _exactPenetration=false, size_t _clearanceRays=10, size_t _penetrationRays=10, bool _useBBX=true, bool _positional=true, bool _debug=false, double _epsilon=0.1, size_t _historyLength=5) | |
MedialAxisUtility (XMLNode &_node) | |
virtual | ~MedialAxisUtility ()=default |
MPBaseObject Overrides | |
virtual void | Print (ostream &_os) const override |
void | SetDebug (const bool _debug) |
Property Accessors | |
double | GetEpsilon () const |
Get the value of epsilon. | |
Medial Axis Functions | |
bool | PushToMedialAxis (CfgType &_cfg, const Boundary *const _b) |
bool | PushFromInsideObstacle (CfgType &_cfg, const Boundary *const _b) |
bool | PushCfgToMedialAxisMidpointRule (CfgType &_cfg, const Boundary *const _b) |
I/O | |
virtual void | Print (std::ostream &_os) const |
MPBaseObject Overrides | |
virtual void | Initialize () override |
Accessors | |
const string & | GetDistanceMetricLabel () const |
Get the label of the distance metric. | |
const string & | GetValidityCheckerLabel () const |
Get the label of the validity checker. | |
void | SetValidityCheckerLabel (const string &_s) |
bool | GetExactClearance () const |
Get whether exact clearance is used or not. | |
double | GetPositionResolution () const |
Get the position resolution. | |
double | GetOrientationResolution () const |
Get the orientation resolution. | |
bool | IsInitialized () const |
Get whether the object is initialized or not. | |
Clearance Functions | |
bool | CollisionInfo (CfgType &_cfg, CfgType &_clrCfg, const Boundary *const _b, CDInfo &_cdInfo, const bool &_useOppValidityWitness=true) |
Calculate clearance information for the medial axis computation. | |
bool | ExactCollisionInfo (CfgType &_cfg, CfgType &_clrCfg, const Boundary *const _b, CDInfo &_cdInfo, const bool _useOppValidityWitness=true) |
bool | ApproxCollisionInfo (CfgType &_cfg, CfgType &_clrCfg, const Boundary *const _b, CDInfo &_cdInfo, const bool &_useOppValidityWitness=true) |
bool | FindApproximateWitness (const std::size_t &_numRays, std::vector< Ray< CfgType > > &_rays, const CfgType &_sampledCfg, const bool &_initValidity, const Boundary *const _b, std::pair< size_t, CfgType > &_candidate, const bool &_useOppValidityWitness=true) |
void | MakeRays (const CfgType &_sampledCfg, const std::size_t &_numRays, std::vector< Ray< CfgType > > &_rays) |
Generates the rays for the witness finding. | |
bool | ValidateCandidate (const std::pair< size_t, CfgType > &_cand, const std::vector< Ray< CfgType > > &_rays, const Boundary *const _b, const bool &_useOppValidityWitness=true) |
A final sanity check to be performed on the witness candidate. | |
ClearanceStats | RoadmapClearance () |
ClearanceStats | PathClearance (vector< VID > &_path) |
ClearanceStats | PathClearance (vector< Cfg > &_path) |
vector< double > | EdgeClearance (const CfgType &_c1, const CfgType &_c2, const WeightType &_weight) |
Name and Label Accessors | |
const std::string & | GetName () const |
Get the class name for this object. | |
const std::string & | GetLabel () const |
Get the unique label for this object. | |
std::string | GetNameAndLabel () const |
Get the unique string identifier for this object "m_name::m_label". | |
void | SetLabel (const std::string &) |
Set the unique label for this object. | |
MPLibrary Accessors | |
void | SetMPLibrary (MPLibrary *) noexcept |
Set the owning MPLibrary. | |
MPLibrary * | GetMPLibrary () const noexcept |
Get the owning MPLibrary. | |
bool | IsRunning () const noexcept |
Check the library's running flag. | |
DistanceMetricPointer | GetDistanceMetric (const std::string &) const noexcept |
Get a distance metric by label from the owning MPLibrary. | |
ValidityCheckerPointer | GetValidityChecker (const std::string &) const noexcept |
Get a validity checker by label from the owning MPLibrary. | |
NeighborhoodFinderPointer | GetNeighborhoodFinder (const std::string &) const noexcept |
Get a neighborhood finder by label from the owning MPLibrary. | |
SamplerPointer | GetSampler (const std::string &) const noexcept |
Get a sampler by label from the owning MPLibrary. | |
LocalPlannerPointer | GetLocalPlanner (const std::string &) const noexcept |
Get a local planner by label from the owning MPLibrary. | |
ExtenderPointer | GetExtender (const std::string &) const noexcept |
Get an extender by label from the owning MPLibrary. | |
PathModifierPointer | GetPathModifier (const std::string &) const noexcept |
Get a path modifier by label from the owning MPLibrary. | |
ConnectorPointer | GetConnector (const std::string &) const noexcept |
Get a connector by label from the owning MPLibrary. | |
MetricPointer | GetMetric (const std::string &) const noexcept |
Get a metric by label from the owning MPLibrary. | |
MapEvaluatorPointer | GetMapEvaluator (const std::string &) const noexcept |
Get a map evaluator by label from the owning MPLibrary. | |
MPStrategyPointer | GetMPStrategy (const std::string &) const noexcept |
Get a strategy by label from the owning MPLibrary. | |
MPTraits::MPTools * | GetMPTools () const noexcept |
Get the MPTools container from the owning MPLibrary. | |
Problem Accessors | |
MPProblem * | GetMPProblem () const noexcept |
Get the library's current MPProblem. | |
Environment * | GetEnvironment () const noexcept |
Get the current environment. | |
MPTask * | GetTask () const noexcept |
Get the current task. | |
GroupTask * | GetGroupTask () const noexcept |
Get the current group task. | |
Solution Accessors | |
MPSolution * | GetMPSolution () const noexcept |
RoadmapType * | GetRoadmap (Robot *const _r=nullptr) const noexcept |
Get the current free-space roadmap. | |
GroupRoadmapType * | GetGroupRoadmap (RobotGroup *const _g=nullptr) const noexcept |
Get the current free-space group roadmap. | |
RoadmapType * | GetBlockRoadmap (Robot *const _r=nullptr) const noexcept |
Get the current obstacle-space roadmap. | |
Path * | GetPath (Robot *const _r=nullptr) const noexcept |
Get the current best path. | |
GroupPath * | GetGroupPath (RobotGroup *const _g=nullptr) const noexcept |
Get the current best group path. | |
StatClass * | GetStatClass () const noexcept |
Get the current StatClass. | |
LocalObstacleMap * | GetLocalObstacleMap () const noexcept |
Get the local obstacle map. | |
GoalTracker * | GetGoalTracker () const noexcept |
Get the goal tracker. | |
Public Types | |
Motion Planning Types | |
typedef MPTraits::CfgType | CfgType |
Motion Planning Types | |
typedef MPTraits::WeightType | WeightType |
typedef MPTraits::RoadmapType | RoadmapType |
typedef RoadmapType::VID | VID |
Local Types | |
typedef MPTraits::GroupRoadmapType | GroupRoadmapType |
typedef MPTraits::LocalObstacleMap | LocalObstacleMap |
typedef MPTraits::Path | Path |
typedef MPTraits::GroupPathType | GroupPath |
typedef MPTraits::MPLibrary | MPLibrary |
typedef MPTraits::MPSolution | MPSolution |
typedef MPTraits::GoalTracker | GoalTracker |
typedef MPLibrary::SamplerPointer | SamplerPointer |
typedef MPLibrary::LocalPlannerPointer | LocalPlannerPointer |
typedef MPLibrary::ExtenderPointer | ExtenderPointer |
typedef MPLibrary::PathModifierPointer | PathModifierPointer |
typedef MPLibrary::ConnectorPointer | ConnectorPointer |
typedef MPLibrary::MetricPointer | MetricPointer |
typedef MPLibrary::MapEvaluatorPointer | MapEvaluatorPointer |
typedef MPLibrary::MPStrategyPointer | MPStrategyPointer |
typedef MPLibrary::DistanceMetricPointer | DistanceMetricPointer |
typedef MPLibrary::ValidityCheckerPointer | ValidityCheckerPointer |
typedef MPLibrary::NeighborhoodFinderPointer | NeighborhoodFinderPointer |
Protected Member Functions | |
bool | AdjustWitnessToEnsureValidity (const CfgType &_cfg, const bool _initValidity, CfgType &_witnessCfg, const Boundary *const _b, const bool _useOppValidityWitness=true) |
const bool | GetNearestVertexWitness (CfgType &_cfg, CDInfo &_cdInfo, const Boundary *const _b) |
void | SetName (const std::string &_s) |
const std::string & | GetBaseFilename () const |
Protected Attributes | |
bool | m_debug |
Print debug info? | |
Internal State | |
string | m_vcLabel {"cd4"} |
Validity checker method label. | |
string | m_dmLabel {"euclidean"} |
Distance metric method label. | |
bool | m_useBBX {true} |
Use bounding box as obstacle? | |
bool | m_positionalDofsOnly {true} |
Use only positional dofs? | |
bool | m_exactClearance {false} |
Use exact clearance calculations? | |
bool | m_exactPenetration {false} |
Use exact penetration calculations? | |
size_t | m_clearanceRays {10} |
Number of rays for approximate clearance. | |
size_t | m_penetrationRays {10} |
Number of rays for approximate penetration. | |
double | m_rayTickResolution |
The resolution for rayTicks. | |
double | m_orientationResolution |
The orientation resolution. | |
double | m_maxRayMagnitude |
How far out a ray will be attempted. | |
size_t | m_maxRayIterations |
The maximum number of ray iterations. | |
double | m_orientationResFactor {0.} |
The orientation resolution factor. | |
double | m_positionalResFactor {0.} |
The position resoluiton factor. | |
double | m_maSearchResolutionFactor {1} |
The search resolution factor. | |
bool | m_initialized {false} |
Tool for pushing configurations to the medial axis.
MedialAxisUtility< MPTraits >::MedialAxisUtility | ( | string | _vcLabel = "" , |
string | _dmLabel = "" , |
||
bool | _exactClearance = false , |
||
bool | _exactPenetration = false , |
||
size_t | _clearanceRays = 10 , |
||
size_t | _penetrationRays = 10 , |
||
bool | _useBBX = true , |
||
bool | _positional = true , |
||
bool | _debug = false , |
||
double | _epsilon = 0.1 , |
||
size_t | _historyLength = 5 |
||
) |
Construct a MedialAxisUtility object
_vcLabel | The validity checker to use. |
_dmLabel | The distance metric to use. |
_exactClearance | Use exact clearance or not. |
_exactPenetration | Use exact penetration or not. |
_clearanceRays | The number of clearance rays to use. |
_penetrationRays | The number of penetration rays to use. |
_useBBX | Use BBX or not. |
_positional | Use only positional DOFs. |
_debug | Set to debug mode or not. |
_epsilon | The epsilon value to use. |
_historyLength | The history length to use. |
MedialAxisUtility< MPTraits >::MedialAxisUtility | ( | XMLNode & | _node | ) |
Construct a MedialAxisUtility object from an XML node
_node | The XML node to use. |
|
overridevirtual |
Print the internal state of this object
_os | The std::ostream to print to. |
Reimplemented from ClearanceUtility< MPTraits >.
void MedialAxisUtility< MPTraits >::SetDebug | ( | const bool | _debug | ) |
Set to print debug statements or not
_debug | Print debug statements or not. |
bool MedialAxisUtility< MPTraits >::PushToMedialAxis | ( | CfgType & | _cfg, |
const Boundary *const | _b | ||
) |
Push a configuration to the medial axis.
_cfg | The configuration to push. |
_b | The boundary to use. |
bool MedialAxisUtility< MPTraits >::PushFromInsideObstacle | ( | CfgType & | _cfg, |
const Boundary *const | _b | ||
) |
Push a configuration that is known to be inside an obstacle towards the free-space medial axis. It will be pushed until it is outside the obstacle.
_cfg | The configuration to push. |
_b | The boundary to use. |
bool MedialAxisUtility< MPTraits >::PushCfgToMedialAxisMidpointRule | ( | CfgType & | _cfg, |
const Boundary *const | _b | ||
) |
Push a configuration to the medial axis by stepping away from the nearest obstacle at the resolution until a second witness (invalid cfg) is found and then the midpoint of those two cfgs will be the MA cfg.
_cfg | The configuration to push. |
_b | The boundary to use. |
|
virtualinherited |
Print internal state of this object.
_os | The std::ostream to print to. |
Reimplemented in ConditionalEvaluator< MPTraits >, PrintMapEvaluation< MPTraits >, MinkowskiDistance< MPTraits >, AdaptiveRRT< MPTraits >, BasicRRTStrategy< MPTraits >, CCsConnector< MPTraits >, ConnectorMethod< MPTraits >, NeighborhoodConnector< MPTraits >, BasicExtender< MPTraits >, ExtenderMethod< MPTraits >, LocalPlannerMethod< MPTraits >, StraightLine< MPTraits >, ComposeEvaluator< MPTraits >, LazyQuery< MPTraits >, QueryMethod< MPTraits >, SIPPMethod< MPTraits >, BasicPRM< MPTraits >, GroupDecoupledStrategy< MPTraits >, MPStrategyMethod< MPTraits >, TogglePRMStrategy< MPTraits >, BruteForceNF< MPTraits >, NeighborhoodFinderMethod< MPTraits >, and UniformRandomSampler< MPTraits >.
|
overridevirtualinherited |
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< MPTraits >.
|
inherited |
Set the label of the validity checker
_s | The label of the validity checker to use. |
|
inherited |
Calculate clearance information exactly by taking the validity checker results against obstacles to the bounding box.
|
inherited |
Calculate the approximate clearance using a series of rays. The specified number of rays are pushed outward until they change in validity. The shortest ray is then considered the best candidate.
|
inherited |
Helpers for ApproxCollisionInfo (should maybe be protected): Find the witness of an initial sample of any validity. A witness here is defined as the nearest point of obstacle boundary. @TODO Make the user have the option to have same or opposite validity for witnesses.
|
inherited |
Calculate roadmap clearance statistics including averages, mins, and maxes for clearance across roadmaps, paths, and edges.
|
inherited |
Calculate path clearance statistics including averages, mins, and maxes for clearance across the path
_path | The path to use. |
|
inherited |
Calculate path clearance statistics including averages, mins, and maxes for clearance across the path
_path | The path to use. |
|
inherited |
Calculate path clearance statistics including averages, mins, and maxes for clearance across the edge
_c1 | The source vertex. |
_c2 | The target vertex. |
_weight | The weight of the edge. |
|
protectedinherited |
Adjusts a witness from a nearby witness point to a point of guaranteed validity, based on _initValidity and _useOppValidityWitness.
|
protectedinherited |
GetNearestVertexWitness will do this for us, including boundary witness information, if BBX is active as an obstacle.
|
protectedinherited |
_s | Class name |
|
protectedinherited |
|
protectedinherited |
A boolean to determine whether initialize has been called on the utility or not yet. This is important, as there are MPLibrary things we need that are not available at construction time: