PPL API Reference
Overview Core Algorithm Abstractions Utilities Parallel Methods
Modules Class Hierarchy Classes Functions
Todo List Bug List Dead Code
List of all members | Protected Member Functions | Protected Attributes
CollisionDetectionValidity< MPTraits > Class Template Reference

Public Member Functions

Construction
 CollisionDetectionValidity ()
 
 CollisionDetectionValidity (XMLNode &_node)
 
virtual ~CollisionDetectionValidity ()
 
CollisionDetection Interface
virtual CollisionDetectionMethodGetCDMethod () const noexcept override
 
virtual bool IsInsideObstacle (const Point3d &_p) override
 
virtual bool WorkspaceVisibility (const Point3d &_a, const Point3d &_b) override
 
virtual bool IsMultiBodyCollision (CDInfo &_cdInfo, const MultiBody *const _a, const MultiBody *const _b, const std::string &_caller) override
 
Validity Accessors
bool GetValidity () const
 Get the current meaning of "valid" (true is default).
 
void ToggleValidity ()
 Switches the meaning of "valid" to "invalid" and vice versa.
 
Individual Configuration Validity
bool IsValid (CfgType &_cfg, CDInfo &_cdInfo, const std::string &_caller)
 
bool IsValid (CfgType &_cfg, const std::string &_caller)
 
Group Configuration Validity
bool IsValid (GroupCfgType &_cfg, CDInfo &_cdInfo, const std::string &_caller)
 
bool IsValid (GroupCfgType &_cfg, const std::string &_caller)
 
I/O
virtual void Print (std::ostream &_os) const
 
Initialization
virtual void Initialize ()
 
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.
 
MPLibraryGetMPLibrary () 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::MPToolsGetMPTools () const noexcept
 Get the MPTools container from the owning MPLibrary.
 
Problem Accessors
MPProblemGetMPProblem () const noexcept
 Get the library's current MPProblem.
 
EnvironmentGetEnvironment () const noexcept
 Get the current environment.
 
MPTaskGetTask () const noexcept
 Get the current task.
 
GroupTaskGetGroupTask () const noexcept
 Get the current group task.
 
Solution Accessors
MPSolutionGetMPSolution () const noexcept
 
RoadmapTypeGetRoadmap (Robot *const _r=nullptr) const noexcept
 Get the current free-space roadmap.
 
GroupRoadmapTypeGetGroupRoadmap (RobotGroup *const _g=nullptr) const noexcept
 Get the current free-space group roadmap.
 
RoadmapTypeGetBlockRoadmap (Robot *const _r=nullptr) const noexcept
 Get the current obstacle-space roadmap.
 
PathGetPath (Robot *const _r=nullptr) const noexcept
 Get the current best path.
 
GroupPathGetGroupPath (RobotGroup *const _g=nullptr) const noexcept
 Get the current best group path.
 
StatClassGetStatClass () const noexcept
 Get the current StatClass.
 
LocalObstacleMapGetLocalObstacleMap () const noexcept
 Get the local obstacle map.
 
GoalTrackerGetGoalTracker () const noexcept
 Get the goal tracker.
 

Public Types

Local Types
typedef MPTraits::CfgType CfgType
 
typedef MPTraits::GroupCfgType GroupCfg
 
typedef GroupCfg::Formation Formation
 
Motion Planning Types
typedef MPTraits::GroupCfgType GroupCfgType
 
Local Types
typedef MPTraits::RoadmapType RoadmapType
 
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

void SetName (const std::string &_s)
 
const std::string & GetBaseFilename () const
 
ValidityCheckerMethod Overrides
virtual bool IsValidImpl (CfgType &_cfg, CDInfo &_cdInfo, const std::string &_caller) override
 
virtual bool IsValidImpl (GroupCfg &_cfg, CDInfo &_cdInfo, const std::string &_caller) override
 
Helpers
virtual bool IsInCollision (CDInfo &_cdInfo, const CfgType &_cfg, const std::string &_caller)
 
virtual bool IsInCollision (CDInfo &_cdInfo, const GroupCfg &_cfg, const std::string &_caller)
 
virtual bool IsInSelfCollision (CDInfo &_cdInfo, const MultiBody *const _multibody, const std::string &_caller)
 
virtual bool IsInBoundaryCollision (CDInfo &_cdInfo, const CfgType &_cfg)
 
virtual bool IsInObstacleCollision (CDInfo &_cdInfo, const MultiBody *const _multibody, const std::string &_caller)
 
virtual bool IsInInterRobotCollision (CDInfo &_cdInfo, Robot *const _robot, const std::vector< Robot * > &_robots, const std::string &_caller)
 

Protected Attributes

bool m_debug
 Print debug info?
 
Internal State
std::unique_ptr< CollisionDetectionMethodm_cdMethod
 < Underlying collision detection object.
 
bool m_ignoreSelfCollision {false}
 Check self collisions.
 
bool m_interRobotCollision {false}
 Check inter-robot collisions.
 
bool m_ignoreAdjacentLinks {false}
 Ignore adj links in self collisions.
 
