Actin®  Version 5.2.0
Software for Robotics Simulation and Control
EcRrtUtility Class Reference

Class that contains utility methods for RRT-based algorithms and path planners. More...

#include <ecRrtUtility.h>

Inheritance diagram for EcRrtUtility:
EcXmlCompoundType EcXmlObject

Public Types

enum  NodeSpace {
  JOINT_SPACE,
  EE_SPACE,
  TIME_SPACE
}
 Enumerations for node space. More...
 
- Public Types inherited from EcXmlCompoundType
enum  {
  READONLYCOMPONENT = 0,
  READONLYATTRIBUTE
}
 special-descriptor codes More...
 

Public Member Functions

 ECXMLOBJECT (EcRrtUtility)
 Macro to create all the necessary virtual methods for EcXmlObjects.
 
virtual void registerComponents () EC_OVERRIDE
 register components with the parent
 
virtual void setNodeSpace (NodeSpace value)
 set the active node space, either JOINT_SPACE or EE_SPACE
 
virtual void setManipulatorIndex (EcU32 value)
 set the manipulator index
 
virtual void setStatedSystemPtr (const EcStatedSystem *pSystem)
 set the pointer to the stated system
 
virtual void setEndEffectorSetPtr (const EcEndEffectorSet *pEeSet)
 set the pointer to the end-effector set
 
virtual void setConvergenceToolPtr (EcConvergenceTool *pTool)
 set the pointer to the convergence tool
 
virtual void setRrtPathPlannerPtr (const EcRrtPathPlanner *pPlanner)
 set the pointer to the RRT path planner
 
virtual EcBoolean createNode (const EcTreeNode &source, const EcTreeNode &destination, EcReal stepSize, EcTreeNode &node)
 
virtual EcReal distance (const EcTreeNode &node1, const EcTreeNode &node2) const
 Compute the distance between two nodes.
 
virtual EcBoolean checkCollisionFree (const EcStatedSystem *pStatedSystem, const EcPositionState &posState, EcReal collisionThreshold=0.0, EcBoolean print=EcFalse)
 
virtual EcBoolean checkPathCollisionFree (const EcTreeNode &start, const EcTreeNode &end, EcReal stepSize, EcReal collisionThrehold, EcBoolean print=EcFalse)
 
virtual void setPositionStates (const EcPositionStateVector &value)
 Set the position states for the whole system. This should be done before calculating a path.
 
virtual EcBoolean generateRandomNode (EcTreeNode &node)
 Generate a random tree node.
 
virtual void filterPlacement (EcManipulatorEndEffectorPlacement &placement)
 
virtual EcBoolean generateInterpolatedPath (const EcTreeNode &node1, const EcTreeNode &node2, EcReal stepSize, EcPositionStateVector &posStatePath)
 generate interpolated path between two nodes
 
virtual EcBoolean collisionFreeStep (const EcTreeNode &from, const EcTreeNode &to, EcReal stepSize, EcReal tolerance, EcReal collisionStepSize, EcReal collisionThreshold, EcTreeNode &resultNode)
 
virtual EcBoolean trapReturnedResult ()
 
virtual const EcSystemCollisionExclusionMapmodifyCollisionExclusion (EcReal collisionThreshold, const std::set< EcU32 > &excludeList)
 
virtual void initJointInterpolationTool (const EcPositionController &posController)
 initialize joint interpolation tool
 
virtual void conditionPositionState (const EcPositionState &currentState, EcPositionState &posState)
 condition the position state. For the base class, here, this is a no-op
 
virtual EcBoolean keepPrevCollisionExclusions () const
 
virtual void setKeepPrevCollisionExclusions (EcBoolean value)
 get whether to use the existing collision exclusions.
 
virtual const EcXmlU32VectorexcludedRandomJoints () const
 
virtual void setExcludedRandomJoints (const EcXmlU32Vector &value)
 set the list of joints to be excluded in randomization in generateRandomNode methnod
 
- Public Member Functions inherited from EcXmlCompoundType
 ECDECLARE_BIGFOUR (EcXmlCompoundType)
 
virtual EcBoolean xmlInit () EC_OVERRIDE
 xmlInitialize
 
virtual EcBoolean read (EcXmlReader &stream) EC_OVERRIDE
 read object from an XML stream
 
virtual EcBoolean readAttributes (EcXmlReader &stream)
 read object attributes from an XML stream
 
