Simox  2.3.74.0
VirtualRobot::RobotNodeFixed Class Reference
Inheritance diagram for VirtualRobot::RobotNodeFixed:
VirtualRobot::RobotNode VirtualRobot::GraspableSensorizedObject VirtualRobot::SceneObject

Public Member Functions

 RobotNodeFixed (RobotWeakPtr rob, const std::string &name, const Eigen::Matrix4f &preJointTransform, VisualizationNodePtr visualization=VisualizationNodePtr(), CollisionModelPtr collisionModel=CollisionModelPtr(), const SceneObject::Physics &p=SceneObject::Physics(), CollisionCheckerPtr colChecker=CollisionCheckerPtr(), RobotNodeType type=Generic)
 
 RobotNodeFixed (RobotWeakPtr rob, const std::string &name, float a, float d, float alpha, float theta, VisualizationNodePtr visualization=VisualizationNodePtr(), CollisionModelPtr collisionModel=CollisionModelPtr(), const SceneObject::Physics &p=SceneObject::Physics(), CollisionCheckerPtr colChecker=CollisionCheckerPtr(), RobotNodeType type=Generic)
 
 ~RobotNodeFixed () override
 
bool initialize (SceneObjectPtr parent=SceneObjectPtr(), const std::vector< SceneObjectPtr > &children=std::vector< SceneObjectPtr >()) override
 
void print (bool printChildren=false, bool printDecoration=true) const override
 
- Public Member Functions inherited from VirtualRobot::RobotNode
 RobotNode (RobotWeakPtr rob, const std::string &name, float jointLimitLo, float jointLimitHi, VisualizationNodePtr visualization=nullptr, CollisionModelPtr collisionModel=nullptr, float jointValueOffset=0.0f, const SceneObject::Physics &physics={}, CollisionCheckerPtr colChecker=nullptr, RobotNodeType type=Generic)
 
 ~RobotNode () override
 
RobotPtr getRobot () const
 
void setJointValue (float q)
 
void collectAllRobotNodes (std::vector< RobotNodePtr > &storeNodes)
 
virtual float getJointValue () const
 
void respectJointLimits (float &jointValue) const
 
bool checkJointLimits (float jointValue, bool verbose=false) const
 
virtual Eigen::Matrix4f getLocalTransformation ()
 
template<class T >
auto getChildren ()
 
void setGlobalPose (const Eigen::Matrix4f &pose) override
 
Eigen::Matrix4f getGlobalPose () const override
 
virtual Eigen::Matrix4f getPoseInRootFrame () const
 
virtual Eigen::Matrix4f getPoseInFrame (const RobotNodePtr &frame) const
 
virtual Eigen::Vector3f getPositionInRootFrame () const
 
virtual Eigen::Vector3f getPositionInFrame (const RobotNodePtr &frame) const
 
virtual Eigen::Matrix3f getOrientationInRootFrame () const
 
virtual Eigen::Matrix4f getPoseInRootFrame (const Eigen::Matrix4f &localPose) const
 
virtual Eigen::Vector3f getPositionInRootFrame (const Eigen::Vector3f &localPosition) const
 
virtual Eigen::Vector3f getDirectionInRootFrame (const Eigen::Vector3f &localPosition) const
 
virtual Eigen::Matrix3f getOrientationInRootFrame (const Eigen::Matrix3f &localOrientation) const
 
void showCoordinateSystem (bool enable, float scaling=1.0f, std::string *text=NULL, const std::string &visualizationType="") override
 
float getJointLimitLo ()
 
float getJointLimitHi ()
 
JointLimits getJointLimits ()
 
virtual void setJointLimits (float lo, float hi)
 
bool isJoint () const
 
virtual bool isTranslationalJoint () const
 
virtual bool isRotationalJoint () const
 
virtual bool isHemisphereJoint () const
 
virtual void setLimitless (bool limitless)
 
bool isLimitless () const
 
virtual float getDelta (float target)
 
virtual void showStructure (bool enable, const std::string &visualizationType="")
 
virtual std::vector< RobotNodePtrgetAllParents (RobotNodeSetPtr rns=RobotNodeSetPtr())
 
virtual RobotNodePtr clone (RobotPtr newRobot, bool cloneChildren=true, RobotNodePtr initializeWithParent=RobotNodePtr(), CollisionCheckerPtr colChecker=CollisionCheckerPtr(), float scaling=1.0f, bool preventCloningMeshesIfScalingIs1=false)
 
