19 #ifndef __se3_data_hxx__ 20 #define __se3_data_hxx__ 22 #include "pinocchio/spatial/fwd.hpp" 23 #include "pinocchio/multibody/model.hpp" 24 #include "pinocchio/utils/string-generator.hpp" 25 #include "pinocchio/multibody/liegroup/liegroup-algo.hpp" 27 #include <boost/bind.hpp> 28 #include <boost/utility.hpp> 37 , a((
std::size_t)model.njoints)
38 , oa((
std::size_t)model.njoints)
39 , a_gf((
std::size_t)model.njoints)
40 , v((
std::size_t)model.njoints)
41 , ov((
std::size_t)model.njoints)
42 , f((
std::size_t)model.njoints)
43 , of((
std::size_t)model.njoints)
44 , h((
std::size_t)model.njoints)
45 , oh((
std::size_t)model.njoints)
46 , oMi((
std::size_t)model.njoints)
47 , liMi((
std::size_t)model.njoints)
51 , oMf((
std::size_t)model.nframes)
52 , Ycrb((
std::size_t)model.njoints)
53 , dYcrb((
std::size_t)model.njoints)
54 , M(model.
nv,model.
nv)
55 , Minv(model.
nv,model.
nv)
56 , C(model.
nv,model.
nv)
63 , vxI((
std::size_t)model.njoints)
64 , Ivx((
std::size_t)model.njoints)
65 , oYcrb((
std::size_t)model.njoints)
66 , doYcrb((
std::size_t)model.njoints)
68 , Yaba((
std::size_t)model.njoints)
72 , Fcrb((
std::size_t)model.njoints)
73 , lastChild((
std::size_t)model.njoints)
74 , nvSubtree((
std::size_t)model.njoints)
75 , U(model.
nv,model.
nv)
79 , parents_fromRow((
std::size_t)model.
nv)
80 , nvSubtree_fromRow((
std::size_t)model.
nv)
86 , dtau_dq(Eigen::MatrixXd::Zero(model.
nv,model.
nv))
87 , dtau_dv(Eigen::MatrixXd::Zero(model.
nv,model.
nv))
88 , ddq_dq(Eigen::MatrixXd::Zero(model.
nv,model.
nv))
89 , ddq_dv(Eigen::MatrixXd::Zero(model.
nv,model.
nv))
90 , iMf((
std::size_t)model.njoints)
91 , com((
std::size_t)model.njoints)
92 , vcom((
std::size_t)model.njoints)
93 , acom((
std::size_t)model.njoints)
94 , mass((
std::size_t)model.njoints)
99 , sDUiJt(model.
nv,model.
nv)
100 , torque_residual(model.
nv)
103 , staticRegressor(3,4*(model.njoints-1))
106 for(Model::Index i=0;i<(Model::JointIndex)(model.
njoints);++i)
107 joints.push_back(CreateJointData::run(model.
joints[i]));
110 M.fill(0);
Minv.setZero();
111 for(Model::Index i=0;i<(Model::Index)(model.
njoints);++i ) {
Fcrb[i].resize(6,model.
nv); }
112 computeLastChild(model);
119 computeParents_fromRow(model);
134 oMi[0].setIdentity();
135 liMi[0].setIdentity();
136 oMf[0].setIdentity();
139 inline void Data::computeLastChild(
const Model & model)
141 typedef Model::Index Index;
143 for(
int i=model.
njoints-1;i>=0;--i )
146 const Index & parent = model.
parents[(Index)i];
155 inline void Data::computeParents_fromRow(
const Model & model)
157 for( Model::Index joint=1;joint<(Model::Index)(model.
njoints);joint++)
159 const Model::Index & parent = model.
parents[joint];
160 const int nvj =
nv (model.
joints[joint]);
167 for(
int row=1;row<nvj;++row)
179 #endif // ifndef __se3_data_hxx__ Matrix6x Ag
Centroidal Momentum Matrix.
container::aligned_vector< Motion > a
Vector of joint accelerations expressed at the centers of the joints.
int nv
Dimension of the velocity vector space.
std::vector< int > nvSubtree
Dimension of the subtree motion space (for CRBA)
Data(const Model &model)
Default constructor of se3::Data from a se3::Model.
JointModelVector joints
Model of joint i, encapsulated in a JointModelAccessor.
Matrix6x J
Jacobian of joint placements.
container::aligned_vector< Motion > oa
Vector of joint accelerations expressed at the origin.
std::vector< int > nvSubtree_fromRow
Subtree of the current row index (used in Cholesky Decomposition).
std::vector< JointIndex > parents
Joint parent of joint i, denoted li (li==parents[i]).
int nv(const JointModelVariant &jmodel)
Visit a JointModelVariant through JointNvVisitor to get the dimension of the joint tangent space...
container::aligned_vector< Motion > ov
Vector of joint velocities expressed at the origin.
container::aligned_vector< Matrix6x > Fcrb
Spatial forces set, used in CRBA and CCRBA.
container::aligned_vector< Motion > a_gf
Vector of joint accelerations due to the gravity field.
JointDataVector joints
Vector of se3::JointData associated to the se3::JointModel stored in model, encapsulated in JointData...
Motion gravity
Spatial gravity of the model.
Eigen::MatrixXd M
The joint space inertia matrix (a square matrix of dim model.nv).
Eigen::MatrixXd U
Joint space intertia matrix square root (upper trianglular part) computed with a Cholesky Decompositi...
container::aligned_vector< SE3 > oMf
Vector of absolute operationnel frame placements (wrt the world).
container::aligned_vector< SE3 > liMi
Vector of relative joint placements (wrt the body parent).
container::aligned_vector< SE3 > oMi
Vector of absolute joint placements (wrt the world).
int idx_v(const JointModelVariant &jmodel)
Visit a JointModelVariant through JointIdxVVisitor to get the index in the full model tangent space c...
RowMatrixXd Minv
The inverse of the joint space inertia matrix (a square matrix of dim model.nv).
container::aligned_vector< Force > f
Vector of body forces expressed in the local frame of the joint. For each body, the force represents ...
std::vector< int > parents_fromRow
First previous non-zero row in M (used in Cholesky Decomposition).
container::aligned_vector< Motion > v
Vector of joint velocities expressed at the centers of the joints.
int njoints
Number of joints.
container::aligned_vector< Force > h
Vector of spatial momenta expressed in the local frame of the joint.
Eigen::MatrixXd C
The Coriolis matrix (a square matrix of dim model.nv).
std::vector< int > lastChild
Index of the last child (for CRBA)