se3::Model Class Reference

#include <multibody/model.hpp>

Collaboration diagram for se3::Model:
[legend]

List of all members.

Public Types

typedef se3::JointIndex JointIndex
typedef se3::GeomIndex GeomIndex
typedef se3::FrameIndex FrameIndex

Public Member Functions

 Model ()
 Default constructor.
 ~Model ()
template<typename D >
JointIndex addBody (JointIndex parent, const JointModelBase< D > &j, const SE3 &placement, const Inertia &Y, const std::string &jointName="", const std::string &bodyName="", bool visual=false)
 Add a body to the kinematic tree.
template<typename D >
JointIndex addBody (JointIndex parent, const JointModelBase< D > &j, const SE3 &placement, const Inertia &Y, const Eigen::VectorXd &effort, const Eigen::VectorXd &velocity, const Eigen::VectorXd &lowPos, const Eigen::VectorXd &upPos, const std::string &jointName="", const std::string &bodyName="", bool visual=false)
 Add a body to the kinematic tree.
JointIndex addFixedBody (JointIndex fix_lastMovingParent, const SE3 &placementFromLastMoving, const std::string &jointName="", bool visual=false)
 Need modifications.
void mergeFixedBody (const JointIndex parent, const SE3 &placement, const Inertia &Y)
 Merge a body to a parent body in the kinematic tree.
JointIndex getBodyId (const std::string &name) const
 Return the index of a body given by its name.
bool existBodyName (const std::string &name) const
 Check if a body given by its name exists.
const std::string & getBodyName (const JointIndex index) const
 Get the name of a body given by its index.
JointIndex getJointId (const std::string &name) const
 Return the index of a joint given by its name.
bool existJointName (const std::string &name) const
 Check if a joint given by its name exists.
const std::string & getJointName (const JointIndex index) const
 Get the name of a joint given by its index.
FrameIndex getFrameId (const std::string &name) const
 Return the index of a frame given by its name.
bool existFrame (const std::string &name) const
 Check if a frame given by its name exists.
const std::string & getFrameName (const FrameIndex index) const
 Get the name of a frame given by its index.
JointIndex getFrameParent (const std::string &name) const
 Get the index of the joint supporting the frame given by its name.
JointIndex getFrameParent (const FrameIndex index) const
 Get the index of the joint supporting the frame given by its index.
const SE3getFramePlacement (const std::string &name) const
 Return the relative placement between a frame and its supporting joint.
const SE3getFramePlacement (const FrameIndex index) const
 Return the relative placement between a frame and its supporting joint.
bool addFrame (const Frame &frame)
 Add a frame to the kinematic tree.
bool addFrame (const std::string &name, const JointIndex parent, const SE3 &placement)
 Create and add a frame to the kinematic tree.

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef se3::Index 
Index
int nq
 Dimension of the configuration vector representation.
int nv
 Dimension of the velocity vector space.
int nbody
 Number of bodies (= number of joints + 1).
int nFixBody
 Number of fixed-bodies (= number of fixed-joints).
int nOperationalFrames
 Number of operational frames.
std::vector< Inertiainertias
 Spatial inertias of the body expressed in the supporting joint frame .
std::vector< SE3jointPlacements
 Placement (SE3) of the input of joint regarding to the parent joint output .
JointModelVector joints
 Model of joint .
std::vector< JointIndexparents
 Joint parent of joint , denoted (li==parents[i]).
std::vector< std::string > names
 Name of joint
std::vector< std::string > bodyNames
 Name of the body attached to the output of joint .
Eigen::VectorXd effortLimit
 Vector of maximal joint torques.
Eigen::VectorXd velocityLimit
 Vector of maximal joint velocities.
Eigen::VectorXd lowerPositionLimit
 Lower joint configuration limit.
Eigen::VectorXd upperPositionLimit
 Upper joint configuration limit.
std::vector< bool > hasVisual
 True iff body has a visual mesh.
std::vector< SE3fix_lmpMi
 Fixed-body relative placement (wrt last moving parent)
std::vector< Model::JointIndexfix_lastMovingParent
 Fixed-body index of the last moving parent.
std::vector< bool > fix_hasVisual
 True iff fixed-body has a visual mesh.
