Simox  2.3.74.0
VirtualRobot::RobotNodeSet Class Reference
Inheritance diagram for VirtualRobot::RobotNodeSet:
VirtualRobot::SceneObjectSet VirtualRobot::KinematicChain

Public Types

typedef std::vector< RobotNodePtrNodeContainerT
 
typedef NodeContainerT::iterator NodeContainerIterT
 

Public Member Functions

RobotNodeSetPtr clone (RobotPtr newRobot, const RobotNodePtr newKinematicRoot=RobotNodePtr())
 
bool hasRobotNode (const RobotNodePtr &robotNode) const
 
bool hasRobotNode (const std::string &nodeName) const
 
int getRobotNodeIndex (const RobotNodePtr &robotNode) const
 
int getRobotNodeIndex (const std::string &nodeName) const
 
const std::vector< RobotNodePtr > & getAllRobotNodes () const
 
std::vector< std::string > getNodeNames () const
 
std::vector< float > getNodeLimitsLo () const
 
std::vector< float > getNodeLimitsHi () const
 
RobotNodePtr getKinematicRoot () const
 
void setKinematicRoot (RobotNodePtr robotNode)
 
RobotNodePtr getTCP () const
 
void print () const
 Print out some information. More...
 
unsigned int getSize () const override
 
std::vector< float > getJointValues () const
 
Eigen::VectorXf getJointValuesEigen () const
 
void getJointValues (std::vector< float > &fillVector) const
 
void getJointValues (Eigen::VectorXf &fillVector) const
 
void getJointValues (RobotConfigPtr fillVector) const
 
std::map< std::string, float > getJointValueMap () const
 
void respectJointLimits (std::vector< float > &jointValues) const
 
void respectJointLimits (Eigen::VectorXf &jointValues) const
 
bool checkJointLimits (std::vector< float > &jointValues, bool verbose=false) const
 
bool checkJointLimits (Eigen::VectorXf &jointValues, bool verbose=false) const
 
virtual void setJointValues (const std::vector< float > &jointValues)
 
virtual void setJointValues (const Eigen::VectorXf &jointValues)
 
virtual void setJointValues (const RobotConfigPtr jointValues)
 
RobotNodePtroperator[] (int i)
 
const RobotNodePtrgetNode (int i) const
 
const RobotNodePtrgetNode (const std::string &nodeName) const
 
auto begin ()
 
auto end ()
 
auto begin () const
 
auto end () const
 
unsigned int size () const
 
RobotPtr getRobot ()
 
bool isKinematicChain ()
 
KinematicChainPtr toKinematicChain ()
 
virtual void highlight (VisualizationPtr visualization, bool enable)
 
virtual int getNumFaces (bool collisionModel=false)
 
float getMaximumExtension ()
 
Eigen::Vector3f getCoM ()
 
float getMass ()
 
bool nodesSufficient (std::vector< RobotNodePtr > nodes) const
 Returns true, if nodes (only name strings are checked) are sufficient for building this rns. More...
 
std::string toXML (int tabs) override
 
bool addSceneObject (SceneObjectPtr sceneObject) override
 this is forbidden for RobotNodeSets, a call will throw an exception More...
 
bool addSceneObjects (SceneObjectSetPtr sceneObjectSet) override
 this is forbidden for RobotNodeSets, a call will throw an exception More...
 
bool addSceneObjects (RobotNodeSetPtr robotNodeSet) override
 this is forbidden for RobotNodeSets, a call will throw an exception More...
 
bool addSceneObjects (std::vector< RobotNodePtr > robotNodes) override
 this is forbidden for RobotNodeSets, a call will throw an exception More...
 
bool removeSceneObject (SceneObjectPtr sceneObject) override
 this is forbidden for RobotNodeSets, a call will throw an exception More...
 
bool mirror (const RobotNodeSet &targetNodeSet)
 
