Line |
Branch |
Exec |
Source |
1 |
|
|
// |
2 |
|
|
// Copyright (c) 2019-2020 INRIA |
3 |
|
|
// |
4 |
|
|
|
5 |
|
|
#ifndef __pinocchio_serialization_joints_data_hpp__ |
6 |
|
|
#define __pinocchio_serialization_joints_data_hpp__ |
7 |
|
|
|
8 |
|
|
namespace pinocchio |
9 |
|
|
{ |
10 |
|
|
template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl> |
11 |
|
|
struct Serialize<JointDataCompositeTpl<Scalar, Options, JointCollectionTpl>> |
12 |
|
|
{ |
13 |
|
|
template<typename Archive> |
14 |
|
|
static void |
15 |
|
✗ |
run(Archive & ar, JointDataCompositeTpl<Scalar, Options, JointCollectionTpl> & joint_data) |
16 |
|
|
{ |
17 |
|
|
using boost::serialization::make_nvp; |
18 |
|
|
|
19 |
|
✗ |
ar & make_nvp("joints", joint_data.joints); |
20 |
|
✗ |
ar & make_nvp("iMlast", joint_data.iMlast); |
21 |
|
✗ |
ar & make_nvp("pjMi", joint_data.pjMi); |
22 |
|
|
|
23 |
|
✗ |
ar & make_nvp("S", joint_data.S); |
24 |
|
✗ |
ar & make_nvp("M", joint_data.M); |
25 |
|
✗ |
ar & make_nvp("v", joint_data.v); |
26 |
|
✗ |
ar & make_nvp("c", joint_data.c); |
27 |
|
|
|
28 |
|
✗ |
ar & make_nvp("U", joint_data.U); |
29 |
|
✗ |
ar & make_nvp("Dinv", joint_data.Dinv); |
30 |
|
✗ |
ar & make_nvp("UDinv", joint_data.UDinv); |
31 |
|
✗ |
ar & make_nvp("StU", joint_data.StU); |
32 |
|
|
} |
33 |
|
|
}; |
34 |
|
|
} // namespace pinocchio |
35 |
|
|
|
36 |
|
|
namespace boost |
37 |
|
|
{ |
38 |
|
|
namespace serialization |
39 |
|
|
{ |
40 |
|
|
|
41 |
|
|
// For some older version of gcc, we have to rely on an additional namespace |
42 |
|
|
// to avoid ambiguous call to boost::serialization::serialize |
43 |
|
|
namespace fix |
44 |
|
|
{ |
45 |
|
|
template<class Archive, typename Derived> |
46 |
|
✗ |
void serialize( |
47 |
|
|
Archive & ar, |
48 |
|
|
pinocchio::JointDataBase<Derived> & joint_data, |
49 |
|
|
const unsigned int /*version*/) |
50 |
|
|
{ |
51 |
|
✗ |
ar & make_nvp("joint_q", joint_data.joint_q()); |
52 |
|
✗ |
ar & make_nvp("joint_v", joint_data.joint_v()); |
53 |
|
|
|
54 |
|
✗ |
ar & make_nvp("S", joint_data.S()); |
55 |
|
✗ |
ar & make_nvp("M", joint_data.M()); |
56 |
|
✗ |
ar & make_nvp("v", joint_data.v()); |
57 |
|
✗ |
ar & make_nvp("c", joint_data.c()); |
58 |
|
|
|
59 |
|
✗ |
ar & make_nvp("U", joint_data.U()); |
60 |
|
✗ |
ar & make_nvp("Dinv", joint_data.Dinv()); |
61 |
|
✗ |
ar & make_nvp("UDinv", joint_data.UDinv()); |
62 |
|
✗ |
ar & make_nvp("StU", joint_data.StU()); |
63 |
|
|
} |
64 |
|
|
} // namespace fix |
65 |
|
|
|
66 |
|
|
template<class Archive, typename Scalar, int Options, int axis> |
67 |
|
✗ |
void serialize( |
68 |
|
|
Archive & ar, |
69 |
|
|
pinocchio::JointDataRevoluteTpl<Scalar, Options, axis> & joint, |
70 |
|
|
const unsigned int version) |
71 |
|
|
{ |
72 |
|
|
typedef pinocchio::JointDataRevoluteTpl<Scalar, Options, axis> JointType; |
73 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
74 |
|
|
} |
75 |
|
|
|
76 |
|
|
template<class Archive, typename Scalar, int Options, int axis> |
77 |
|
✗ |
void serialize( |
78 |
|
|
Archive & ar, |
79 |
|
|
pinocchio::JointDataRevoluteUnboundedTpl<Scalar, Options, axis> & joint, |
80 |
|
|
const unsigned int version) |
81 |
|
|
{ |
82 |
|
|
typedef pinocchio::JointDataRevoluteUnboundedTpl<Scalar, Options, axis> JointType; |
83 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
84 |
|
|
} |
85 |
|
|
|
86 |
|
|
template<class Archive, typename Scalar, int Options, int axis> |
87 |
|
✗ |
void serialize( |
88 |
|
|
Archive & ar, |
89 |
|
|
pinocchio::JointDataPrismaticTpl<Scalar, Options, axis> & joint, |
90 |
|
|
const unsigned int version) |
91 |
|
|
{ |
92 |
|
|
typedef pinocchio::JointDataPrismaticTpl<Scalar, Options, axis> JointType; |
93 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
94 |
|
|
} |
95 |
|
|
|
96 |
|
|
template<class Archive, typename Scalar, int Options, int axis> |
97 |
|
✗ |
void serialize( |
98 |
|
|
Archive & ar, |
99 |
|
|
pinocchio::JointDataHelicalTpl<Scalar, Options, axis> & joint, |
100 |
|
|
const unsigned int version) |
101 |
|
|
{ |
102 |
|
|
typedef pinocchio::JointDataHelicalTpl<Scalar, Options, axis> JointType; |
103 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
104 |
|
|
} |
105 |
|
|
|
106 |
|
|
template<class Archive, typename Scalar, int Options> |
107 |
|
✗ |
void serialize( |
108 |
|
|
Archive & ar, |
109 |
|
|
pinocchio::JointDataHelicalUnalignedTpl<Scalar, Options> & joint, |
110 |
|
|
const unsigned int version) |
111 |
|
|
{ |
112 |
|
|
typedef pinocchio::JointDataHelicalUnalignedTpl<Scalar, Options> JointType; |
113 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
114 |
|
|
} |
115 |
|
|
|
116 |
|
|
template<class Archive, typename Scalar, int Options> |
117 |
|
✗ |
void serialize( |
118 |
|
|
Archive & ar, |
119 |
|
|
pinocchio::JointDataFreeFlyerTpl<Scalar, Options> & joint, |
120 |
|
|
const unsigned int version) |
121 |
|
|
{ |
122 |
|
|
typedef pinocchio::JointDataFreeFlyerTpl<Scalar, Options> JointType; |
123 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
124 |
|
|
} |
125 |
|
|
|
126 |
|
|
template<class Archive, typename Scalar, int Options> |
127 |
|
✗ |
void serialize( |
128 |
|
|
Archive & ar, |
129 |
|
|
pinocchio::JointDataPlanarTpl<Scalar, Options> & joint, |
130 |
|
|
const unsigned int version) |
131 |
|
|
{ |
132 |
|
|
typedef pinocchio::JointDataPlanarTpl<Scalar, Options> JointType; |
133 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
134 |
|
|
} |
135 |
|
|
|
136 |
|
|
template<class Archive, typename Scalar, int Options> |
137 |
|
✗ |
void serialize( |
138 |
|
|
Archive & ar, |
139 |
|
|
pinocchio::JointDataSphericalTpl<Scalar, Options> & joint, |
140 |
|
|
const unsigned int version) |
141 |
|
|
{ |
142 |
|
|
typedef pinocchio::JointDataSphericalTpl<Scalar, Options> JointType; |
143 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
144 |
|
|
} |
145 |
|
|
|
146 |
|
|
template<class Archive, typename Scalar, int Options> |
147 |
|
✗ |
void serialize( |
148 |
|
|
Archive & ar, |
149 |
|
|
pinocchio::JointDataSphericalZYXTpl<Scalar, Options> & joint, |
150 |
|
|
const unsigned int version) |
151 |
|
|
{ |
152 |
|
|
typedef pinocchio::JointDataSphericalZYXTpl<Scalar, Options> JointType; |
153 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
154 |
|
|
} |
155 |
|
|
|
156 |
|
|
template<class Archive, typename Scalar, int Options> |
157 |
|
✗ |
void serialize( |
158 |
|
|
Archive & ar, |
159 |
|
|
pinocchio::JointDataTranslationTpl<Scalar, Options> & joint, |
160 |
|
|
const unsigned int version) |
161 |
|
|
{ |
162 |
|
|
typedef pinocchio::JointDataTranslationTpl<Scalar, Options> JointType; |
163 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
164 |
|
|
} |
165 |
|
|
|
166 |
|
|
template<class Archive, typename Scalar, int Options> |
167 |
|
✗ |
void serialize( |
168 |
|
|
Archive & ar, |
169 |
|
|
pinocchio::JointDataRevoluteUnalignedTpl<Scalar, Options> & joint, |
170 |
|
|
const unsigned int version) |
171 |
|
|
{ |
172 |
|
|
typedef pinocchio::JointDataRevoluteUnalignedTpl<Scalar, Options> JointType; |
173 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
174 |
|
|
} |
175 |
|
|
|
176 |
|
|
template<class Archive, typename Scalar, int Options> |
177 |
|
✗ |
void serialize( |
178 |
|
|
Archive & ar, |
179 |
|
|
pinocchio::JointDataRevoluteUnboundedUnalignedTpl<Scalar, Options> & joint, |
180 |
|
|
const unsigned int version) |
181 |
|
|
{ |
182 |
|
|
typedef pinocchio::JointDataRevoluteUnboundedUnalignedTpl<Scalar, Options> JointType; |
183 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
184 |
|
|
} |
185 |
|
|
|
186 |
|
|
template<class Archive, typename Scalar, int Options> |
187 |
|
✗ |
void serialize( |
188 |
|
|
Archive & ar, |
189 |
|
|
pinocchio::JointDataPrismaticUnalignedTpl<Scalar, Options> & joint, |
190 |
|
|
const unsigned int version) |
191 |
|
|
{ |
192 |
|
|
typedef pinocchio::JointDataPrismaticUnalignedTpl<Scalar, Options> JointType; |
193 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
194 |
|
|
} |
195 |
|
|
|
196 |
|
|
template<class Archive, typename Scalar, int Options> |
197 |
|
✗ |
void serialize( |
198 |
|
|
Archive & ar, |
199 |
|
|
pinocchio::JointDataUniversalTpl<Scalar, Options> & joint, |
200 |
|
|
const unsigned int version) |
201 |
|
|
{ |
202 |
|
|
typedef pinocchio::JointDataUniversalTpl<Scalar, Options> JointType; |
203 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
204 |
|
|
} |
205 |
|
|
|
206 |
|
|
template< |
207 |
|
|
class Archive, |
208 |
|
|
typename Scalar, |
209 |
|
|
int Options, |
210 |
|
|
template<typename S, int O> |
211 |
|
|
class JointCollectionTpl> |
212 |
|
✗ |
void serialize( |
213 |
|
|
Archive & ar, |
214 |
|
|
pinocchio::JointDataCompositeTpl<Scalar, Options, JointCollectionTpl> & joint, |
215 |
|
|
const unsigned int version) |
216 |
|
|
{ |
217 |
|
|
typedef pinocchio::JointDataCompositeTpl<Scalar, Options, JointCollectionTpl> JointType; |
218 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
219 |
|
|
|
220 |
|
✗ |
::pinocchio::Serialize<JointType>::run(ar, joint); |
221 |
|
|
} |
222 |
|
|
|
223 |
|
|
template< |
224 |
|
|
class Archive, |
225 |
|
|
typename Scalar, |
226 |
|
|
int Options, |
227 |
|
|
template<typename S, int O> |
228 |
|
|
class JointCollectionTpl> |
229 |
|
✗ |
void serialize( |
230 |
|
|
Archive & ar, |
231 |
|
|
pinocchio::JointDataTpl<Scalar, Options, JointCollectionTpl> & joint, |
232 |
|
|
const unsigned int /*version*/) |
233 |
|
|
{ |
234 |
|
|
typedef typename JointCollectionTpl<Scalar, Options>::JointDataVariant JointDataVariant; |
235 |
|
✗ |
ar & make_nvp("base_variant", base_object<JointDataVariant>(joint)); |
236 |
|
|
} |
237 |
|
|
|
238 |
|
|
template<class Archive, typename JointData> |
239 |
|
✗ |
void serialize( |
240 |
|
|
Archive & ar, pinocchio::JointDataMimic<JointData> & joint, const unsigned int version) |
241 |
|
|
{ |
242 |
|
|
typedef pinocchio::JointDataMimic<JointData> JointType; |
243 |
|
✗ |
fix::serialize(ar, static_cast<pinocchio::JointDataBase<JointType> &>(joint), version); |
244 |
|
|
|
245 |
|
✗ |
ar & make_nvp("jdata", joint.jdata()); |
246 |
|
✗ |
ar & make_nvp("scaling", joint.scaling()); |
247 |
|
|
} |
248 |
|
|
|
249 |
|
|
} // namespace serialization |
250 |
|
|
} // namespace boost |
251 |
|
|
|
252 |
|
|
#endif // ifndef __pinocchio_serialization_joints_data_hpp__ |
253 |
|
|
|