19 #ifndef __se3_model_hpp__ 20 #define __se3_model_hpp__ 22 #include "pinocchio/spatial/fwd.hpp" 23 #include "pinocchio/spatial/se3.hpp" 24 #include "pinocchio/spatial/force.hpp" 25 #include "pinocchio/spatial/motion.hpp" 26 #include "pinocchio/spatial/inertia.hpp" 27 #include "pinocchio/multibody/fwd.hpp" 28 #include "pinocchio/multibody/frame.hpp" 29 #include "pinocchio/multibody/joint/joint.hpp" 30 #include "pinocchio/deprecated.hh" 31 #include "pinocchio/utils/string-generator.hpp" 32 #include "pinocchio/container/aligned-vector.hpp" 35 #include <Eigen/Cholesky> 41 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
42 typedef se3::Index Index;
43 typedef se3::JointIndex JointIndex;
44 typedef se3::GeomIndex GeomIndex;
45 typedef se3::FrameIndex FrameIndex;
46 typedef std::vector<Index> IndexVector;
122 , jointPlacements(1,
SE3::Identity())
127 , gravity( gravity981,Eigen::Vector3d::Zero() )
129 names[0] =
"universe";
133 addFrame(
Frame(
"universe", 0, 0, SE3::Identity(), FIXED_JOINT));
135 inertias[0].mass() = std::numeric_limits<double>::quiet_NaN();
136 inertias[0].lever().fill (std::numeric_limits<double>::quiet_NaN());
137 inertias[0].inertia().fill (std::numeric_limits<double>::quiet_NaN());
163 template<
typename Jo
intModelDerived>
165 const std::string & joint_name,
166 const Eigen::VectorXd & max_effort,
167 const Eigen::VectorXd & max_velocity,
168 const Eigen::VectorXd & min_config,
169 const Eigen::VectorXd & max_config
189 template<
typename Jo
intModelDerived>
191 const std::string & joint_name
204 int frameIndex = -1);
216 const SE3 & body_placement = SE3::Identity());
230 const JointIndex & parentJoint,
231 const SE3 & body_placement = SE3::Identity(),
232 int previousFrame = -1);
245 JointIndex
getBodyId(
const std::string & name)
const;
267 JointIndex
getJointId(
const std::string & name)
const;
285 PINOCCHIO_DEPRECATED
const std::string &
getJointName(
const JointIndex index)
const;
300 FrameIndex
getFrameId (
const std::string & name,
const FrameType& type = (
FrameType) (JOINT | FIXED_JOINT | BODY | OP_FRAME | SENSOR ))
const;
310 bool existFrame (
const std::string & name,
const FrameType& type = (
FrameType) (JOINT | FIXED_JOINT | BODY | OP_FRAME | SENSOR ))
const;
332 {
return checker.checkModel(*
this); }
335 inline bool check()
const;
342 inline bool check(
const Data & data)
const;
358 #include "pinocchio/multibody/model.hxx" 360 #endif // ifndef __se3_model_hpp__ std::string name
Model name;.
PINOCCHIO_DEPRECATED const std::string & getJointName(const JointIndex index) const
Get the name of a joint given by its index.
bool existJointName(const std::string &name) const
Check if a joint given by its name exists.
Eigen::VectorXd lowerPositionLimit
Lower joint configuration limit.
int nq
Dimension of the configuration vector representation.
int nv
Dimension of the velocity vector space.
container::aligned_vector< SE3 > jointPlacements
Placement (SE3) of the input of joint i regarding to the parent joint output li.
Eigen::VectorXd effortLimit
Vector of maximal joint torques.
container::aligned_vector< Frame > frames
Vector of operational frames registered on the model.
int addFrame(const Frame &frame)
Adds a frame to the kinematic tree.
Eigen::VectorXd rotorGearRatio
Vector of rotor gear ratio parameters.
JointModelVector joints
Model of joint i, encapsulated in a JointModelAccessor.
FrameIndex getFrameId(const std::string &name, const FrameType &type=(FrameType)(JOINT|FIXED_JOINT|BODY|OP_FRAME|SENSOR)) const
Returns the index of a frame given by its name.
std::vector< IndexVector > subtrees
Vector of subtrees. subtree[j] corresponds to the subtree supported by the joint j. The first element of subtree[j] is the index of the joint j itself.
void addJointIndexToParentSubtrees(const JointIndex joint_id)
Add the joint_id to its parent subtrees.
Eigen::VectorXd neutralConfiguration
Vector of joint's neutral configurations.
void appendBodyToJoint(const JointIndex joint_index, const Inertia &Y, const SE3 &body_placement=SE3::Identity())
Append a body to a given joint of the kinematic tree.
Eigen::VectorXd rotorInertia
Vector of rotor inertia parameters.
CRTP class describing the API of the checkers.
std::vector< JointIndex > parents
Joint parent of joint i, denoted li (li==parents[i]).
Eigen::VectorXd upperPositionLimit
Upper joint configuration limit.
static const Eigen::Vector3d gravity981
Default 3D gravity vector (=(0,0,-9.81)).
bool check() const
Run check(fusion::list) with DEFAULT_CHECKERS as argument.
int nbodies
Number of bodies.
A Plucker coordinate frame attached to a parent joint inside a kinematic tree.
Model()
Default constructor. Builds an empty model with no joints.
Motion gravity
Spatial gravity of the model.
bool check(const AlgorithmCheckerBase< D > &checker=AlgorithmCheckerBase< D >()) const
container::aligned_vector< Inertia > inertias
Spatial inertias of the body i expressed in the supporting joint frame i.
bool existBodyName(const std::string &name) const
Check if a body given by its name exists.
Specialization of an std::vector with an aligned allocator. This specialization might be used when th...
int addJointFrame(const JointIndex &jointIndex, int frameIndex=-1)
Add a joint to the frame tree.
bool existFrame(const std::string &name, const FrameType &type=(FrameType)(JOINT|FIXED_JOINT|BODY|OP_FRAME|SENSOR)) const
Checks if a frame given by its name exists.
FrameType
Enum on the possible types of frame.
int njoints
Number of joints.
std::vector< std::string > names
Name of joint i
JointIndex getJointId(const std::string &name) const
Return the index of a joint given by its name.
Eigen::VectorXd velocityLimit
Vector of maximal joint velocities.
int addBodyFrame(const std::string &body_name, const JointIndex &parentJoint, const SE3 &body_placement=SE3::Identity(), int previousFrame=-1)
Add a body to the frame tree.
JointIndex addJoint(const JointIndex parent, const JointModelBase< JointModelDerived > &joint_model, const SE3 &joint_placement, const std::string &joint_name, const Eigen::VectorXd &max_effort, const Eigen::VectorXd &max_velocity, const Eigen::VectorXd &min_config, const Eigen::VectorXd &max_config)
Add a joint to the kinematic tree with given bounds.
JointIndex getBodyId(const std::string &name) const
Return the index of a body given by its name.
int nframes
Number of operational frames.