float getJointValueOffset () const
 
float getJointLimitHigh () const
 
float getJointLimitLow () const
 
float scaleJointValue (float val, float min=-1, float max=1)
 
float unscaleJointValue (float val, float min=-1, float max=1)
 
float getScaledJointValue (float min=-1, float max=1)
 
void setScaledJointValue (float val, float min=-1, float max=1)
 
void setScaledJointValueNoUpdate (float val, float min=-1, float max=1)
 
virtual void setMaxVelocity (float maxVel)
 
virtual void setMaxAcceleration (float maxAcc)
 
virtual void setMaxTorque (float maxTo)
 
float getMaxVelocity ()
 
float getMaxAcceleration ()
 
float getMaxTorque ()
 
RobotNodeType getType ()
 
SceneObjectPtr clone (const std::string &, CollisionCheckerPtr=CollisionCheckerPtr(), float=1.0f) const
 Forbid cloning method from SceneObject. We need to know the new robot for cloning. More...
 
const DHParametergetOptionalDHParameters ()
 
void updatePose (bool updateChildren=true) override
 
void copyPoseFrom (const SceneObjectPtr &sceneobj) override
 
void copyPoseFrom (const RobotNodePtr &other)
 
virtual void propagateJointValue (const std::string &jointName, float factor=1.0f)
 
virtual std::string toXML (const std::string &basePath, const std::string &modelPathRelative="models", bool storeSensors=true, bool storeModelFiles=true)
 
void setLocalTransformation (Eigen::Matrix4f &newLocalTransformation)
 
virtual void setJointValueNoUpdate (float q)
 
bool getEnforceJointLimits () const
 
void setEnforceJointLimits (bool value)
 
