dynamicgraph::sot::Dynamic Class Reference

This class provides an inverse dynamic model of the robot. More precisely it wraps the newton euler algorithm implemented by the dynamicsJRLJapan library to make it accessible in the stack of tasks. The robot is described by a VRML file. More...

#include <sot-dynamic/dynamic.h>

Inheritance diagram for dynamicgraph::sot::Dynamic:
Collaboration diagram for dynamicgraph::sot::Dynamic:

List of all members.

Public Types

typedef int Dummy

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW DYNAMIC_GRAPH_ENTITY_DECL ()
dg::SignalTimeDependent
< dg::Matrix, int > & 
createEndeffJacobianSignal (const std::string &signame, const std::string &)
dg::SignalTimeDependent
< dg::Matrix, int > & 
createJacobianSignal (const std::string &signame, const std::string &)
void destroyJacobianSignal (const std::string &signame)
dg::SignalTimeDependent
< MatrixHomogeneous, int > & 
createPositionSignal (const std::string &, const std::string &)
void destroyPositionSignal (const std::string &signame)
dg::SignalTimeDependent
< dg::Vector, int > & 
createVelocitySignal (const std::string &, const std::string &)
void destroyVelocitySignal (const std::string &signame)
dg::SignalTimeDependent
< dg::Vector, int > & 
createAccelerationSignal (const std::string &, const std::string &)
void destroyAccelerationSignal (const std::string &signame)
int & computeNewtonEuler (int &dummy, int time)
dg::SignalTimeDependent
< dg::Matrix, int > & 
jacobiansSOUT (const std::string &name)
dg::SignalTimeDependent
< MatrixHomogeneous, int > & 
positionsSOUT (const std::string &name)
dg::SignalTimeDependent
< dg::Vector, int > & 
velocitiesSOUT (const std::string &name)
dg::SignalTimeDependent
< dg::Vector, int > & 
accelerationsSOUT (const std::string &name)
 Dynamic (const std::string &name)
virtual ~Dynamic (void)
void setUrdfFile (const std::string &path)
 sets a urdf filepath to create robot model.
void parseUrdfFile (void)
 parses a urdf filepath to create robot model.
void createRobot ()
 Create an empty device.
void displayModel () const
void createJoint (const std::string &inJointName, const std::string &inJointType, const dg::Matrix &inPosition)
 create a joint
void addBody (const std::string &inParentName, const std::string &inJointName, const std::string &inChildName, const double mass, const dg::Vector &lever, const dg::Matrix &inertia3)
 Add a child body.
void addBody (const std::string &inParentName, const std::string &inJointName, const std::string &inChildName)
 Add a child body.
void setMass (const std::string &inBodyName, const double mass=0)
 Set mass of a body.
void setLocalCenterOfMass (const std::string &inBodyName, const dg::Vector &lever)
 Set COM of the body in local frame.
void setInertiaMatrix (const std::string &inBodyName, const dg::Matrix &inertia3)
 Set Inertia Matrix of the body.
void setInertiaProperties (const std::string &inBodyName, const double mass, const dg::Vector &lever, const dg::Matrix &inertia3)
 Set Inertia properties of a body.
void setDofBounds (const std::string &inJointName, const unsigned int inDofId, const double inMinValue, double inMaxValue)
 Set the bounds of a joint degree of freedom.
void setLowerPositionLimit (const std::string &inJointName, const dg::Vector &lowPos)
 Set lower bound of joint position.
void setLowerPositionLimit (const std::string &inJointName, const double lowPos)
void setUpperPositionLimit (const std::string &inJointName, const dg::Vector &upPos)
 Set upper bound of joint position.
void setUpperPositionLimit (const std::string &inJointName, const double upPos)
void setMaxVelocityLimit (const std::string &inJointName, const dg::Vector &maxVel)
 Set upper bound of joint velocities.
void setMaxVelocityLimit (const std::string &inJointName, const double maxVel)
void setMaxEffortLimit (const std::string &inJointName, const dg::Vector &maxEffort)
 Set upper bound of joint effort.
void setMaxEffortLimit (const std::string &inJointName, const double maxEffort)
dg::VectorgetLowerPositionLimits (dg::Vector &res, const int &)
 Get joint position lower limits.
dg::VectorgetUpperPositionLimits (dg::Vector &res, const int &)
 Get joint position upper limits.
dg::VectorgetUpperVelocityLimits (dg::Vector &res, const int &)
 Get joint velocity upper limits.
dg::VectorgetMaxEffortLimits (dg::Vector &res, const int &)
 Get joint effort upper limits.
virtual void commandLine (const std::string &cmdLine, std::istringstream &cmdArgs, std::ostream &os)
void cmd_createOpPointSignals (const std::string &sig, const std::string &j)
void cmd_createJacobianWorldSignal (const std::string &sig, const std::string &j)
void cmd_createJacobianEndEffectorSignal (const std::string &sig, const std::string &j)
void cmd_createPositionSignal (const std::string &sig, const std::string &j)

Public Attributes

se3::Model m_model
se3::Data * m_data
std::string m_urdfPath
bool init
std::list< dg::SignalBase< int > * > genericSignalRefs
dg::SignalPtr< dg::Vector, int > jointPositionSIN
dg::SignalPtr< dg::Vector, int > freeFlyerPositionSIN
dg::SignalPtr< dg::Vector, int > jointVelocitySIN
dg::SignalPtr< dg::Vector, int > freeFlyerVelocitySIN
dg::SignalPtr< dg::Vector, int > jointAccelerationSIN
dg::SignalPtr< dg::Vector, int > freeFlyerAccelerationSIN
dg::SignalTimeDependent< Dummy,
int > 
newtonEulerSINTERN
dg::SignalTimeDependent
< dg::Vector, int > 
zmpSOUT
dg::SignalTimeDependent
< dg::Matrix, int > 
JcomSOUT
dg::SignalTimeDependent
< dg::Vector, int > 
comSOUT
dg::SignalTimeDependent
< dg::Matrix, int > 
inertiaSOUT
dg::SignalTimeDependent
< double, int > 
footHeightSOUT
dg::SignalTimeDependent
< dg::Vector, int > 
upperJlSOUT
dg::SignalTimeDependent
< dg::Vector, int > 
lowerJlSOUT
dg::SignalTimeDependent
< dg::Vector, int > 
upperVlSOUT
dg::SignalTimeDependent
< dg::Vector, int > 
upperTlSOUT
dg::Signal< dg::Vector, int > inertiaRotorSOUT
dg::Signal< dg::Vector, int > gearRatioSOUT
dg::SignalTimeDependent
< dg::Matrix, int > 
inertiaRealSOUT
dg::SignalTimeDependent
< dg::Vector, int > 
MomentaSOUT
dg::SignalTimeDependent
< dg::Vector, int > 
AngularMomentumSOUT
dg::SignalTimeDependent
< dg::Vector, int > 
dynamicDriftSOUT

Protected Member Functions

dg::MatrixcomputeGenericJacobian (bool isFrame, int jointId, dg::Matrix &res, int time)
dg::MatrixcomputeGenericEndeffJacobian (bool isFrame, int jointId, dg::Matrix &res, int time)
MatrixHomogeneouscomputeGenericPosition (bool isFrame, int jointId, MatrixHomogeneous &res, int time)
dg::VectorcomputeGenericVelocity (int jointId, dg::Vector &res, int time)
dg::VectorcomputeGenericAcceleration (int jointId, dg::Vector &res, int time)
dg::VectorcomputeZmp (dg::Vector &res, int time)
dg::VectorcomputeMomenta (dg::Vector &res, int time)
dg::VectorcomputeAngularMomentum (dg::Vector &res, int time)
dg::MatrixcomputeJcom (dg::Matrix &res, int time)
dg::VectorcomputeCom (dg::Vector &res, int time)
dg::MatrixcomputeInertia (dg::Matrix &res, int time)
dg::MatrixcomputeInertiaReal (dg::Matrix &res, int time)
double & computeFootHeight (double &res, int time)
dg::VectorcomputeTorqueDrift (dg::Vector &res, const int &time)