virtual EcBoolean readElements (EcXmlReader &stream)
 read object elements from an XML stream
 
virtual EcBoolean write (EcXmlWriter &stream) const EC_OVERRIDE
 write object to an XML stream
 
virtual EcBoolean writeAttributes (EcXmlWriter &stream) const
 write object attributes to an XML stream
 
virtual EcBoolean writeElements (EcXmlWriter &stream) const
 write object elements to an XML stream
 
virtual EcBoolean writeSchema (EcXmlSchema &stream) const EC_OVERRIDE
 write schema
 
virtual EcBoolean writeSchemaAttributes (EcXmlSchema &stream) const
 write schema attributes
 
virtual EcBoolean writeSchemaElements (EcXmlSchema &stream) const
 write schema elements
 
virtual void registerComponent (const EcToken &token, EcXmlObject *obj)
 register a single component More...
 
virtual void registerComponent (EcXmlObject *obj)
 register a single component More...
 
virtual void registerComponentReadOnly (const EcToken &token, EcXmlObject *obj)
 register a single component as read-only More...
 
virtual const EcXmlComponentMapcomponentMap () const
 get a reference to the component map
 
virtual void registerAttributeComponent (const EcToken &AttribToken, EcXmlObject *Obj)
 register a single attribute component More...
 
virtual void registerAttributeComponentReadOnly (const EcToken &AttribToken, EcXmlObject *Obj)
 register a single attribute component read-only More...
 
virtual const EcXmlComponentMapattributeComponentMap ()
 get a reference to the component attribute map
 
virtual const EcXmlSpecialDescriptorMapspecialDescriptorMap ()
 get a reference to the special-descriptor map
 
virtual void registerComponentDescriptor (const EcToken &xmlToken, const EcToken &descriptorToken, const EcString &descriptorString)
 register an XML token-string descriptor More...
 
virtual const EcXmlTokenStringDescriptorMapMaptokenStringDescriptorMap ()
 get a reference to the XML token-string descriptor map
 
virtual EcBoolean hasChildren () const
 return EcTrue if there are children components or EcFalse if an empty element.
 
virtual EcBoolean hasAttributes () const
 return EcTrue if there are attributes in the element.
 
- Public Member Functions inherited from EcXmlObject
 ECDECLARE_BIGFOUR (EcXmlObject)
 
virtual EcXmlObjectclone () const =0
 clone
 
virtual EcBoolean readAttribute (EcXmlReader &stream)
 read this attribute from an XML stream
 
virtual EcBoolean createSchema (const EcString &filename, const EcToken &objectName=EcXml::EcDefaultToken) const
 create schema
 
virtual EcBoolean xmlInitialized () const
 get XML initialized flag. This bit is set on initialization.
 
virtual void setXmlInitialized (EcBoolean val=EcTrue)
 set XML initialized flag. This bit is set on initialization.
 
virtual EcBoolean specified () const
 get specified flag. This bit is set upon reading from an XML file.
 
virtual void setSpecified (EcBoolean val=EcTrue)
 set specified flag. This bit is set upon reading from an XML file.
 
virtual EcBoolean isBasicType () const
 Return true/false for basic type.
 
virtual EcBoolean equalsDefault () const
 tests equality of XML object with default
 
virtual EcBoolean equality (const EcXmlObject *other) const =0
 equality - a virtual equality to an EcXmlObject pointer
 
virtual EcXmlObjectnewObject () const =0
 creates new object - a virtual new to an EcXmlObject pointer
 
virtual const EcTokentoken () const =0
 gets the xml token used for writing out.
 

Static Public Member Functions

static EcXmlObjectcreator ()
 static creator function
 

Protected Types

typedef boost::function4< EcBoolean, EcU32, EcU32, EcU32, EcU32CollisionCallbackType
 Type of the collision callback: EcBoolean (*callback)(EcU32 manipIndex1, EcU32 linkIndex1, EcU32 manipIndex2, EcU32 linkIndex2)
 

Protected Member Functions

virtual EcBoolean calculateDistances (const EcStatedSystem *pStatedSystem, EcReal collisionThreshold, CollisionCallbackType callback=0)
 
virtual EcBoolean checkManipulatorIndices (EcU32 manipIndex1, EcU32 manipIndex2, const EcXmlU32Vector &manipIndices)
 