- Public Member Functions inherited from VirtualRobot::SceneObjectSet
EIGEN_MAKE_ALIGNED_OPERATOR_NEW SceneObjectSet (const std::string &name="", CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
virtual ~SceneObjectSet ()
 
std::string getName () const
 
virtual void addSceneObjects (std::vector< SceneObjectPtr > sceneObjects)
 
virtual void addSceneObjects (std::vector< ManipulationObjectPtr > sceneObjects)
 
CollisionCheckerPtr getCollisionChecker ()
 
std::vector< CollisionModelPtrgetCollisionModels ()
 
std::vector< SceneObjectPtrgetSceneObjects ()
 
virtual SceneObjectPtr getSceneObject (unsigned int nr)
 
virtual bool hasSceneObject (SceneObjectPtr sceneObject)
 Returns true, if sceneObject is part of this set. More...
 
virtual bool getCurrentSceneObjectConfig (std::map< SceneObjectPtr, Eigen::Matrix4f > &storeConfig)
 fills the current globalPose of all associated sceneobjects to map. More...
 
SceneObjectSetPtr clone (const std::string &newName="")
 
SceneObjectSetPtr clone (const std::string &newName, CollisionCheckerPtr newColChecker)
 
ObstaclePtr createStaticObstacle (const std::string &name)
 

Static Public Member Functions

static RobotNodeSetPtr createRobotNodeSet (RobotPtr robot, const std::string &name, const std::vector< std::string > &robotNodeNames, const std::string &kinematicRootName="", const std::string &tcpName="", bool registerToRobot=false)
 
static RobotNodeSetPtr createRobotNodeSet (RobotPtr robot, const std::string &name, const std::vector< RobotNodePtr > &robotNodes, const RobotNodePtr kinematicRoot=RobotNodePtr(), const RobotNodePtr tcp=RobotNodePtr(), bool registerToRobot=false)
 
static RobotNodeSetPtr createRobotNodeSet (RobotPtr robot, const std::string &name, const std::vector< RobotNodeSetPtr > &robotNodes, const RobotNodePtr kinematicRoot=RobotNodePtr(), const RobotNodePtr tcp=RobotNodePtr(), bool registerToRobot=false)
 Merges the node sets (takes care of only adding each node once) More...
 

Protected Member Functions

bool isKinematicRoot (RobotNodePtr robotNode)
 
 RobotNodeSet (const std::string &name, RobotWeakPtr robot, const std::vector< RobotNodePtr > &robotNodes, const RobotNodePtr kinematicRoot=RobotNodePtr(), const RobotNodePtr tcp=RobotNodePtr())
 
- Protected Member Functions inherited from VirtualRobot::SceneObjectSet
void destroyData ()
 delete all data More...
 

Protected Attributes

NodeContainerT robotNodes
 
RobotWeakPtr robot
 
RobotNodePtr kinematicRoot
 
RobotNodePtr tcp
 
- Protected Attributes inherited from VirtualRobot::SceneObjectSet
std::string name
 
std::vector< SceneObjectPtrsceneObjects
 
CollisionCheckerPtr colChecker
 

Friends

class RobotFactory
 

Detailed Description

A RobotNodeSet is a sub-set of RobotNodes of a Robot. Additionally to the list of RobotNodes, a RobotNodeSet holds information about

  • the kinematic root (the topmost RobotNode of the Robot's kinematic tree that has to be updated in order to update all covered RobotNodes)
  • the Tool Center point (TCP)

Member Typedef Documentation

◆ NodeContainerIterT

typedef NodeContainerT::iterator VirtualRobot::RobotNodeSet::NodeContainerIterT

◆ NodeContainerT

Constructor & Destructor Documentation

◆ RobotNodeSet()

VirtualRobot::RobotNodeSet::RobotNodeSet ( const std::string &  name,
RobotWeakPtr  robot,
const std::vector< RobotNodePtr > &  robotNodes,
const RobotNodePtr  kinematicRoot = RobotNodePtr(),
const RobotNodePtr  tcp = RobotNodePtr() 
)
protected

Initialize this set with a vector of RobotNodes.

Parameters
nameA name
robotA robot
robotNodesA set of robot nodes.
kinematicRootThis specifies the first node of the robot's kinematic tree to be used for updating all members of this set. kinematicRoot does not have to be a node of this set. If not given, the first entry of robotNodes is used.
tcpThe tcp.

Member Function Documentation

◆ addSceneObject()

bool VirtualRobot::RobotNodeSet::addSceneObject ( SceneObjectPtr  sceneObject)
overridevirtual

this is forbidden for RobotNodeSets, a call will throw an exception

Reimplemented from VirtualRobot::SceneObjectSet.

◆ addSceneObjects() [1/3]

bool VirtualRobot::RobotNodeSet::addSceneObjects ( SceneObjectSetPtr  sceneObjectSet)
overridevirtual

this is forbidden for RobotNodeSets, a call will throw an exception

Reimplemented from VirtualRobot::SceneObjectSet.

◆ addSceneObjects() [2/3]

bool VirtualRobot::RobotNodeSet::addSceneObjects ( RobotNodeSetPtr  robotNodeSet)
overridevirtual

this is forbidden for RobotNodeSets, a call will throw an exception

Reimplemented from VirtualRobot::SceneObjectSet.

◆ addSceneObjects() [3/3]

bool VirtualRobot::RobotNodeSet::addSceneObjects ( std::vector< RobotNodePtr robotNodes)
overridevirtual

this is forbidden for RobotNodeSets, a call will throw an exception

Reimplemented from VirtualRobot::SceneObjectSet.

◆ begin() [1/2]

auto VirtualRobot::RobotNodeSet::begin ( )
inline

◆ begin() [2/2]

auto VirtualRobot::RobotNodeSet::begin ( ) const
inline

◆ checkJointLimits() [1/2]

bool VirtualRobot::RobotNodeSet::checkJointLimits ( std::vector< float > &  jointValues,
bool  verbose = false 
) const

Checks if the jointValues are within the current joint limits.

Parameters
jointValuesA vector of correct size.
verbosePrint information if joint limits are violated.
Returns
True when all given joint values are within joint limits.

◆ checkJointLimits() [2/2]

bool VirtualRobot::RobotNodeSet::checkJointLimits ( Eigen::VectorXf &  jointValues,
bool  verbose = false 
) const

◆ clone()

RobotNodeSetPtr VirtualRobot::RobotNodeSet::clone ( RobotPtr  newRobot,
const RobotNodePtr  newKinematicRoot = RobotNodePtr() 
)

Registers a copy of this node set with the given robot

◆ createRobotNodeSet() [1/3]

RobotNodeSetPtr VirtualRobot::RobotNodeSet::createRobotNodeSet ( RobotPtr  robot,
const std::string &  name,
const std::vector< std::string > &  robotNodeNames,
const std::string &  kinematicRootName = "",
const std::string &  tcpName = "",
bool  registerToRobot = false 
)
static

Use this method to create and fully initialize an instance of RobotNodeSet.

◆ createRobotNodeSet() [2/3]

RobotNodeSetPtr VirtualRobot::RobotNodeSet::createRobotNodeSet ( RobotPtr  robot,
const std::string &  name,
const std::vector< RobotNodePtr > &  robotNodes,
const RobotNodePtr  kinematicRoot = RobotNodePtr(),
const RobotNodePtr  tcp = RobotNodePtr(),
bool  registerToRobot = false 
)
static

Use this method to create and fully initialize an instance of RobotNodeSet.

◆ createRobotNodeSet() [3/3]

RobotNodeSetPtr VirtualRobot::RobotNodeSet::createRobotNodeSet ( RobotPtr  robot,
const std::string &  name,
const std::vector< RobotNodeSetPtr > &  robotNodes,
const RobotNodePtr  kinematicRoot = RobotNodePtr(),
const RobotNodePtr  tcp = RobotNodePtr(),
bool  registerToRobot = false 
)
static

Merges the node sets (takes care of only adding each node once)

◆ end() [1/2]

auto VirtualRobot::RobotNodeSet::end ( )
inline

◆ end() [2/2]

auto VirtualRobot::RobotNodeSet::end ( ) const
inline

◆ getAllRobotNodes()

const std::vector< RobotNodePtr > & VirtualRobot::RobotNodeSet::getAllRobotNodes ( ) const

Returns all nodes.

◆ getCoM()

Eigen::Vector3f VirtualRobot::RobotNodeSet::getCoM ( )

Return center of mass of this node set.

◆ getJointValueMap()

std::map< std::string, float > VirtualRobot::RobotNodeSet::getJointValueMap ( ) const

◆ getJointValues() [1/4]

std::vector< float > VirtualRobot::RobotNodeSet::getJointValues ( ) const

◆ getJointValues() [2/4]

void VirtualRobot::RobotNodeSet::getJointValues ( std::vector< float > &  fillVector) const

◆ getJointValues() [3/4]

void VirtualRobot::RobotNodeSet::getJointValues ( Eigen::VectorXf &  fillVector) const

◆ getJointValues() [4/4]

void VirtualRobot::RobotNodeSet::getJointValues ( RobotConfigPtr  fillVector) const

◆ getJointValuesEigen()

Eigen::VectorXf VirtualRobot::RobotNodeSet::getJointValuesEigen ( ) const

◆ getKinematicRoot()

RobotNodePtr VirtualRobot::RobotNodeSet::getKinematicRoot ( ) const

Returns the topmost node of the robot's kinematic tree to be used for updating all members of this set. This node is usually defined in the RobotNodeSet's XML definition.

◆ getMass()

float VirtualRobot::RobotNodeSet::getMass ( )

Return accumulated mass of this node set.

◆ getMaximumExtension()

float VirtualRobot::RobotNodeSet::getMaximumExtension ( )

Compute an upper bound of the extension of the kinematic chain formed by this RobotNodeSet. This is done by summing the distances between all succeeding RobotNodes of this set.

◆ getNode() [1/2]

const RobotNodePtr & VirtualRobot::RobotNodeSet::getNode ( int  i) const

◆ getNode() [2/2]

const RobotNodePtr & VirtualRobot::RobotNodeSet::getNode ( const std::string &  nodeName) const

◆ getNodeLimitsHi()

std::vector< float > VirtualRobot::RobotNodeSet::getNodeLimitsHi ( ) const

◆ getNodeLimitsLo()

std::vector< float > VirtualRobot::RobotNodeSet::getNodeLimitsLo ( ) const

◆ getNodeNames()

std::vector< std::string > VirtualRobot::RobotNodeSet::getNodeNames ( ) const

◆ getNumFaces()

int VirtualRobot::RobotNodeSet::getNumFaces ( bool  collisionModel = false)
virtual

get number of faces (i.e. triangles) of this object collisionModel Indicates weather the faces of the collision model or the full model should be returned.

◆ getRobot()

RobotPtr VirtualRobot::RobotNodeSet::getRobot ( )

◆ getRobotNodeIndex() [1/2]

int VirtualRobot::RobotNodeSet::getRobotNodeIndex ( const RobotNodePtr robotNode) const

◆ getRobotNodeIndex() [2/2]

int VirtualRobot::RobotNodeSet::getRobotNodeIndex ( const std::string &  nodeName) const

◆ getSize()

unsigned int VirtualRobot::RobotNodeSet::getSize ( ) const
overridevirtual

The number of associated robot nodes.

Reimplemented from VirtualRobot::SceneObjectSet.

◆ getTCP()

RobotNodePtr VirtualRobot::RobotNodeSet::getTCP ( ) const

Returns the TCP.

◆ hasRobotNode() [1/2]

bool VirtualRobot::RobotNodeSet::hasRobotNode ( const RobotNodePtr robotNode) const

◆ hasRobotNode() [2/2]

bool VirtualRobot::RobotNodeSet::hasRobotNode ( const std::string &  nodeName) const

◆ highlight()

void VirtualRobot::RobotNodeSet::highlight ( VisualizationPtr  visualization,
bool  enable 
)
virtual

Convenient method for highlighting the visualization of this node. It is automatically checked whether the collision model or the full model is part of the visualization.

Parameters
visualizationThe visualization for which the highlighting should be performed.
enableSet or unset highlighting.

◆ isKinematicChain()

bool VirtualRobot::RobotNodeSet::isKinematicChain ( )

Checks if this set of robot nodes form a valid kinematic chain.

◆ isKinematicRoot()

bool VirtualRobot::RobotNodeSet::isKinematicRoot ( RobotNodePtr  robotNode)
protected

Tests if the given robot node is a valid kinematic root

◆ mirror()

bool VirtualRobot::RobotNodeSet::mirror ( const RobotNodeSet targetNodeSet)

◆ nodesSufficient()

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

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

◆ operator[]()

RobotNodePtr & VirtualRobot::RobotNodeSet::operator[] ( int  i)

◆ print()

void VirtualRobot::RobotNodeSet::print ( ) const

Print out some information.

◆ removeSceneObject()

bool VirtualRobot::RobotNodeSet::removeSceneObject ( SceneObjectPtr  sceneObject)
overridevirtual

this is forbidden for RobotNodeSets, a call will throw an exception

Reimplemented from VirtualRobot::SceneObjectSet.

◆ respectJointLimits() [1/2]

void VirtualRobot::RobotNodeSet::respectJointLimits ( std::vector< float > &  jointValues) const

Cut

◆ respectJointLimits() [2/2]

void VirtualRobot::RobotNodeSet::respectJointLimits ( Eigen::VectorXf &  jointValues) const

◆ setJointValues() [1/3]

void VirtualRobot::RobotNodeSet::setJointValues ( const std::vector< float > &  jointValues)
virtual

Set joint values [rad]. The subpart of the robot, defined by the start joint (kinematicRoot) of rns, is updated to apply the new joint values.

Parameters
jointValuesA vector with joint values, size must be equal to number of joints in this RobotNodeSet.

◆ setJointValues() [2/3]

void VirtualRobot::RobotNodeSet::setJointValues ( const Eigen::VectorXf &  jointValues)
virtual

Set joint values [rad]. The subpart of the robot, defined by the start joint (kinematicRoot) of rns, is updated to apply the new joint values.

Parameters
jointValuesA vector with joint values, size must be equal to number of joints in this RobotNodeSet.

◆ setJointValues() [3/3]

void VirtualRobot::RobotNodeSet::setJointValues ( const RobotConfigPtr  jointValues)
virtual

Set joints that are within the given RobotConfig. Joints of this NodeSet that are not stored in jointValues remain untouched.

◆ setKinematicRoot()

void VirtualRobot::RobotNodeSet::setKinematicRoot ( RobotNodePtr  robotNode)

◆ size()

unsigned int VirtualRobot::RobotNodeSet::size ( ) const
inline

◆ toKinematicChain()

KinematicChainPtr VirtualRobot::RobotNodeSet::toKinematicChain ( )

◆ toXML()

std::string VirtualRobot::RobotNodeSet::toXML ( int  tabs)
overridevirtual

Reimplemented from VirtualRobot::SceneObjectSet.

Friends And Related Function Documentation

◆ RobotFactory

friend class RobotFactory
friend

Field Documentation

◆ kinematicRoot

RobotNodePtr VirtualRobot::RobotNodeSet::kinematicRoot
protected

◆ robot

RobotWeakPtr VirtualRobot::RobotNodeSet::robot
protected

◆ robotNodes

NodeContainerT VirtualRobot::RobotNodeSet::robotNodes
protected

◆ tcp

RobotNodePtr VirtualRobot::RobotNodeSet::tcp
protected