bool m_ignoreSiblingCollisions {false}
 Ignore sibling links in self collisions.
 
Internal State
bool m_validity {true}
 Use standard validity? False indicates negation.
 

Detailed Description

template<typename MPTraits>
class CollisionDetectionValidity< MPTraits >

Classifies validity based on collisions with other objects in the workspace.

There are three types of collision that can occur: 1. Self collision. Two or more pieces of the robot's geometry are overlapping in workspace. 2. Obstacle collision. The robot's geometry overlaps with some workspace obstacle. 3. Inter-robot collision. The robot's geometry overlaps with some other robot in its current configuration. For group configurations, collisions between robots within the group are considered as self-collisions, while collisions with robots not in the group are classified as inter-robot collisions. This distinction is made because considering self-collisions usually means that we want (group) configurations which are valid without considering the obstacles and other robots.

Any robot can be omitted from the collision checks by setting it as virtual. When collision checking a virtual robot, other robots are also ignored.

Note
This class interfaces with external CD libraries to determine collision information, sometimes including clearance and penetration information.
Todo:
Remove the 'GetCDMethod' function after re-implementing ObstacleClearanceValidity as a subtype of CollisionDetectionValidity.

Member Function Documentation

◆ GetCDMethod()

template<typename MPTraits >
CollisionDetectionMethod * CollisionDetectionValidity< MPTraits >::GetCDMethod
overridevirtualnoexcept
Returns
Collision Detection object

Reimplemented from CollisionDetectionValidityMethod< MPTraits >.

◆ IsInsideObstacle()

template<typename MPTraits >
bool CollisionDetectionValidity< MPTraits >::IsInsideObstacle ( const Point3d &  _p)
overridevirtual

Determine whether a workspace point lies inside of an obstacle.

Parameters
_pThe workspace point.
Returns
True if _p is inside an obstacle.

Implements CollisionDetectionValidityMethod< MPTraits >.

◆ WorkspaceVisibility()

template<typename MPTraits >
bool CollisionDetectionValidity< MPTraits >::WorkspaceVisibility ( const Point3d &  _a,
const Point3d &  _b 
)
overridevirtual

Check if two workspace points are mutually visible.

Parameters
_aThe first point.
_bThe second point.
Returns
True if _a is visible from _b and vice versa.

Implements CollisionDetectionValidityMethod< MPTraits >.

◆ IsMultiBodyCollision()

template<typename MPTraits >
bool CollisionDetectionValidity< MPTraits >::IsMultiBodyCollision ( CDInfo _cdInfo,
const MultiBody *const  _a,
const MultiBody *const  _b,
const std::string &  _caller 
)
overridevirtual

Check for collision between two multibodies.

Parameters
_cdInfoCDInfo
_aThe first multibody.
_bThe second multibody.
_callerFunction calling validity checker.
Returns
True if _a and _b collide in their present configurations.

Implements CollisionDetectionValidityMethod< MPTraits >.

◆ IsValidImpl() [1/2]

template<typename MPTraits >
bool CollisionDetectionValidity< MPTraits >::IsValidImpl ( CfgType &  _cfg,
CDInfo _cdInfo,
const std::string &  _caller 
)
overrideprotectedvirtual

Implementation of the classification of a configuration to either cfree or cobst.

Parameters
_cfgThe individual configuration.
_cdInfoOutput for extra computed information such as clearance.
_callerName of the calling function.
Returns
True if _cfg is in cfree.

Implements ValidityCheckerMethod< MPTraits >.

◆ IsValidImpl() [2/2]

template<typename MPTraits >
bool CollisionDetectionValidity< MPTraits >::IsValidImpl ( GroupCfg _cfg,
CDInfo _cdInfo,
const std::string &  _caller 
)
overrideprotectedvirtual

Implementation of group cfg classification.

Parameters
_cfgThe group configuration.
_cdInfoOutput for extra computed information such as clearance.
_callerName of the calling function.
Returns
True if _cfg is in cfree.

Reimplemented from ValidityCheckerMethod< MPTraits >.

◆ IsInCollision() [1/2]

template<typename MPTraits >
bool CollisionDetectionValidity< MPTraits >::IsInCollision ( CDInfo _cdInfo,
const CfgType &  _cfg,
const std::string &  _caller 
)
protectedvirtual

Orchestrate collision computation between robot and environment multibodies

Parameters
_cdInfoOutput for collision detection info.
_cfgConfiguration of interest.
_callerName of the calling function.
Returns
True if the robot is in collision at _cfg.

◆ IsInCollision() [2/2]

template<typename MPTraits >
bool CollisionDetectionValidity< MPTraits >::IsInCollision ( CDInfo _cdInfo,
const GroupCfg _cfg,
const std::string &  _caller 
)
protectedvirtual

Orchestrate collision computation between robots in a group cfg and environment multibodies

Parameters
_cdInfoOutput for collision detection info.
_cfgGroup configuration of interest.
_callerName of the calling function.
Returns
True if the robot group is in collision at _cfg.

◆ IsInSelfCollision()