EcBoolean printOnCollision (EcU32 manipIndex1, EcU32 linkIndex1, EcU32 manipIndex2, EcU32 linkIndex2)
 Used in calculateDistances for callback. Will print and return true to indicate that calculateDistances should stop once a collision is detected.
 
EcBoolean updateCollisionExclusionMap (EcU32 manipIndex1, EcU32 linkIndex1, EcU32 manipIndex2, EcU32 linkIndex2)
 
- Protected Member Functions inherited from EcXmlCompoundType
virtual EcBoolean readValueFromToken (const EcToken &token, EcXmlReader &stream)
 
virtual EcBoolean readValueFromSpecialToken (const EcToken &token, EcXmlReader &stream)
 read value from unregistered token
 
virtual EcBoolean readAttributeFromToken (const EcToken &token, EcXmlReader &stream)
 
virtual EcXmlComponentMapnewComponentMap () const
 allocate a new componentMap
 
virtual EcXmlSpecialDescriptorMapnewSpecialDescriptorMap ()
 allocate a new specialDescriptorsMap
 
virtual EcXmlTokenStringDescriptorMapMapnewTokenStringDescriptorMap ()
 allocate a new tokenStringDescriptorsMap
 
virtual void createComponentMap () const
 create component map
 
virtual void createAttributeComponentMap ()
 create attribute component map
 
virtual void createSpecialDescriptorMap ()
 create special-descriptors map
 
virtual void createTokenStringDescriptorMap ()
 create token-string descriptor map
 
virtual EcBoolean isReadOnlyComponent (const EcToken token) const
 check to see if the token corresponds to a read-only component
 
virtual EcBoolean isReadOnlyAttribute (const EcToken token) const
 check to see if the token corresponds to a read-only attribute
 
virtual EcXmlObjectlibraryAttribute ()
 

Protected Attributes

EcXmlBoolean m_KeepPrevCollisionExclusions
 the flag indicating whether to use the existing collision exclusions
 
EcXmlU32Vector m_ExcludedRandomJoints
 the list of joints to be excluded in randomization in generateRandomNode methnod
 
NodeSpace m_NodeSpace
 the active node space
 
EcU32 m_ManipIndex
 the manipulator index
 
const EcStatedSystemm_pStatedSystem
 the stated system
 
const EcEndEffectorSetm_pEndEffectorSet
 the end effector set
 
const EcPositionControllerm_pPositionController
 the position controller
 
EcConvergenceToolm_pConvergenceTool
 the convergencetool
 
EcManipulatorProximityTool m_ProximityTool
 the proximity tool
 
EcCoordinateSystemTransformation m_BasePosition
 the base location of the manipulator
 
EcPositionStateVector m_PositionStates
 position states used for attached manipulators
 
EcSystemCollisionExclusionMap m_DynamicExclusionMap
 collision exclusion map for path planning with attachments
 
EcU32Vector m_ManipsInChain
 indices of manipulators in the attachment chain
 
EcBoolean m_ModifyingCollisionMap
 flag indicating whether we're modifying the collision map
 
EcJointInterpolationTool m_JointInterpolationTool
 Joint interpolation tool. Used to move between nodes in configuration (joint) space.
 
const EcRrtPathPlannerm_pPlanner
 pointer to RRT path planner
 
- Protected Attributes inherited from EcXmlCompoundType
EcXmlComponentMapm_pComponentMap
 
EcXmlComponentMapm_pAttributeComponentMap
 
EcXmlSpecialDescriptorMapm_pSpecialDescriptorMap
 
EcXmlTokenStringDescriptorMapMapm_pComponentMapTokenStringDescriptor
 
- Protected Attributes inherited from EcXmlObject
EcU8 m_State
 the state of the object - eight boolean flags
 

Additional Inherited Members

- Static Protected Attributes inherited from EcXmlObject
static const EcU8 m_theXmlInitializedBit
 the bit used to describe xml initialization
 
static const EcU8 m_theSpecifiedBit
 the bit used to describe specification
 

Detailed Description

Class that contains utility methods for RRT-based algorithms and path planners.

Definition at line 35 of file ecRrtUtility.h.

Member Enumeration Documentation

Enumerations for node space.

Enumerator
JOINT_SPACE 

Tree node is in joint space.

EE_SPACE 

Tree node is in EE space.

TIME_SPACE 

Tree node is in time space (for distance calculation purposes)

Definition at line 41 of file ecRrtUtility.h.

Member Function Documentation

