#include <multibody/model.hpp>
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 SE3 & | getFramePlacement (const std::string &name) const |
Return the relative placement between a frame and its supporting joint. | |
const SE3 & | getFramePlacement (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< Inertia > | inertias |
Spatial inertias of the body expressed in the supporting joint frame . | |
std::vector< SE3 > | jointPlacements |
Placement (SE3) of the input of joint regarding to the parent joint output . | |
JointModelVector | joints |
Model of joint . | |
std::vector< JointIndex > | parents |
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< SE3 > | fix_lmpMi |
Fixed-body relative placement (wrt last moving parent) | |
std::vector< Model::JointIndex > | fix_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< Frame > | operational_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)). |
typedef se3::GeomIndex se3::Model::GeomIndex |
se3::Model::Model | ( | ) | [inline] |
Default constructor.
se3::Model::~Model | ( | ) | [inline] |
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.
[in] | parent | Index of the parent joint. |
[in] | j | The joint model. |
[in] | placement | The relative placement of the joint j regarding to the parent joint. |
[in] | Y | Spatial inertia of the body. |
[in] | jointName | Name of the joint. |
[in] | bodyName | Name of the body. |
[in] | visual | Inform if the current body has a visual or not. |
Referenced by se3::buildModels::humanoid2d(), se3::buildModels::humanoidSimple(), and se3::lua::LuaModelReadFromTable().
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.
[in] | parent | Index of the parent joint. |
[in] | j | The joint model. |
[in] | placement | The relative placement of the joint j regarding to the parent joint. |
[in] | Y | Spatial inertia of the body. |
[in] | effort | Maximal joint torque. |
[in] | velocity | Maximal joint velocity. |
[in] | lowPos | Lower joint configuration. |
[in] | upPos | Upper joint configuration. |
[in] | jointName | Name of the joint. |
[in] | bodyName | Name of the body. |
[in] | visual | Inform if the current body has a visual or not. |
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.
[in] | fix_lastMovingParent | Index of the closest movable parent joint. |
[in] | placementFromLastMoving | Placement regarding to the closest movable parent joint. |
[in] | jointName | Name of the joint. |
[in] | visual | Inform if the current body has a visual or not. |
Referenced by se3::lua::LuaModelReadFromTable().
bool se3::Model::addFrame | ( | const Frame & | frame | ) |
Add a frame to the kinematic tree.
[in] | frame | The frame to add to the kinematic tree. |
bool se3::Model::addFrame | ( | const std::string & | name, |
const JointIndex | parent, | ||
const SE3 & | placement | ||
) |
Create and add a frame to the kinematic tree.
[in] | name | Name of the frame. |
[in] | parent | Index of the supporting joint. |
[in] | placement | Placement of the frame regarding to the joint frame. |
bool se3::Model::existBodyName | ( | const std::string & | name | ) | const |
Check if a body given by its name exists.
[in] | name | Name of the body. |
bool se3::Model::existFrame | ( | const std::string & | name | ) | const |
Check if a frame given by its name exists.
[in] | name | Name of the frame. |
bool se3::Model::existJointName | ( | const std::string & | name | ) | const |
Check if a joint given by its name exists.
[in] | name | Name of the joint. |
JointIndex se3::Model::getBodyId | ( | const std::string & | name | ) | const |
Return the index of a body given by its name.
[in] | name | Name 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.
[in] | index | Index of the body. |
FrameIndex se3::Model::getFrameId | ( | const std::string & | name | ) | const |
Return the index of a frame given by its name.
[in] | index | Index of the frame. |
const std::string& se3::Model::getFrameName | ( | const FrameIndex | index | ) | const |
Get the name of a frame given by its index.
[in] | index | Index 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.
[in] | name | Name of the frame. |
JointIndex se3::Model::getFrameParent | ( | const FrameIndex | index | ) | const |
Get the index of the joint supporting the frame given by its index.
[in] | index | Index of the frame. |
const SE3& se3::Model::getFramePlacement | ( | const std::string & | name | ) | const |
Return the relative placement between a frame and its supporting joint.
[in] | name | Name of the frame. |
const SE3& se3::Model::getFramePlacement | ( | const FrameIndex | index | ) | const |
Return the relative placement between a frame and its supporting joint.
[in] | index | Index of the frame. |
JointIndex se3::Model::getJointId | ( | const std::string & | name | ) | const |
Return the index of a joint given by its name.
[in] | index | Index of the joint. |
const std::string& se3::Model::getJointName | ( | const JointIndex | index | ) | const |
Get the name of a joint given by its index.
[in] | index | Index 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.
[in] | parent | Index of the parent body to merge with. |
[in] | placement | Relative placement between the body and its parent body. |
[in] | Y | Spatial inertia of the body. |
Referenced by se3::lua::LuaModelReadFromTable().
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.
std::vector<Model::JointIndex> se3::Model::fix_lastMovingParent |
Fixed-body index of the last moving parent.
std::vector<SE3> se3::Model::fix_lmpMi |
Fixed-body relative placement (wrt last moving parent)
Spatial gravity.
Referenced by se3::computeAllTerms(), se3::lua::LuaModelReadFromTable(), and se3::potentialEnergy().
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 |
Referenced by se3::python::ModelPythonVisitor::index().
std::vector<Inertia> se3::Model::inertias |
Spatial inertias of the body expressed in the supporting joint frame .
Referenced by se3::CATForwardStep::algo(), se3::kineticEnergy(), and se3::potentialEnergy().
std::vector<SE3> se3::Model::jointPlacements |
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().
Eigen::VectorXd se3::Model::lowerPositionLimit |
Lower joint configuration limit.
Referenced by se3::randomConfiguration().
std::vector<std::string> se3::Model::names |
Name of joint
Number of bodies (= number of joints + 1).
Referenced by se3::computeAllTerms(), se3::differentiate(), se3::distance(), se3::emptyForwardPass(), se3::forwardKinematics(), se3::integrate(), se3::interpolate(), se3::kineticEnergy(), se3::potentialEnergy(), and se3::randomConfiguration().
Number of fixed-bodies (= number of fixed-joints).
Number of operational frames.
Referenced by se3::framesForwardKinematics().
int se3::Model::nq |
Dimension of the configuration vector representation.
Referenced by se3::forwardDynamics(), se3::forwardKinematics(), se3::impulseDynamics(), se3::integrate(), se3::interpolate(), and se3::randomConfiguration().
int se3::Model::nv |
Dimension of the velocity vector space.
Referenced by se3::differentiate(), se3::forwardDynamics(), se3::forwardKinematics(), and se3::impulseDynamics().
std::vector<Frame> se3::Model::operational_frames |
Vector of operational frames registered on the model.
Referenced by se3::framesForwardKinematics(), and se3::getFrameJacobian().
std::vector<JointIndex> se3::Model::parents |
Joint parent of joint , denoted (li==parents[i]).
Referenced by se3::ForwardKinematicZeroStep::algo(), se3::CATForwardStep::algo(), se3::ForwardKinematicFirstStep::algo(), se3::CATBackwardStep::algo(), and se3::ForwardKinematicSecondStep::algo().
Eigen::VectorXd se3::Model::upperPositionLimit |
Upper joint configuration limit.
Referenced by se3::randomConfiguration().
Eigen::VectorXd se3::Model::velocityLimit |
Vector of maximal joint velocities.