- Public Member Functions inherited from VirtualRobot::GraspableSensorizedObject
 GraspableSensorizedObject (const std::string &name, VisualizationNodePtr visualization=VisualizationNodePtr(), CollisionModelPtr collisionModel=CollisionModelPtr(), const Physics &p=Physics(), CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
bool initialize (SceneObjectPtr parent=SceneObjectPtr(), const std::vector< SceneObjectPtr > &children=std::vector< SceneObjectPtr >()) override
 
bool hasGraspSet (GraspSetPtr graspSet)
 
bool hasGraspSet (const std::string &robotType, const std::string &eef)
 
void addGraspSet (GraspSetPtr graspSet)
 
void includeGraspSet (GraspSetPtr graspSet)
 includeGraspSet More...
 
GraspSetPtr getGraspSet (EndEffectorPtr eef)
 
GraspSetPtr getGraspSet (const std::string &robotType, const std::string &eefName)
 
GraspSetPtr getGraspSet (const std::string &name)
 
const std::vector< GraspSetPtr > & getAllGraspSets ()
 
virtual SensorPtr getSensor (const std::string &name) const
 
virtual bool hasSensor (const std::string &name) const
 
virtual std::vector< SensorPtrgetSensors () const
 
virtual bool registerSensor (SensorPtr sensor)
 
void appendGraspSetsTo (GraspableSensorizedObjectPtr other) const
 
void appendSensorsTo (GraspableSensorizedObjectPtr other) const
 
void printGrasps () const
 
- Public Member Functions inherited from VirtualRobot::SceneObject
 SceneObject (const std::string &name, VisualizationNodePtr visualization=VisualizationNodePtr(), CollisionModelPtr collisionModel=CollisionModelPtr(), const Physics &p=Physics(), CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
virtual ~SceneObject ()
 
std::string getName () const
 
void setName (const std::string &name)
 
virtual Eigen::Vector3f getGlobalPosition () const
 
virtual Eigen::Matrix3f getGlobalOrientation () const
 
virtual Eigen::Matrix4f getGlobalPose (const Eigen::Matrix4f &localPose) const
 
virtual Eigen::Vector3f getGlobalPosition (const Eigen::Vector3f &localPosition) const
 
virtual Eigen::Vector3f getGlobalDirection (const Eigen::Vector3f &localDircetion) const
 
virtual Eigen::Matrix3f getGlobalOrientation (const Eigen::Matrix3f &localOrientation) const
 
virtual void setGlobalPoseNoChecks (const Eigen::Matrix4f &pose)
 
virtual CollisionModelPtr getCollisionModel ()
 
virtual CollisionCheckerPtr getCollisionChecker ()
 
void setVisualization (VisualizationNodePtr visualization)
 
void setCollisionModel (CollisionModelPtr colModel)
 
virtual VisualizationNodePtr getVisualization (SceneObject::VisualizationType visuType=SceneObject::Full)
 
virtual void setUpdateVisualization (bool enable)
 
bool getUpdateVisualizationStatus ()
 
virtual void setUpdateCollisionModel (bool enable)
 
bool getUpdateCollisionModelStatus ()
 
virtual void setupVisualization (bool showVisualization, bool showAttachedVisualizations)
 
virtual void showPhysicsInformation (bool enableCoM, bool enableInertial, VisualizationNodePtr comModel=VisualizationNodePtr())
 
virtual bool showCoordinateSystemState ()
 
virtual void showBoundingBox (bool enable, bool wireframe=false)
 
virtual bool ensureVisualization (const std::string &visualizationType="")
 
Eigen::Matrix4f toLocalCoordinateSystem (const Eigen::Matrix4f &poseGlobal) const
 
Eigen::Vector3f toLocalCoordinateSystemVec (const Eigen::Vector3f &positionGlobal) const
 
Eigen::Matrix4f toGlobalCoordinateSystem (const Eigen::Matrix4f &poseLocal) const
 
Eigen::Vector3f toGlobalCoordinateSystemVec (const Eigen::Vector3f &positionLocal) const
 
Eigen::Matrix4f getTransformationTo (const SceneObjectPtr otherObject) const
 
Eigen::Matrix4f getTransformationFrom (const SceneObjectPtr otherObject) const
 
Eigen::Matrix4f transformTo (const SceneObjectPtr otherObject, const Eigen::Matrix4f &poseInOtherCoordSystem)
 
Eigen::Vector3f transformTo (const SceneObjectPtr otherObject, const Eigen::Vector3f &positionInOtherCoordSystem)
 
virtual int getNumFaces (bool collisionModel=false)
 
virtual Eigen::Vector3f getCoMLocal ()
 
void setCoMLocal (const Eigen::Vector3f &comLocal)
 Set a new position for the CoM of this bode. More...
 
virtual Eigen::Vector3f getCoMGlobal ()
 
float getMass () const
 
void setMass (float m)
 
Physics::SimulationType getSimulationType () const
 
void setSimulationType (Physics::SimulationType s)
 
Eigen::Matrix3f getInertiaMatrix ()
 
Eigen::Matrix3f getInertiaMatrix (const Eigen::Vector3f &shift)
 If the Inertia Matrix is given at the CoM, this function returns the Inertia Matrix at the parallel shifted coordinate system. The shift is done using the parallel axis theorem (https://en.wikipedia.org/wiki/Parallel_axis_theorem) More...
 
Eigen::Matrix3f getInertiaMatrix (const Eigen::Vector3f &shift, const Eigen::Matrix3f &rotation)
 
Eigen::Matrix3f getInertiaMatrix (const Eigen::Matrix4f &transform)
 
void setInertiaMatrix (const Eigen::Matrix3f &im)
 
float getFriction ()
 
void setFriction (float friction)
 
SceneObject::Physics getPhysics ()
 
std::vector< std::string > getIgnoredCollisionModels ()
 
template<typename T >
std::shared_ptr< T > getVisualization (SceneObject::VisualizationType visuType=SceneObject::Full)
 
void highlight (VisualizationPtr visualization, bool enable)
 
SceneObjectPtr clone (const std::string &name, CollisionCheckerPtr colChecker=CollisionCheckerPtr(), float scaling=1.0f) const
 
SceneObjectPtr clone (CollisionCheckerPtr colChecker=CollisionCheckerPtr(), float scaling=1.0f) const
 
virtual bool attachChild (SceneObjectPtr child)
 
virtual void detachChild (SceneObjectPtr child)
 
virtual bool hasChild (SceneObjectPtr child, bool recursive=false) const
 
virtual bool hasChild (const std::string &childName, bool recursive=false) const
 
virtual bool hasParent () const
 
virtual SceneObjectPtr getParent () const
 
virtual std::vector< SceneObjectPtrgetChildren () const
 
virtual bool saveModelFiles (const std::string &modelPath, bool replaceFilenames)
 
void setScaling (float scaling)
 
float getScaling ()
 
bool reloadVisualizationFromXML (bool useVisAsColModelIfMissing=true)
 
const std::string & getVisualizationModelXML () const
 

Protected Member Functions

void checkValidRobotNodeType () override
 Checks if nodeType constraints are fulfilled. Otherwise an exception is thrown. Called on initialization. More...
 
 RobotNodeFixed ()
 
void updateTransformationMatrices (const Eigen::Matrix4f &parentPose) override
 
RobotNodePtr _clone (const RobotPtr newRobot, const VisualizationNodePtr visualizationModel, const CollisionModelPtr collisionModel, CollisionCheckerPtr colChecker, float scaling) override
 
std::string _toXML (const std::string &modelPath) override
 
- Protected Member Functions inherited from VirtualRobot::RobotNode
virtual void updateTransformationMatrices ()
 
void updatePose (const Eigen::Matrix4f &parentPose, bool updateChildren=true) override
 
virtual void updateVisualizationPose (const Eigen::Matrix4f &globalPose, bool updateChildren=false)
 
virtual void updateVisualizationPose (const Eigen::Matrix4f &globalPose, float jointValue, bool updateChildren=false)
 
 RobotNode ()
 
SceneObject_clone (const std::string &, CollisionCheckerPtr=CollisionCheckerPtr(), float=1.0f) const override
 
void setJointValueNotInitialized (float q)
 
- Protected Member Functions inherited from VirtualRobot::GraspableSensorizedObject
 GraspableSensorizedObject ()
 
std::string getGraspableSensorizedObjectXML (const std::string &modelPathRelative="models", bool storeSensors=true, int tabs=0)
 
- Protected Member Functions inherited from VirtualRobot::SceneObject
virtual void detachedFromParent ()
 Parent detached this object. More...
 
virtual void attached (SceneObjectPtr parent)
 Parent attached this object. More...
 
std::string getFilenameReplacementVisuModel (const std::string standardExtension=".wrl")
 
std::string getFilenameReplacementColModel (const std::string standardExtension=".wrl")
 
 SceneObject ()
 
std::string getSceneObjectXMLString (const std::string &basePath, int tabs, const std::string &modelPathRelative="")
 basic data, used by Obstacle and ManipulationObject More...
 
virtual bool initializePhysics ()
 

Friends

class RobotFactory
 

Additional Inherited Members

- Public Types inherited from VirtualRobot::RobotNode
enum  RobotNodeType { Generic, Joint, Body, Transform }
 Experimental: Additional information about the node. More...
 
- Public Types inherited from VirtualRobot::SceneObject
enum  VisualizationType { Full, Collision, CollisionData }
 
- Static Public Member Functions inherited from VirtualRobot::SceneObject
static Eigen::Matrix3f shiftInertia (const Eigen::Matrix3f inertiaMatrix, const Eigen::Vector3f &shift, float mass)
 The shift is done using the parallel axis theorem (https://en.wikipedia.org/wiki/Parallel_axis_theorem) More...
 
- Protected Attributes inherited from VirtualRobot::RobotNode
float jointValueOffset
 
float jointLimitLo
 
float jointLimitHi
 
bool enforceJointLimits = true
 
bool limitless
 
DHParameter optionalDHParameter
 
float maxVelocity
 
float maxAcceleration
 given in m/s More...
 
float maxTorque
 given in m/s^2 More...
 
Eigen::Matrix4f localTransformation
 given in Nm More...
 
std::map< std::string, float > propagatedJointValues
 
RobotWeakPtr robot
 
RobotNodeType nodeType
 
float jointValue
 
- Protected Attributes inherited from VirtualRobot::GraspableSensorizedObject
std::vector< GraspSetPtrgraspSets
 
std::vector< SensorPtrsensors
 
- Protected Attributes inherited from VirtualRobot::SceneObject
std::string name
 
bool initialized
 
Eigen::Matrix4f globalPose
 
std::vector< SceneObjectPtrchildren
 
SceneObjectWeakPtr parent
 
CollisionModelPtr collisionModel
 
std::string collisionModelXML
 
VisualizationNodePtr visualizationModel
 
std::string visualizationModelXML
 
std::filesystem::path basePath
 
bool updateVisualization
 
bool updateCollisionModel
 
Physics physics
 
CollisionCheckerPtr collisionChecker
 
float scaling = 1.0f
 

Constructor & Destructor Documentation

◆ RobotNodeFixed() [1/3]

VirtualRobot::RobotNodeFixed::RobotNodeFixed ( RobotWeakPtr  rob,
const std::string &  name,
const Eigen::Matrix4f &  preJointTransform,
VisualizationNodePtr  visualization = VisualizationNodePtr(),
CollisionModelPtr  collisionModel = CollisionModelPtr(),
const SceneObject::Physics p = SceneObject::Physics(),
CollisionCheckerPtr  colChecker = CollisionCheckerPtr(),
RobotNodeType  type = Generic 
)

Constructor

Parameters
robThe robot
nameThe name
preJointTransformThis is the fixed transformation of this RobotNode (used to compute globalPose)
visualizationA visualization model
collisionModelA collision model
pphysics information
colCheckerA collision checker instance (if not set, the global col checker is used)

◆ RobotNodeFixed() [2/3]

VirtualRobot::RobotNodeFixed::RobotNodeFixed ( RobotWeakPtr  rob,
const std::string &  name,
float  a,
float  d,
float  alpha,
float  theta,
VisualizationNodePtr  visualization = VisualizationNodePtr(),
CollisionModelPtr  collisionModel = CollisionModelPtr(),
const SceneObject::Physics p = SceneObject::Physics(),
CollisionCheckerPtr  colChecker = CollisionCheckerPtr(),
RobotNodeType  type = Generic 
)

Initialize with DH parameters.

The DH parameters are all applied before! any visualization is added to the kinematic structure.

Parameters
robThe robot
nameThe name
aUse fixed DH parameters to specify the transformation of this RobotNode
dUse fixed DH parameters to specify the transformation of this RobotNode
alphaUse fixed DH parameters to specify the transformation of this RobotNode
thetaUse fixed DH parameters to specify the transformation of this RobotNode
visualizationA visualization model
collisionModelA collision model
pphysics information
colCheckerA collision checker instance (if not set, the global col checker is used)

◆ ~RobotNodeFixed()

VirtualRobot::RobotNodeFixed::~RobotNodeFixed ( )
overridedefault

◆ RobotNodeFixed() [3/3]

VirtualRobot::RobotNodeFixed::RobotNodeFixed ( )
inlineprotected

Member Function Documentation

◆ _clone()

RobotNodePtr VirtualRobot::RobotNodeFixed::_clone ( const RobotPtr  newRobot,
const VisualizationNodePtr  visualizationModel,
const CollisionModelPtr  collisionModel,
CollisionCheckerPtr  colChecker,
float  scaling 
)
overrideprotectedvirtual

Derived classes must implement their clone method here. Passed models are already scaled. Scaling factor should be only used for kinematic computations.

Implements VirtualRobot::RobotNode.

◆ _toXML()

std::string VirtualRobot::RobotNodeFixed::_toXML ( const std::string &  modelPath)
overrideprotectedvirtual

Derived classes add custom XML tags here

Implements VirtualRobot::RobotNode.

◆ checkValidRobotNodeType()

void VirtualRobot::RobotNodeFixed::checkValidRobotNodeType ( )
overrideprotectedvirtual

Checks if nodeType constraints are fulfilled. Otherwise an exception is thrown. Called on initialization.

Reimplemented from VirtualRobot::RobotNode.

◆ initialize()

bool VirtualRobot::RobotNodeFixed::initialize ( SceneObjectPtr  parent = SceneObjectPtr(),
const std::vector< SceneObjectPtr > &  children = std::vector<SceneObjectPtr>() 
)
overridevirtual

Initialize robot node. Here pointers to robot and children are created from names. Be sure all children are created and registered to robot before calling initialize. Usually RobotFactory manages the initialization.

Reimplemented from VirtualRobot::RobotNode.

◆ print()

void VirtualRobot::RobotNodeFixed::print ( bool  printChildren = false,
bool  printDecoration = true 
) const
overridevirtual

Print status information.

Reimplemented from VirtualRobot::RobotNode.

◆ updateTransformationMatrices()

void VirtualRobot::RobotNodeFixed::updateTransformationMatrices ( const Eigen::Matrix4f &  parentPose)
overrideprotectedvirtual

Reimplemented from VirtualRobot::RobotNode.

Friends And Related Function Documentation

◆ RobotFactory

friend class RobotFactory
friend