std::vector< std::string > fix_bodyNames
 Name of fixed-joint .
std::vector< Frameoperational_frames
 Vector of operational frames registered on the model.
Motion gravity
 Spatial gravity.

Static Public Attributes

static const Eigen::Vector3d gravity981
 Default 3D gravity vector (=(0,0,-9.81)).

Member Typedef Documentation


Constructor & Destructor Documentation

se3::Model::Model ( ) [inline]

Default constructor.

se3::Model::~Model ( ) [inline]

Member Function Documentation

template<typename D >
JointIndex se3::Model::addBody ( JointIndex  parent,
const JointModelBase< D > &  j,
const SE3 placement,
const Inertia Y,
const std::string &  jointName = "",
const std::string &  bodyName = "",
bool  visual = false 
)

Add a body to the kinematic tree.

Parameters:
[in]parentIndex of the parent joint.
[in]jThe joint model.
[in]placementThe relative placement of the joint j regarding to the parent joint.
[in]YSpatial inertia of the body.
[in]jointNameName of the joint.
[in]bodyNameName of the body.
[in]visualInform if the current body has a visual or not.
Returns:
The index of the new added joint.

Referenced by se3::buildModels::humanoid2d(), se3::buildModels::humanoidSimple(), and se3::lua::LuaModelReadFromTable().

template<typename D >
JointIndex se3::Model::addBody ( JointIndex  parent,
const JointModelBase< D > &  j,
const SE3 placement,
const Inertia Y,
const Eigen::VectorXd &  effort,
const Eigen::VectorXd &  velocity,
const Eigen::VectorXd &  lowPos,
const Eigen::VectorXd &  upPos,
const std::string &  jointName = "",
const std::string &  bodyName = "",
bool  visual = false 
)

Add a body to the kinematic tree.

Parameters:
[in]parentIndex of the parent joint.
[in]jThe joint model.
[in]placementThe relative placement of the joint j regarding to the parent joint.
[in]YSpatial inertia of the body.
[in]effortMaximal joint torque.
[in]velocityMaximal joint velocity.
[in]lowPosLower joint configuration.
[in]upPosUpper joint configuration.
[in]jointNameName of the joint.
[in]bodyNameName of the body.
[in]visualInform if the current body has a visual or not.
Returns:
The index of the new added joint.
JointIndex se3::Model::addFixedBody ( JointIndex  fix_lastMovingParent,
const SE3 placementFromLastMoving,
const std::string &  jointName = "",
bool  visual = false 
)

Need modifications.

Add a body to the kinematic tree.

Parameters:
[in]fix_lastMovingParentIndex of the closest movable parent joint.
[in]placementFromLastMovingPlacement regarding to the closest movable parent joint.
[in]jointNameName of the joint.
[in]visualInform if the current body has a visual or not.
Returns:
The index of the new added joint.

Referenced by se3::lua::LuaModelReadFromTable().

bool se3::Model::addFrame ( const Frame frame)

Add a frame to the kinematic tree.

Parameters:
[in]frameThe frame to add to the kinematic tree.
Returns:
Return true if the frame has been successfully added.
bool se3::Model::addFrame ( const std::string &  name,
const JointIndex  parent,
const SE3 placement 
)

Create and add a frame to the kinematic tree.

Parameters:
[in]nameName of the frame.
[in]parentIndex of the supporting joint.
[in]placementPlacement of the frame regarding to the joint frame.
Returns:
Return true if the frame has been successfully added.
bool se3::Model::existBodyName ( const std::string &  name) const

Check if a body given by its name exists.

Parameters:
[in]nameName of the body.
Returns:
True if the body exists in the kinematic tree.
bool se3::Model::existFrame ( const std::string &  name) const

Check if a frame given by its name exists.

Parameters:
[in]nameName of the frame.
Returns:
Return true if the frame exists.
bool se3::Model::existJointName ( const std::string &  name) const

Check if a joint given by its name exists.

Parameters:
[in]nameName of the joint.
Returns:
True if the joint exists in the kinematic tree.
JointIndex se3::Model::getBodyId ( const std::string &  name) const

Return the index of a body given by its name.

Parameters:
[in]nameName of the body.
Returns:
Index of the body.

