Simox  2.3.74.0
VirtualRobot::EndEffector Class Reference
Inheritance diagram for VirtualRobot::EndEffector:

Data Structures

struct  ContactInfo
 

Public Types

typedef std::vector< ContactInfo, Eigen::aligned_allocator< ContactInfo > > ContactInfoVector
 We need an Eigen::aligned_allocator here, otherwise access to a std::vector could crash. More...
 

Public Member Functions

 EndEffector (const std::string &nameString, const std::vector< EndEffectorActorPtr > &actorsVector, const std::vector< RobotNodePtr > &staticPartVector, RobotNodePtr baseNodePtr, RobotNodePtr tcpNodePtr, RobotNodePtr gcpNodePtr=RobotNodePtr(), std::vector< RobotConfigPtr > preshapes=std::vector< RobotConfigPtr >())
 
virtual ~EndEffector ()
 
EndEffectorPtr clone (RobotPtr newRobot)
 
std::string getName ()
 
std::string getBaseNodeName ()
 
std::string getTcpName ()
 
RobotNodePtr getTcp ()
 
RobotNodePtr getBase ()
 
RobotNodePtr getGCP ()
 
RobotPtr getRobot ()
 
CollisionCheckerPtr getCollisionChecker ()
 
std::string getRobotType ()
 
void getActors (std::vector< EndEffectorActorPtr > &actors)
 
const std::vector< EndEffectorActorPtr > & getActors ()
 
void getStatics (std::vector< RobotNodePtr > &statics)
 
const std::vector< RobotNodePtr > & getStatics ()
 
ContactInfoVector closeActors (SceneObjectSetPtr obstacles=SceneObjectSetPtr(), float stepSize=0.02, float stepSizeSpeedFactor=1, std::uint64_t steps=0)
 
ContactInfoVector closeActors (SceneObjectPtr obstacle, float stepSize=0.02, float stepSizeSpeedFactor=1, std::uint64_t steps=0)
 
ContactInfoVector closeActors (std::nullptr_t, float stepSize=0.02, float stepSizeSpeedFactor=1, std::uint64_t steps=0)
 
ContactInfoVector closeActors (float stepSize, float stepSizeSpeedFactor=1, std::uint64_t steps=0)
 
bool allActorsClosed () const
 
bool allActorsOpen () const
 
void openActors (SceneObjectSetPtr obstacles=SceneObjectSetPtr(), float stepSize=0.02, float stepSizeSpeedFactor=1)
 
void openActors (float stepSize, float stepSizeSpeedFactor)
 