template<typename MPTraits >
bool CollisionDetectionValidity< MPTraits >::IsInSelfCollision ( CDInfo _cdInfo,
const MultiBody *const  _multibody,
const std::string &  _caller 
)
protectedvirtual

Check if any of the robot's bodies are in collision with each other.

Parameters
_cdInfoOutput for collision detection info. It will only be updated if the detected collision is closer than the previous.
_multibodyThe robot's MultiBody.
_callerName of the calling function.
Returns
True if the robot is in self-collision.

◆ IsInBoundaryCollision()

template<typename MPTraits >
bool CollisionDetectionValidity< MPTraits >::IsInBoundaryCollision ( CDInfo _cdInfo,
const CfgType &  _cfg 
)
protectedvirtual

Check if any of the robot's bodies are in collision with or outside the environment boundary.

Parameters
_cdInfoOutput for collision detection info. It will only be updated if the detected collision is closer than the previous.
_cfgThe robot configuration.
Returns
True if the robot is in self-collision.

◆ IsInObstacleCollision()

template<typename MPTraits >
bool CollisionDetectionValidity< MPTraits >::IsInObstacleCollision ( CDInfo _cdInfo,
const MultiBody *const  _multibody,
const std::string &  _caller 
)
protectedvirtual

Check if any of the robot's bodies are in collision with an obstacle.

Parameters
_cdInfoOutput for collision detection info. It will only be updated if the detected collision is closer than the previous.
_multibodyThe robot's MultiBody.
_callerName of the calling function.
Returns
True if the robot is in collision with an obstacle.

◆ IsInInterRobotCollision()

template<typename MPTraits >
bool CollisionDetectionValidity< MPTraits >::IsInInterRobotCollision ( CDInfo _cdInfo,
Robot *const  _robot,
const std::vector< Robot * > &  _robots,
const std::string &  _caller 
)
protectedvirtual

Check for a collision between a query robot and a specific set of other robots.

Parameters
_robotThe query robot.
_robotsThe other robots.
_callerName of the calling function.

◆ IsValid() [1/4]

template<typename MPTraits >
bool ValidityCheckerMethod< MPTraits >::IsValid ( CfgType &  _cfg,
CDInfo _cdInfo,
const std::string &  _caller 
)
inherited

Classify a configuration to either cfree or cobst.

Parameters
_cfgThe individual configuration.
_cdInfoOutput for extra computed information such as clearance.
_callerName of the calling function.
Returns
True iff _cfg is in cfree, false otherwise.

◆ IsValid() [2/4]

template<typename MPTraits >
bool ValidityCheckerMethod< MPTraits >::IsValid ( CfgType &  _cfg,
const std::string &  _caller 
)
inherited

This version does not return extra information. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ IsValid() [3/4]

template<typename MPTraits >
bool ValidityCheckerMethod< MPTraits >::IsValid ( GroupCfgType _cfg,
CDInfo _cdInfo,
const std::string &  _caller 
)
inherited

Classify a gropu configuration to either cfree or cobst.

Parameters
_cfgThe group configuration.
_cdInfoOutput for extra computed information such as clearance.
_callerName of the calling function.
Returns
True iff _cfg is in cfree, false otherwise.

◆ IsValid() [4/4]

template<typename MPTraits >
bool ValidityCheckerMethod< MPTraits >::IsValid ( GroupCfgType _cfg,
const std::string &  _caller 
)
inherited

This version does not return extra information. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ Print()

template<typename MPTraits >
void MPBaseObject< MPTraits >::Print ( std::ostream &  _os) const
virtualinherited

◆ Initialize()

template<typename MPTraits >
virtual void MPBaseObject< MPTraits >::Initialize ( )
virtualinherited

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.

Warning
This member will be called for every compiled algorithm in the planning library - even those that will not be used. If an algorithm needs to do expenisve setup, then this method should only set a flag that tells it to do so on first use. The only exceptions are the MPStrategies, which will only have their initialize called on first use.

Reimplemented in ConnectorMethod< MPTraits >, CBSQuery< MPTraits >, ComposeEvaluator< MPTraits >, LazyQuery< MPTraits >, QueryMethod< MPTraits >, SIPPMethod< MPTraits >, TimeEvaluator< MPTraits >, TimeMetric< MPTraits >, AdaptiveRRT< MPTraits >, BasicPRM< MPTraits >, BasicRRTStrategy< MPTraits >, TogglePRMStrategy< MPTraits >, ValidationStrategy< MPTraits >, LKHSearch< MPTraits >, ClearanceUtility< MPTraits >, ReachabilityUtil< MPTraits >, SafeIntervalTool< MPTraits >, and TopologicalMap< MPTraits >.

◆ SetName()

template<typename MPTraits >
void MPBaseObject< MPTraits >::SetName ( const std::string &  _s)
protectedinherited
Parameters
_sClass name

◆ GetBaseFilename()

template<typename MPTraits >
const std::string & MPBaseObject< MPTraits >::GetBaseFilename ( ) const
protectedinherited
Returns
base file name from MPProblem

The documentation for this class was generated from the following file: