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>
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::Vector & | getLowerPositionLimits (dg::Vector &res, const int &) |
Get joint position lower limits. | |
dg::Vector & | getUpperPositionLimits (dg::Vector &res, const int &) |
Get joint position upper limits. | |
dg::Vector & | getUpperVelocityLimits (dg::Vector &res, const int &) |
Get joint velocity upper limits. | |
dg::Vector & | getMaxEffortLimits (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::Matrix & | computeGenericJacobian (bool isFrame, int jointId, dg::Matrix &res, int time) |
dg::Matrix & | computeGenericEndeffJacobian (bool isFrame, int jointId, dg::Matrix &res, int time) |
MatrixHomogeneous & | computeGenericPosition (bool isFrame, int jointId, MatrixHomogeneous &res, int time) |
dg::Vector & | computeGenericVelocity (int jointId, dg::Vector &res, int time) |
dg::Vector & | computeGenericAcceleration (int jointId, dg::Vector &res, int time) |
dg::Vector & | computeZmp (dg::Vector &res, int time) |
dg::Vector & | computeMomenta (dg::Vector &res, int time) |
dg::Vector & | computeAngularMomentum (dg::Vector &res, int time) |
dg::Matrix & | computeJcom (dg::Matrix &res, int time) |
dg::Vector & | computeCom (dg::Vector &res, int time) |
dg::Matrix & | computeInertia (dg::Matrix &res, int time) |
dg::Matrix & | computeInertiaReal (dg::Matrix &res, int time) |
double & | computeFootHeight (double &res, int time) |
dg::Vector & | computeTorqueDrift (dg::Vector &res, const int &time) |
Friends | |
class | sot::command::SetFile |
class | sot::command::CreateOpPoint |
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.
typedef int dynamicgraph::sot::Dynamic::Dummy |
dynamicgraph::sot::Dynamic::Dynamic | ( | const std::string & | name | ) |
virtual dynamicgraph::sot::Dynamic::~Dynamic | ( | void | ) | [virtual] |
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.
inParentName | name of the body to which a child is added. |
inJointName | name of the joint added. |
inChildName | name of the body added. |
mass | mass of the child body. default 0. |
lever | com position of the body. default zero vector. |
inertia3 | matrix 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.
inParentName | name of the body to which a child is added. |
inJointName | name of the joint added. |
inChildName | name of the body added. |
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
inJointName | name of the joint, |
inJointType | type of joint in ["freeflyer","rotation","translation","anchor"], |
inPosition | position of the joint (4x4 matrix). |
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.
[out] | result | vector |
dg::Vector& dynamicgraph::sot::Dynamic::getMaxEffortLimits | ( | dg::Vector & | res, |
const int & | |||
) |
Get joint effort upper limits.
[out] | result | vector |
dg::Vector& dynamicgraph::sot::Dynamic::getUpperPositionLimits | ( | dg::Vector & | res, |
const int & | |||
) |
Get joint position upper limits.
[out] | result | vector |
dg::Vector& dynamicgraph::sot::Dynamic::getUpperVelocityLimits | ( | dg::Vector & | res, |
const int & | |||
) |
Get joint velocity upper limits.
[out] | 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
none. |
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.
the | name of the joint |
non-negative | integer: the dof id in the joint |
the | minimal 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.
inBodyName | name of the body whose properties are being set, |
Inertia | matrix |
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.
inBodyName | name of the body whose properties are being set, |
mass | mass of the body. default 0. |
lever | com position of the body. default zero vector, |
inertia3 | inertia 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.
inBodyName | name of the body whose properties are being set, |
local | COM vector |
void dynamicgraph::sot::Dynamic::setLowerPositionLimit | ( | const std::string & | inJointName, |
const dg::Vector & | lowPos | ||
) |
Set lower bound of joint position.
inJointName | name of the joint, |
vector | containing 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.
inBodyName | name of the body whose properties are being set, |
mass | mass of the body. default 0. |
void dynamicgraph::sot::Dynamic::setMaxEffortLimit | ( | const std::string & | inJointName, |
const dg::Vector & | maxEffort | ||
) |
Set upper bound of joint effort.
inJointName | name of the joint, |
maxEffort | vector 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.
inJointName | name of the joint, |
maxVel | vector 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.
inJointName | name of the joint, |
upPos | vector 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
path | file location. |
dg::SignalTimeDependent<dg::Vector,int>& dynamicgraph::sot::Dynamic::velocitiesSOUT | ( | const std::string & | name | ) |
friend class sot::command::CreateOpPoint [friend] |
friend class sot::command::SetFile [friend] |
std::list< dg::SignalBase<int>* > dynamicgraph::sot::Dynamic::genericSignalRefs |
se3::Data* dynamicgraph::sot::Dynamic::m_data |
se3::Model dynamicgraph::sot::Dynamic::m_model |
std::string dynamicgraph::sot::Dynamic::m_urdfPath |