Friends

class sot::command::SetFile
class sot::command::CreateOpPoint

Detailed Description

This class provides an inverse dynamic model of the robot. More precisely it wraps the newton euler algorithm implemented by the dynamicsJRLJapan library to make it accessible in the stack of tasks. The robot is described by a VRML file.


Member Typedef Documentation


Constructor & Destructor Documentation

dynamicgraph::sot::Dynamic::Dynamic ( const std::string &  name)
virtual dynamicgraph::sot::Dynamic::~Dynamic ( void  ) [virtual]

Member Function Documentation

dg::SignalTimeDependent<dg::Vector,int>& dynamicgraph::sot::Dynamic::accelerationsSOUT ( const std::string &  name)
void dynamicgraph::sot::Dynamic::addBody ( const std::string &  inParentName,
const std::string &  inJointName,
const std::string &  inChildName,
const double  mass,
const dg::Vector lever,
const dg::Matrix inertia3 
)

Add a child body.

Parameters:
inParentNamename of the body to which a child is added.
inJointNamename of the joint added.
inChildNamename of the body added.
massmass of the child body. default 0.
levercom position of the body. default zero vector.
inertia3matrix of the body. default zero matrix.
void dynamicgraph::sot::Dynamic::addBody ( const std::string &  inParentName,
const std::string &  inJointName,
const std::string &  inChildName 
)

Add a child body.

Parameters:
inParentNamename of the body to which a child is added.
inJointNamename of the joint added.
inChildNamename of the body added.
Note:
default mass=0, default inertia=Zero Matrix, default com=Zero Vector
void dynamicgraph::sot::Dynamic::cmd_createJacobianEndEffectorSignal ( const std::string &  sig,
const std::string &  j 
)
void dynamicgraph::sot::Dynamic::cmd_createJacobianWorldSignal ( const std::string &  sig,
const std::string &  j 
)
void dynamicgraph::sot::Dynamic::cmd_createOpPointSignals ( const std::string &  sig,
const std::string &  j 
)
void dynamicgraph::sot::Dynamic::cmd_createPositionSignal ( const std::string &  sig,
const std::string &  j 
)
virtual void dynamicgraph::sot::Dynamic::commandLine ( const std::string &  cmdLine,
std::istringstream &  cmdArgs,
std::ostream &  os 
) [virtual]

Reimplemented from dynamicgraph::Entity.

dg::Vector& dynamicgraph::sot::Dynamic::computeAngularMomentum ( dg::Vector res,
int  time 
) [protected]
dg::Vector& dynamicgraph::sot::Dynamic::computeCom ( dg::Vector res,
int  time 
) [protected]
double& dynamicgraph::sot::Dynamic::computeFootHeight ( double &  res,
int  time 
) [protected]
dg::Vector& dynamicgraph::sot::Dynamic::computeGenericAcceleration ( int  jointId,
dg::Vector res,
int  time 
) [protected]
dg::Matrix& dynamicgraph::sot::Dynamic::computeGenericEndeffJacobian ( bool  isFrame,
int  jointId,
dg::Matrix res,
int  time 
) [protected]
dg::Matrix& dynamicgraph::sot::Dynamic::computeGenericJacobian ( bool  isFrame,
int  jointId,
dg::Matrix res,
int  time 
) [protected]
MatrixHomogeneous& dynamicgraph::sot::Dynamic::computeGenericPosition ( bool  isFrame,
int  jointId,
MatrixHomogeneous res,
int  time 
) [protected]
dg::Vector& dynamicgraph::sot::Dynamic::computeGenericVelocity ( int  jointId,
dg::Vector res,
int  time 
) [protected]
dg::Matrix& dynamicgraph::sot::Dynamic::computeInertia ( dg::Matrix res,
int  time 
) [protected]
dg::Matrix& dynamicgraph::sot::Dynamic::computeInertiaReal ( dg::Matrix res,
int  time 
) [protected]
dg::Matrix& dynamicgraph::sot::Dynamic::computeJcom ( dg::Matrix res,
int  time 
) [protected]
dg::Vector& dynamicgraph::sot::Dynamic::computeMomenta ( dg::Vector res,
int  time 
) [protected]
int& dynamicgraph::sot::Dynamic::computeNewtonEuler ( int &  dummy,
int  time 
)
dg::Vector& dynamicgraph::sot::Dynamic::computeTorqueDrift ( dg::Vector res,
const int &  time 
) [protected]
dg::Vector& dynamicgraph::sot::Dynamic::computeZmp ( dg::Vector res,
int  time 
) [protected]
dg::SignalTimeDependent< dg::Vector,int >& dynamicgraph::sot::Dynamic::createAccelerationSignal ( const std::string &  ,
const std::string &   
)
dg::SignalTimeDependent< dg::Matrix,int >& dynamicgraph::sot::Dynamic::createEndeffJacobianSignal ( const std::string &  signame,
const std::string &   
)
dg::SignalTimeDependent< dg::Matrix,int >& dynamicgraph::sot::Dynamic::createJacobianSignal ( const std::string &  signame,
const std::string &   
)
void dynamicgraph::sot::Dynamic::createJoint ( const std::string &  inJointName,
const std::string &  inJointType,
const dg::Matrix inPosition 
)

