5#ifndef __pinocchio_serialization_joints_model_hpp__ 6#define __pinocchio_serialization_joints_model_hpp__ 10 template<
typename Scalar,
int Options,
template<
typename S,
int O>
class JointCollectionTpl>
13 template<
typename Archive>
17 using boost::serialization::make_nvp;
19 ar & make_nvp(
"m_nq", joint.
m_nq);
20 ar & make_nvp(
"m_nv", joint.m_nv);
21 ar & make_nvp(
"m_nvExtended", joint.m_nvExtended);
22 ar & make_nvp(
"m_idx_q", joint.
m_idx_q);
23 ar & make_nvp(
"m_nqs", joint.
m_nqs);
24 ar & make_nvp(
"m_idx_v", joint.
m_idx_v);
25 ar & make_nvp(
"m_nvs", joint.
m_nvs);
28 ar & make_nvp(
"njoints", joint.
njoints);
30 ar & make_nvp(
"joints", joint.
joints);
31 ar & make_nvp(
"jointPlacements", joint.jointPlacements);
39 namespace serialization
46 template<
class Archive,
typename Derived>
50 split_free(ar, joint, version);
54 template<
class Archive,
typename Derived>
57 const pinocchio::JointModelBase<Derived> & joint,
60 const pinocchio::JointIndex i_id = joint.id();
61 const int i_q = joint.idx_q(), i_v = joint.idx_v(), i_vExtended = joint.idx_vExtended();
63 ar & make_nvp(
"i_id", i_id);
64 ar & make_nvp(
"i_q", i_q);
65 ar & make_nvp(
"i_v", i_v);
66 ar & make_nvp(
"i_vExtended", i_vExtended);
69 template<
typename Derived>
75 explicit SetJointIndexes(Derived & joint)
78 void run(pinocchio::JointIndex i_id,
int i_q,
int i_v,
int i_vExtended)
80 joint.setIndexes(i_id, i_q, i_v, i_vExtended);
84 template<
typename Scalar,
int Options,
template<
typename S,
int O>
class JointCollectionTpl>
85 class SetJointIndexes<
pinocchio::JointModelMimicTpl<Scalar, Options, JointCollectionTpl>>
90 explicit SetJointIndexes(
94 void run(pinocchio::JointIndex i_id,
int i_q,
int i_v,
int i_vExtended)
96 joint_m.setMimicIndexes(joint_m.jmodel().id(), i_q, i_v, joint_m.jmodel().idx_vExtended());
97 joint_m.setIndexes(i_id, 0, 0, i_vExtended);
101 template<
class Archive,
typename Derived>
105 pinocchio::JointIndex i_id;
106 int i_q, i_v, i_vExtended;
108 ar & make_nvp(
"i_id", i_id);
109 ar & make_nvp(
"i_q", i_q);
110 ar & make_nvp(
"i_v", i_v);
111 ar & make_nvp(
"i_vExtended", i_vExtended);
116 template<
class Archive,
typename Scalar,
int Options,
int axis>
120 const unsigned int version)
126 template<
class Archive,
typename Scalar,
int Options,
int axis>
130 const unsigned int version)
136 template<
class Archive,
typename Scalar,
int Options,
int axis>
139 pinocchio::JointModelPrismaticTpl<Scalar, Options, axis> & joint,
140 const unsigned int version)
142 typedef pinocchio::JointModelPrismaticTpl<Scalar, Options, axis> JointType;
143 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
146 template<
class Archive,
typename Scalar,
int Options,
int axis>
149 pinocchio::JointModelHelicalTpl<Scalar, Options, axis> & joint,
150 const unsigned int version)
152 typedef pinocchio::JointModelHelicalTpl<Scalar, Options, axis> JointType;
153 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
154 ar & make_nvp(
"m_pitch", joint.m_pitch);
157 template<
class Archive,
typename Scalar,
int Options>
160 pinocchio::JointModelHelicalUnalignedTpl<Scalar, Options> & joint,
161 const unsigned int version)
163 typedef pinocchio::JointModelHelicalUnalignedTpl<Scalar, Options> JointType;
164 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
165 ar & make_nvp(
"axis", joint.axis);
166 ar & make_nvp(
"m_pitch", joint.m_pitch);
169 template<
class Archive,
typename Scalar,
int Options>
172 pinocchio::JointModelFreeFlyerTpl<Scalar, Options> & joint,
173 const unsigned int version)
175 typedef pinocchio::JointModelFreeFlyerTpl<Scalar, Options> JointType;
176 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
179 template<
class Archive,
typename Scalar,
int Options>
182 pinocchio::JointModelPlanarTpl<Scalar, Options> & joint,
183 const unsigned int version)
185 typedef pinocchio::JointModelPlanarTpl<Scalar, Options> JointType;
186 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
189 template<
class Archive,
typename Scalar,
int Options>
192 pinocchio::JointModelSphericalTpl<Scalar, Options> & joint,
193 const unsigned int version)
195 typedef pinocchio::JointModelSphericalTpl<Scalar, Options> JointType;
196 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
199 template<
class Archive,
typename Scalar,
int Options>
202 pinocchio::JointModelSphericalZYXTpl<Scalar, Options> & joint,
203 const unsigned int version)
205 typedef pinocchio::JointModelSphericalZYXTpl<Scalar, Options> JointType;
206 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
209 template<
class Archive,
typename Scalar,
int Options>
212 pinocchio::JointModelEllipsoidTpl<Scalar, Options> & joint,
213 const unsigned int version)
215 typedef pinocchio::JointModelEllipsoidTpl<Scalar, Options> JointType;
216 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
217 ar & make_nvp(
"radius_x", joint.radius_x);
218 ar & make_nvp(
"radius_y", joint.radius_y);
219 ar & make_nvp(
"radius_z", joint.radius_z);
222 template<
class Archive,
typename Scalar,
int Options>
225 pinocchio::JointModelTranslationTpl<Scalar, Options> & joint,
226 const unsigned int version)
228 typedef pinocchio::JointModelTranslationTpl<Scalar, Options> JointType;
229 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
232 template<
class Archive,
typename Scalar,
int Options>
235 pinocchio::JointModelRevoluteUnalignedTpl<Scalar, Options> & joint,
236 const unsigned int version)
238 typedef pinocchio::JointModelRevoluteUnalignedTpl<Scalar, Options> JointType;
239 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
240 ar & make_nvp(
"axis", joint.
axis);
243 template<
class Archive,
typename Scalar,
int Options>
246 pinocchio::JointModelRevoluteUnboundedUnalignedTpl<Scalar, Options> & joint,
247 const unsigned int version)
249 typedef pinocchio::JointModelRevoluteUnboundedUnalignedTpl<Scalar, Options> JointType;
250 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
251 ar & make_nvp(
"axis", joint.
axis);
254 template<
class Archive,
typename Scalar,
int Options>
257 pinocchio::JointModelPrismaticUnalignedTpl<Scalar, Options> & joint,
258 const unsigned int version)
260 typedef pinocchio::JointModelPrismaticUnalignedTpl<Scalar, Options> JointType;
261 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
262 ar & make_nvp(
"axis", joint.
axis);
265 template<
class Archive,
typename Scalar,
int Options>
268 pinocchio::JointModelUniversalTpl<Scalar, Options> & joint,
269 const unsigned int version)
271 typedef pinocchio::JointModelUniversalTpl<Scalar, Options> JointType;
272 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
273 ar & make_nvp(
"axis1", joint.
axis1);
274 ar & make_nvp(
"axis2", joint.axis2);
281 template<
typename S,
int O>
class JointCollectionTpl>
284 pinocchio::JointModelCompositeTpl<Scalar, Options, JointCollectionTpl> & joint,
285 const unsigned int version)
287 typedef pinocchio::JointModelCompositeTpl<Scalar, Options, JointCollectionTpl> JointType;
288 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
290 ::pinocchio::Serialize<JointType>::run(ar, joint);
297 template<
typename S,
int O>
class JointCollectionTpl>
300 pinocchio::JointModelTpl<Scalar, Options, JointCollectionTpl> & joint,
301 const unsigned int version)
303 typedef pinocchio::JointModelTpl<Scalar, Options, JointCollectionTpl> JointType;
304 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
306 typedef typename JointCollectionTpl<Scalar, Options>::JointModelVariant JointModelVariant;
307 ar & make_nvp(
"base_variant", base_object<JointModelVariant>(joint));
314 template<
typename S,
int O>
class JointCollectionTpl>
317 pinocchio::JointModelMimicTpl<Scalar, Options, JointCollectionTpl> & joint,
318 const unsigned int version)
320 typedef pinocchio::JointModelMimicTpl<Scalar, Options, JointCollectionTpl> JointType;
321 ar & make_nvp(
"jmodel", joint.jmodel());
322 ar & make_nvp(
"scaling", joint.scaling());
323 ar & make_nvp(
"offset", joint.offset());
325 fix::serialize(ar, *
static_cast<pinocchio::JointModelBase<JointType> *
>(&joint), version);
Main pinocchio namespace.
std::vector< int > m_idx_q
Keep information of both the dimension and the position of the joints in the composition.
std::vector< std::string > jointNames
Vector of names for each joint inside the composite.
std::vector< int > m_nvExtendeds
Dimension of the segment in the jacobian matrix.
std::vector< int > m_nvs
Dimension of the segment in the tangent vector.
JointModelVector joints
Vector of joints contained in the joint composite.
std::vector< int > m_nqs
Dimension of the segment in the config vector.
std::vector< int > m_idx_vExtended
Index in the jacobian matrix.
std::vector< int > m_idx_v
Index in the tangent vector.
int njoints
Number of joints contained in the JointModelComposite.
int m_nq
Dimensions of the config and tangent space of the composite joint.
Vector3 axis
3d main axis of the joint.
Vector3 axis
3d main axis of the joint.
Vector3 axis
axis of rotation of the joint.
Vector3 axis1
3d main axii of the joint.