virtual EcBoolean EcRrtUtility::calculateDistances ( const EcStatedSystem pStatedSystem,
EcReal  collisionThreshold,
CollisionCallbackType  callback = 0 
)
protectedvirtual

calculate distances among links. callback will be called when any distance is less than collisionThreshold

Returns
False if callback is called and it returns true (indicating that the method should stop whenever collision occurs). True otherwise.
virtual EcBoolean EcRrtUtility::checkCollisionFree ( const EcStatedSystem pStatedSystem,
const EcPositionState posState,
EcReal  collisionThreshold = 0.0,
EcBoolean  print = EcFalse 
)
virtual

Check collision for a given position state and a given collision threshold

Returns
True if the given posState is still in the collision-free space or false otherwise
virtual EcBoolean EcRrtUtility::checkManipulatorIndices ( EcU32  manipIndex1,
EcU32  manipIndex2,
const EcXmlU32Vector manipIndices 
)
protectedvirtual

check manipulator indices

Returns
True if manipIndex1 or manipIndex2 is either m_ManipIndex or in manipIndices. False otherwise.
virtual EcBoolean EcRrtUtility::checkPathCollisionFree ( const EcTreeNode start,
const EcTreeNode end,
EcReal  stepSize,
EcReal  collisionThrehold,
EcBoolean  print = EcFalse 
)
virtual

Check collision between start and end nodes by incrementing the position state by step size in each iteration

Returns
True if the path (in joint space) between start and end is collision-free space or false otherwise
virtual EcBoolean EcRrtUtility::collisionFreeStep ( const EcTreeNode from,
const EcTreeNode to,
EcReal  stepSize,
EcReal  tolerance,
EcReal  collisionStepSize,
EcReal  collisionThreshold,
EcTreeNode resultNode 
)
virtual

Check whether a path to a node that is stepSize from the "from" node in the direction of the "to" node is collision free.

Parameters
[in]fromThe beginning node.
[in]toThe end node.
[in]stepSizeThe step size from the beginning node.
[in]collisionStepSizeThe step size used to check collision. It should be small enough so that there's no need to check for collision between steps.
[in]collisionThresholdThe distance between two shapes under which a collision is considered to take place.
[out]resultNodeThe node that is stepSize from the beginning node.
Returns
True if the path from "from" to the resultNode is collision free. False otherwise.
virtual EcBoolean EcRrtUtility::createNode ( const EcTreeNode source,
const EcTreeNode destination,
EcReal  stepSize,
EcTreeNode node 
)
virtual

Generate a node that is a step size away from source in the direction of destination If source and destination is less than step size apart, then the generated node is simply destination

virtual const EcXmlU32Vector& EcRrtUtility::excludedRandomJoints ( ) const
virtual

the list of joints to be excluded in randomization in generateRandomNode methnod. For example, the manipuator itself may contain a gripper as part of the manipulator joints. However, the gripper joint motions do not contribute to the end-effector position and thus should be ignored when finding a collision-free path. So the joint value of any joint that's in this list will be not be randomized in generateRandomNode method and its current value is used instead.

virtual EcBoolean EcRrtUtility::keepPrevCollisionExclusions ( ) const
virtual

get whether to use the existing collision exclusions. By default, the existing dynamic collision exclusions will be ignored for safety reasons. In other words, we'll consider all possible collision pairs when calculating collision-free path except for links in the same attachment chain that are within the collision threshold at the start of the calculation. Set this flag to true if we want to use the existing collision exclusions instead.

virtual const EcSystemCollisionExclusionMap& EcRrtUtility::modifyCollisionExclusion ( EcReal  collisionThreshold,
const std::set< EcU32 > &  excludeList 
)
virtual

modify collision exclusion map

Parameters
[in]collisionThresholdCollision threshold used to exclude pairs of links involved in attachment that are within this threshold when path planning starts
[in]excludeListThe list of manipulator indices whose collisions with robot should be excluded.
Returns
The collision exclusion map
EcBoolean EcRrtUtility::updateCollisionExclusionMap ( EcU32  manipIndex1,
EcU32  linkIndex1,
EcU32  manipIndex2,
EcU32  linkIndex2 
)
protected

Used in calculateDistances for callback. Will update collision exclusion map to exclude collision between the two links.

Returns
False so calculateDistances will continue

The documentation for this class was generated from the following file:
Created by Energid Technologies www.energid.com
Copyright © 2016 Energid. All trademarks mentioned in this document are property of their respective owners.