create a joint

Parameters:
inJointNamename of the joint,
inJointTypetype of joint in ["freeflyer","rotation","translation","anchor"],
inPositionposition of the joint (4x4 matrix).
Note:
joints are stored in a map with names as keys for retrieval by other
dg::SignalTimeDependent< MatrixHomogeneous,int >& dynamicgraph::sot::Dynamic::createPositionSignal ( const std::string &  ,
const std::string &   
)
void dynamicgraph::sot::Dynamic::createRobot ( )

Create an empty device.

dg::SignalTimeDependent< dg::Vector,int >& dynamicgraph::sot::Dynamic::createVelocitySignal ( const std::string &  ,
const std::string &   
)
void dynamicgraph::sot::Dynamic::destroyAccelerationSignal ( const std::string &  signame)
void dynamicgraph::sot::Dynamic::destroyJacobianSignal ( const std::string &  signame)
void dynamicgraph::sot::Dynamic::destroyPositionSignal ( const std::string &  signame)
void dynamicgraph::sot::Dynamic::destroyVelocitySignal ( const std::string &  signame)
void dynamicgraph::sot::Dynamic::displayModel ( ) const [inline]
EIGEN_MAKE_ALIGNED_OPERATOR_NEW dynamicgraph::sot::Dynamic::DYNAMIC_GRAPH_ENTITY_DECL ( )
dg::Vector& dynamicgraph::sot::Dynamic::getLowerPositionLimits ( dg::Vector res,
const int &   
)

Get joint position lower limits.

Parameters:
[out]resultvector
Returns:
result vector
dg::Vector& dynamicgraph::sot::Dynamic::getMaxEffortLimits ( dg::Vector res,
const int &   
)

Get joint effort upper limits.

Parameters:
[out]resultvector
Returns:
result vector
dg::Vector& dynamicgraph::sot::Dynamic::getUpperPositionLimits ( dg::Vector res,
const int &   
)

Get joint position upper limits.

Parameters:
[out]resultvector
Returns:
result vector
dg::Vector& dynamicgraph::sot::Dynamic::getUpperVelocityLimits ( dg::Vector res,
const int &   
)

Get joint velocity upper limits.

Parameters:
[out]resultvector
Returns:
result vector
dg::SignalTimeDependent<dg::Matrix,int>& dynamicgraph::sot::Dynamic::jacobiansSOUT ( const std::string &  name)
void dynamicgraph::sot::Dynamic::parseUrdfFile ( void  )

parses a urdf filepath to create robot model.

Call setUrdfFile to give path