SceneObjectSetPtr createSceneObjectSet (CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
RobotPtr createEefRobot (const std::string &newRobotType, const std::string &newRobotName, CollisionCheckerPtr collisionChecker=CollisionCheckerPtr())
 
void registerPreshape (RobotConfigPtr preshape)
 
RobotConfigPtr getPreshape (const std::string &name)
 
bool hasPreshape (const std::string &name)
 
bool setPreshape (const std::string &name)
 
std::vector< std::string > getPreshapes ()
 
bool hasNode (RobotNodePtr node)
 
void print ()
 
RobotConfigPtr getConfiguration ()
 
std::vector< RobotNodePtrgetAllNodes ()
 Return all associated robot nodes. More...
 
bool nodesSufficient (std::vector< RobotNodePtr > nodes) const
 Returns true, if nodes (only name strings are checked) are sufficient for building this eef. More...
 
float getApproximatedLength ()
 
virtual std::string toXML (int ident=1)
 
int addStaticPartContacts (SceneObjectPtr obstacle, ContactInfoVector &contacts, const Eigen::Vector3f &approachDirGlobal, float maxDistance=3.0f)
 

Member Typedef Documentation

◆ ContactInfoVector

typedef std::vector< ContactInfo, Eigen::aligned_allocator<ContactInfo> > VirtualRobot::EndEffector::ContactInfoVector

We need an Eigen::aligned_allocator here, otherwise access to a std::vector could crash.

Constructor & Destructor Documentation

◆ EndEffector()

VirtualRobot::EndEffector::EndEffector ( const std::string &  nameString,
const std::vector< EndEffectorActorPtr > &  actorsVector,
const std::vector< RobotNodePtr > &  staticPartVector,
RobotNodePtr  baseNodePtr,
RobotNodePtr  tcpNodePtr,
RobotNodePtr  gcpNodePtr = RobotNodePtr(),
std::vector< RobotConfigPtr preshapes = std::vector< RobotConfigPtr >() 
)

◆ ~EndEffector()

VirtualRobot::EndEffector::~EndEffector ( )
virtualdefault

Member Function Documentation

◆ addStaticPartContacts()

int VirtualRobot::EndEffector::addStaticPartContacts ( SceneObjectPtr  obstacle,
EndEffector::ContactInfoVector contacts,
const Eigen::Vector3f &  approachDirGlobal,
float  maxDistance = 3.0f 
)

◆ allActorsClosed()

bool VirtualRobot::EndEffector::allActorsClosed ( ) const

◆ allActorsOpen()

bool VirtualRobot::EndEffector::allActorsOpen ( ) const

◆ clone()

EndEffectorPtr VirtualRobot::EndEffector::clone ( RobotPtr  newRobot)

Clones this eef and performs all necessary registrations. (Be careful: no need to call registerEEF with newly created eef, since this is already done)

◆ closeActors() [1/4]

EndEffector::ContactInfoVector VirtualRobot::EndEffector::closeActors ( SceneObjectSetPtr  obstacles = SceneObjectSetPtr(),
float  stepSize = 0.02,
float  stepSizeSpeedFactor = 1,
std::uint64_t  steps = 0 
)

Closes each actor until a joint limit is hit or a collision occurred. This method is intended for gripper or hand-like end-effectors.

◆ closeActors() [2/4]

ContactInfoVector VirtualRobot::EndEffector::closeActors ( SceneObjectPtr  obstacle,
float  stepSize = 0.02,
float  stepSizeSpeedFactor = 1,
std::uint64_t  steps = 0 
)

◆ closeActors() [3/4]

EndEffector::ContactInfoVector VirtualRobot::EndEffector::closeActors ( std::nullptr_t  ,
float  stepSize = 0.02,
float  stepSizeSpeedFactor = 1,
std::uint64_t  steps = 0 
)

◆ closeActors() [4/4]

EndEffector::ContactInfoVector VirtualRobot::EndEffector::closeActors ( float  stepSize,
float  stepSizeSpeedFactor = 1,
std::uint64_t  steps = 0 
)

◆ createEefRobot()

VirtualRobot::RobotPtr VirtualRobot::EndEffector::createEefRobot ( const std::string &  newRobotType,
const std::string &  newRobotName,
CollisionCheckerPtr  collisionChecker = CollisionCheckerPtr() 
)

Construct a robot that consists only of this eef. All corresponding robot nodes with visualization and collision models are cloned. The resulting robot will have one end effector defined which is identical to this object.

◆ createSceneObjectSet()

VirtualRobot::SceneObjectSetPtr VirtualRobot::EndEffector::createSceneObjectSet ( CollisionCheckerPtr  colChecker = CollisionCheckerPtr())

Build a SceneObjectSet that covers all RobotNodes of this EndEffector.

Note
The set can be used for collision detection, e.g. to check if the eef is in collision with an obstacle.

◆ getActors() [1/2]

void VirtualRobot::EndEffector::getActors ( std::vector< EndEffectorActorPtr > &  actors)

◆ getActors() [2/2]

const std::vector< EndEffectorActorPtr > & VirtualRobot::EndEffector::getActors ( )

◆ getAllNodes()

std::vector< RobotNodePtr > VirtualRobot::EndEffector::getAllNodes ( )

Return all associated robot nodes.

◆ getApproximatedLength()

float VirtualRobot::EndEffector::getApproximatedLength ( )

returns an approximation about the length of this eef.

◆ getBase()

VirtualRobot::RobotNodePtr VirtualRobot::EndEffector::getBase ( )

◆ getBaseNodeName()

std::string VirtualRobot::EndEffector::getBaseNodeName ( )

Return name of Base RobotNode.

◆ getCollisionChecker()

VirtualRobot::CollisionCheckerPtr VirtualRobot::EndEffector::getCollisionChecker ( )

◆ getConfiguration()

VirtualRobot::RobotConfigPtr VirtualRobot::EndEffector::getConfiguration ( )

Return current configuration as robot config.

◆ getGCP()

VirtualRobot::RobotNodePtr VirtualRobot::EndEffector::getGCP ( )

Returns the grasp center point. If it was not defined, the TCP is returned.

◆ getName()

std::string VirtualRobot::EndEffector::getName ( )

◆ getPreshape()

VirtualRobot::RobotConfigPtr VirtualRobot::EndEffector::getPreshape ( const std::string &  name)

◆ getPreshapes()

std::vector< std::string > VirtualRobot::EndEffector::getPreshapes ( )

Returns vector of all registered preshape names.

◆ getRobot()

VirtualRobot::RobotPtr VirtualRobot::EndEffector::getRobot ( )

Return associated robot

◆ getRobotType()

std::string VirtualRobot::EndEffector::getRobotType ( )

Return the type of the associated robot

◆ getStatics() [1/2]

void VirtualRobot::EndEffector::getStatics ( std::vector< RobotNodePtr > &  statics)

◆ getStatics() [2/2]

const std::vector< RobotNodePtr > & VirtualRobot::EndEffector::getStatics ( )

◆ getTcp()

VirtualRobot::RobotNodePtr VirtualRobot::EndEffector::getTcp ( )

◆ getTcpName()

std::string VirtualRobot::EndEffector::getTcpName ( )

Return name of TCP RobotNode.

◆ hasNode()

bool VirtualRobot::EndEffector::hasNode ( RobotNodePtr  node)

Check, if node is part of this eef.

◆ hasPreshape()

bool VirtualRobot::EndEffector::hasPreshape ( const std::string &  name)

◆ nodesSufficient()

bool VirtualRobot::EndEffector::nodesSufficient ( std::vector< RobotNodePtr nodes) const

Returns true, if nodes (only name strings are checked) are sufficient for building this eef.

◆ openActors() [1/2]

void VirtualRobot::EndEffector::openActors ( SceneObjectSetPtr  obstacles = SceneObjectSetPtr(),
float  stepSize = 0.02,
float  stepSizeSpeedFactor = 1 
)

Opens each actor until a joint limit is hit or a collision occurred. This method is intended for hand-like end-effectors. Note that the same effect can be realized by calling closeActors with a negative step size

◆ openActors() [2/2]

void VirtualRobot::EndEffector::openActors ( float  stepSize,
float  stepSizeSpeedFactor 
)
inline

◆ print()

void VirtualRobot::EndEffector::print ( )

◆ registerPreshape()

void VirtualRobot::EndEffector::registerPreshape ( RobotConfigPtr  preshape)

Register a preshape to this EEF. An exception is thrown if preshape covers joints that are not part of this eef. If there is already a preshape with name preshape->getName(), it is replaced.

◆ setPreshape()

bool VirtualRobot::EndEffector::setPreshape ( const std::string &  name)

Set joints of this eef to preshape with given name.

Parameters
nameThe name of the registered preshape.
Returns
false if preshape was not registered, otherwise true

◆ toXML()

std::string VirtualRobot::EndEffector::toXML ( int  ident = 1)
virtual

Creates an XML string of this EEF.