src/serialization/inertia.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019 INRIA
3 //
4 
5 #ifndef __pinocchio_serialization_inertia_hpp__
6 #define __pinocchio_serialization_inertia_hpp__
7 
8 #include "pinocchio/spatial/inertia.hpp"
9 #include "pinocchio/serialization/fwd.hpp"
10 #include "pinocchio/serialization/symmetric3.hpp"
11 
12 #include <boost/serialization/split_free.hpp>
13 #include <boost/serialization/vector.hpp>
14 
15 namespace boost
16 {
17  namespace serialization
18  {
19 
20  template <class Archive, typename Scalar, int Options>
21  void save(Archive & ar,
23  const unsigned int /*version*/)
24  {
25  const Scalar mass = I.mass();
26  ar & make_nvp("mass",mass);
27  ar & make_nvp("lever",make_array(I.lever().data(),3));
28  ar & make_nvp("inertia",I.inertia());
29  }
30 
31  template <class Archive, typename Scalar, int Options>
32  void load(Archive & ar,
34  const unsigned int /*version*/)
35  {
36  ar >> make_nvp("mass",I.mass());
37  ar >> make_nvp("lever",make_array(I.lever().data(),3));
38  ar >> make_nvp("inertia",I.inertia());
39  }
40 
41  template <class Archive, typename Scalar, int Options>
42  void serialize(Archive & ar,
44  const unsigned int version)
45  {
46  split_free(ar,I,version);
47  }
48 
49  }
50 }
51 
52 #endif // ifndef __pinocchio_serialization_inertia_hpp__
const Symmetric3 & inertia() const
void save(Archive &ar, const hpp::fcl::Contact &contact, const unsigned int)
const Vector3 & lever() const
void serialize(Archive &ar, hpp::fcl::AABB &aabb, const unsigned int)
SE3::Scalar Scalar
Definition: conversions.cpp:13
void load(Archive &ar, hpp::fcl::Contact &contact, const unsigned int)
const nvp< typename pinocchio::container::aligned_vector< T >::vector_base > make_nvp(const char *name, pinocchio::container::aligned_vector< T > &t)


pinocchio
Author(s):
autogenerated on Fri Jun 23 2023 02:38:30