Referenced by se3::buildModels::humanoid2d(), and se3::buildModels::humanoidSimple().

const std::string& se3::Model::getBodyName ( const JointIndex  index) const

Get the name of a body given by its index.

Parameters:
[in]indexIndex of the body.
Returns:
Name of the body.
FrameIndex se3::Model::getFrameId ( const std::string &  name) const

Return the index of a frame given by its name.

Parameters:
[in]indexIndex of the frame.
Returns:
Index of the frame.
const std::string& se3::Model::getFrameName ( const FrameIndex  index) const

Get the name of a frame given by its index.

Parameters:
[in]indexIndex of the frame.
Returns:
The name of the frame.
JointIndex se3::Model::getFrameParent ( const std::string &  name) const

Get the index of the joint supporting the frame given by its name.

Parameters:
[in]nameName of the frame.
Returns:
JointIndex se3::Model::getFrameParent ( const FrameIndex  index) const

Get the index of the joint supporting the frame given by its index.

Parameters:
[in]indexIndex of the frame.
Returns:
const SE3& se3::Model::getFramePlacement ( const std::string &  name) const

Return the relative placement between a frame and its supporting joint.

Parameters:
[in]nameName of the frame.
Returns:
The frame placement regarding the supporing joint.
const SE3& se3::Model::getFramePlacement ( const FrameIndex  index) const

Return the relative placement between a frame and its supporting joint.

Parameters:
[in]indexIndex of the frame.
Returns:
The frame placement regarding the supporing joint.
JointIndex se3::Model::getJointId ( const std::string &  name) const

Return the index of a joint given by its name.

Parameters:
[in]indexIndex of the joint.
Returns:
Index of the joint.
const std::string& se3::Model::getJointName ( const JointIndex  index) const

Get the name of a joint given by its index.

Parameters:
[in]indexIndex of the joint.
Returns:
Name of the joint.
void se3::Model::mergeFixedBody ( const JointIndex  parent,
const SE3 placement,
const Inertia Y 
)

Merge a body to a parent body in the kinematic tree.

Parameters:
[in]parentIndex of the parent body to merge with.
[in]placementRelative placement between the body and its parent body.
[in]YSpatial inertia of the body.

Referenced by se3::lua::LuaModelReadFromTable().


Member Data Documentation

std::vector<std::string> se3::Model::bodyNames

Name of the body attached to the output of joint .

Eigen::VectorXd se3::Model::effortLimit

Vector of maximal joint torques.

std::vector<std::string> se3::Model::fix_bodyNames

Name of fixed-joint .

std::vector<bool> se3::Model::fix_hasVisual

True iff fixed-body has a visual mesh.

Fixed-body index of the last moving parent.

std::vector<SE3> se3::Model::fix_lmpMi

Fixed-body relative placement (wrt last moving parent)

const Eigen::Vector3d se3::Model::gravity981 [static]

Default 3D gravity vector (=(0,0,-9.81)).

std::vector<bool> se3::Model::hasVisual

True iff body has a visual mesh.

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef se3::Index se3::Model::Index

Spatial inertias of the body expressed in the supporting joint frame .

Referenced by se3::CATForwardStep::algo(), se3::kineticEnergy(), and se3::potentialEnergy().

Placement (SE3) of the input of joint regarding to the parent joint output .

Referenced by se3::ForwardKinematicZeroStep::algo(), se3::CATForwardStep::algo(), se3::ForwardKinematicFirstStep::algo(), and se3::ForwardKinematicSecondStep::algo().

Lower joint configuration limit.

Referenced by se3::randomConfiguration().

std::vector<std::string> se3::Model::names

Name of joint

Number of fixed-bodies (= number of fixed-joints).

Number of operational frames.

Referenced by se3::framesForwardKinematics().

Dimension of the velocity vector space.

Referenced by se3::differentiate(), se3::forwardDynamics(), se3::forwardKinematics(), and se3::impulseDynamics().

Vector of operational frames registered on the model.

Referenced by se3::framesForwardKinematics(), and se3::getFrameJacobian().

Upper joint configuration limit.

Referenced by se3::randomConfiguration().

Eigen::VectorXd se3::Model::velocityLimit

Vector of maximal joint velocities.