Line |
Branch |
Exec |
Source |
1 |
|
|
// |
2 |
|
|
// Copyright (c) 2019 INRIA |
3 |
|
|
// |
4 |
|
|
|
5 |
|
|
#ifndef __pinocchio_serialization_motion_hpp__ |
6 |
|
|
#define __pinocchio_serialization_motion_hpp__ |
7 |
|
|
|
8 |
|
|
#include "pinocchio/spatial/motion.hpp" |
9 |
|
|
#include "pinocchio/serialization/fwd.hpp" |
10 |
|
|
|
11 |
|
|
#include <boost/serialization/split_free.hpp> |
12 |
|
|
#include <boost/serialization/vector.hpp> |
13 |
|
|
|
14 |
|
|
namespace boost |
15 |
|
|
{ |
16 |
|
|
namespace serialization |
17 |
|
|
{ |
18 |
|
|
|
19 |
|
|
template<class Archive, typename Scalar, int Options> |
20 |
|
✗ |
void save( |
21 |
|
|
Archive & ar, const pinocchio::MotionTpl<Scalar, Options> & m, const unsigned int /*version*/) |
22 |
|
|
{ |
23 |
|
✗ |
ar & make_nvp("linear", make_array(m.linear().data(), 3)); |
24 |
|
✗ |
ar & make_nvp("angular", make_array(m.angular().data(), 3)); |
25 |
|
|
} |
26 |
|
|
|
27 |
|
|
template<class Archive, typename Scalar, int Options> |
28 |
|
|
void |
29 |
|
✗ |
load(Archive & ar, pinocchio::MotionTpl<Scalar, Options> & m, const unsigned int /*version*/) |
30 |
|
|
{ |
31 |
|
✗ |
ar >> make_nvp("linear", make_array(m.linear().data(), 3)); |
32 |
|
✗ |
ar >> make_nvp("angular", make_array(m.angular().data(), 3)); |
33 |
|
|
} |
34 |
|
|
|
35 |
|
|
template<class Archive, typename Scalar, int Options> |
36 |
|
|
void |
37 |
|
✗ |
serialize(Archive & ar, pinocchio::MotionTpl<Scalar, Options> & m, const unsigned int version) |
38 |
|
|
{ |
39 |
|
✗ |
split_free(ar, m, version); |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
template<class Archive, typename Scalar, int Options> |
43 |
|
✗ |
void serialize( |
44 |
|
|
Archive & /*ar*/, |
45 |
|
|
pinocchio::MotionZeroTpl<Scalar, Options> & /*m*/, |
46 |
|
|
const unsigned int /*version*/) |
47 |
|
|
{ |
48 |
|
|
// Nothing to do |
49 |
|
|
} |
50 |
|
|
|
51 |
|
|
} // namespace serialization |
52 |
|
|
} // namespace boost |
53 |
|
|
|
54 |
|
|
#endif // ifndef __pinocchio_serialization_motion_hpp__ |
55 |
|
|
|