Directory: | ./ |
---|---|
File: | include/pinocchio/serialization/joints-motion.hpp |
Date: | 2025-02-12 21:03:38 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 32 | 32 | 100.0% |
Branches: | 14 | 28 | 50.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | // | ||
2 | // Copyright (c) 2019 INRIA | ||
3 | // | ||
4 | |||
5 | #ifndef __pinocchio_serialization_joints_motion_hpp__ | ||
6 | #define __pinocchio_serialization_joints_motion_hpp__ | ||
7 | |||
8 | #include "pinocchio/serialization/fwd.hpp" | ||
9 | |||
10 | #include <boost/serialization/split_free.hpp> | ||
11 | #include <boost/serialization/vector.hpp> | ||
12 | |||
13 | namespace boost | ||
14 | { | ||
15 | namespace serialization | ||
16 | { | ||
17 | |||
18 | template<class Archive, typename Scalar, int Options, int axis> | ||
19 | 1508 | void serialize( | |
20 | Archive & ar, | ||
21 | pinocchio::MotionRevoluteTpl<Scalar, Options, axis> & m, | ||
22 | const unsigned int /*version*/) | ||
23 | { | ||
24 |
1/2✓ Branch 3 taken 754 times.
✗ Branch 4 not taken.
|
1508 | ar & make_nvp("w", m.angularRate()); |
25 | 1508 | } | |
26 | |||
27 | template<class Archive, typename Scalar, int Options, int axis> | ||
28 | 168 | void serialize( | |
29 | Archive & ar, | ||
30 | pinocchio::MotionPrismaticTpl<Scalar, Options, axis> & m, | ||
31 | const unsigned int /*version*/) | ||
32 | { | ||
33 |
1/2✓ Branch 3 taken 84 times.
✗ Branch 4 not taken.
|
168 | ar & make_nvp("v", m.linearRate()); |
34 | 168 | } | |
35 | |||
36 | template<class Archive, typename Scalar, int Options, int axis> | ||
37 | 168 | void serialize( | |
38 | Archive & ar, | ||
39 | pinocchio::MotionHelicalTpl<Scalar, Options, axis> & m, | ||
40 | const unsigned int /*version*/) | ||
41 | { | ||
42 |
1/2✓ Branch 3 taken 84 times.
✗ Branch 4 not taken.
|
168 | ar & make_nvp("w", m.angularRate()); |
43 |
1/2✓ Branch 3 taken 84 times.
✗ Branch 4 not taken.
|
168 | ar & make_nvp("v", m.linearRate()); |
44 | 168 | } | |
45 | |||
46 | template<class Archive, typename Scalar, int Options> | ||
47 | 280 | void serialize( | |
48 | Archive & ar, | ||
49 | pinocchio::MotionSphericalTpl<Scalar, Options> & m, | ||
50 | const unsigned int /*version*/) | ||
51 | { | ||
52 |
1/2✓ Branch 3 taken 140 times.
✗ Branch 4 not taken.
|
280 | ar & make_nvp("angular", m.angular()); |
53 | 280 | } | |
54 | |||
55 | template<class Archive, typename Scalar, int Options> | ||
56 | 56 | void serialize( | |
57 | Archive & ar, | ||
58 | pinocchio::MotionTranslationTpl<Scalar, Options> & m, | ||
59 | const unsigned int /*version*/) | ||
60 | { | ||
61 |
1/2✓ Branch 3 taken 28 times.
✗ Branch 4 not taken.
|
56 | ar & make_nvp("linear", m.linear()); |
62 | 56 | } | |
63 | |||
64 | template<class Archive, typename Scalar, int Options> | ||
65 | 56 | void serialize( | |
66 | Archive & ar, pinocchio::MotionPlanarTpl<Scalar, Options> & m, const unsigned int /*version*/) | ||
67 | { | ||
68 |
1/2✓ Branch 3 taken 28 times.
✗ Branch 4 not taken.
|
56 | ar & make_nvp("data", m.data()); |
69 | 56 | } | |
70 | |||
71 | template<class Archive, typename Scalar, int Options> | ||
72 | 112 | void serialize( | |
73 | Archive & ar, | ||
74 | pinocchio::MotionRevoluteUnalignedTpl<Scalar, Options> & m, | ||
75 | const unsigned int /*version*/) | ||
76 | { | ||
77 |
1/2✓ Branch 3 taken 56 times.
✗ Branch 4 not taken.
|
112 | ar & make_nvp("axis", m.axis()); |
78 |
1/2✓ Branch 3 taken 56 times.
✗ Branch 4 not taken.
|
112 | ar & make_nvp("w", m.angularRate()); |
79 | 112 | } | |
80 | |||
81 | template<class Archive, typename Scalar, int Options> | ||
82 | 56 | void serialize( | |
83 | Archive & ar, | ||
84 | pinocchio::MotionPrismaticUnalignedTpl<Scalar, Options> & m, | ||
85 | const unsigned int /*version*/) | ||
86 | { | ||
87 |
1/2✓ Branch 3 taken 28 times.
✗ Branch 4 not taken.
|
56 | ar & make_nvp("axis", m.axis()); |
88 |
1/2✓ Branch 3 taken 28 times.
✗ Branch 4 not taken.
|
56 | ar & make_nvp("v", m.linearRate()); |
89 | 56 | } | |
90 | |||
91 | template<class Archive, typename Scalar, int Options> | ||
92 | 56 | void serialize( | |
93 | Archive & ar, | ||
94 | pinocchio::MotionHelicalUnalignedTpl<Scalar, Options> & m, | ||
95 | const unsigned int /*version*/) | ||
96 | { | ||
97 |
1/2✓ Branch 3 taken 28 times.
✗ Branch 4 not taken.
|
56 | ar & make_nvp("axis", m.axis()); |
98 |
1/2✓ Branch 3 taken 28 times.
✗ Branch 4 not taken.
|
56 | ar & make_nvp("w", m.angularRate()); |
99 |
1/2✓ Branch 3 taken 28 times.
✗ Branch 4 not taken.
|
56 | ar & make_nvp("v", m.linearRate()); |
100 | 56 | } | |
101 | } // namespace serialization | ||
102 | } // namespace boost | ||
103 | |||
104 | #endif // ifndef __pinocchio_serialization_joints_motion_hpp__ | ||
105 |