Parameters:
none.
Note:
creates a pinocchio model. needs urdfdom libraries to parse.
dg::SignalTimeDependent<MatrixHomogeneous,int>& dynamicgraph::sot::Dynamic::positionsSOUT ( const std::string &  name)
void dynamicgraph::sot::Dynamic::setDofBounds ( const std::string &  inJointName,
const unsigned int  inDofId,
const double  inMinValue,
double  inMaxValue 
)

Set the bounds of a joint degree of freedom.

Parameters:
thename of the joint
non-negativeinteger: the dof id in the joint
theminimal value of the dof
the maximal value of the dof
void dynamicgraph::sot::Dynamic::setInertiaMatrix ( const std::string &  inBodyName,
const dg::Matrix inertia3 
)

Set Inertia Matrix of the body.

Parameters:
inBodyNamename of the body whose properties are being set,
Inertiamatrix
void dynamicgraph::sot::Dynamic::setInertiaProperties ( const std::string &  inBodyName,
const double  mass,
const dg::Vector lever,
const dg::Matrix inertia3 
)

Set Inertia properties of a body.

Parameters:
inBodyNamename of the body whose properties are being set,
massmass of the body. default 0.
levercom position of the body. default zero vector,
inertia3inertia matrix of the body. default zero matrix.
void dynamicgraph::sot::Dynamic::setLocalCenterOfMass ( const std::string &  inBodyName,
const dg::Vector lever 
)

Set COM of the body in local frame.

Parameters:
inBodyNamename of the body whose properties are being set,
localCOM vector
void dynamicgraph::sot::Dynamic::setLowerPositionLimit ( const std::string &  inJointName,
const dg::Vector lowPos 
)

Set lower bound of joint position.

Parameters:
inJointNamename of the joint,
vectorcontaining lower limit bounds for all dofs of joint, or a double containing limits for a revolute joint.
void dynamicgraph::sot::Dynamic::setLowerPositionLimit ( const std::string &  inJointName,
const double  lowPos 
)
void dynamicgraph::sot::Dynamic::setMass ( const std::string &  inBodyName,
const double  mass = 0 
)

Set mass of a body.

Parameters:
inBodyNamename of the body whose properties are being set,
massmass of the body. default 0.
void dynamicgraph::sot::Dynamic::setMaxEffortLimit ( const std::string &  inJointName,
const dg::Vector maxEffort 
)

Set upper bound of joint effort.

Parameters:
inJointNamename of the joint,
maxEffortvector containing upper limit bounds for all dofs of joint, or a double containing limits for a revolute joint.
void dynamicgraph::sot::Dynamic::setMaxEffortLimit ( const std::string &  inJointName,
const double  maxEffort 
)
void dynamicgraph::sot::Dynamic::setMaxVelocityLimit ( const std::string &  inJointName,
const dg::Vector maxVel 
)

Set upper bound of joint velocities.

Parameters:
inJointNamename of the joint,
maxVelvector containing upper limit bounds for all dofs of joint, or a double containing limits for a revolute joint.
void dynamicgraph::sot::Dynamic::setMaxVelocityLimit ( const std::string &  inJointName,
const double  maxVel 
)
void dynamicgraph::sot::Dynamic::setUpperPositionLimit ( const std::string &  inJointName,
const dg::Vector upPos 
)

Set upper bound of joint position.

Parameters:
inJointNamename of the joint,
upPosvector containing upper limit bounds for all dofs of joint, or a double containing limits for a revolute joint.
void dynamicgraph::sot::Dynamic::setUpperPositionLimit ( const std::string &  inJointName,
const double  upPos 
)
void dynamicgraph::sot::Dynamic::setUrdfFile ( const std::string &  path)

sets a urdf filepath to create robot model.

Call parseUrdfFile to parse

Parameters:
pathfile location.
dg::SignalTimeDependent<dg::Vector,int>& dynamicgraph::sot::Dynamic::velocitiesSOUT ( const std::string &  name)

Friends And Related Function Documentation

friend class sot::command::CreateOpPoint [friend]
friend class sot::command::SetFile [friend]

Member Data Documentation