Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
eigen_serialization.h
Go to the documentation of this file.
1
30#ifndef TESSERACT_COMMON_EIGEN_SERIALIZATION_H
31#define TESSERACT_COMMON_EIGEN_SERIALIZATION_H
32
35#include <variant>
36#include <Eigen/Dense>
37#include <fstream>
38#include <sstream>
39#include <boost/archive/xml_oarchive.hpp>
40#include <boost/archive/xml_iarchive.hpp>
41#include <boost/archive/binary_oarchive.hpp>
42#include <boost/archive/binary_iarchive.hpp>
43#include <boost/serialization/tracking.hpp>
44#include <boost/serialization/tracking_enum.hpp>
46
48{
49/*****************************/
50/****** Eigen::VectorXd ******/
51/*****************************/
52template <class Archive>
53void save(Archive& ar, const Eigen::VectorXd& g, const unsigned int version); // NOLINT
54
55template <class Archive>
56void load(Archive& ar, Eigen::VectorXd& g, const unsigned int version); // NOLINT
57
58template <class Archive>
59void serialize(Archive& ar, Eigen::VectorXd& g, const unsigned int version); // NOLINT
60
61/*****************************/
62/****** Eigen::Vector3d ******/
63/*****************************/
64template <class Archive>
65void save(Archive& ar, const Eigen::Vector3d& g, const unsigned int version); // NOLINT
66
67template <class Archive>
68void load(Archive& ar, Eigen::Vector3d& g, const unsigned int version); // NOLINT
69
70template <class Archive>
71void serialize(Archive& ar, Eigen::Vector3d& g, const unsigned int version); // NOLINT
72
73/*****************************/
74/****** Eigen::Vector4d ******/
75/*****************************/
76template <class Archive>
77void save(Archive& ar, const Eigen::Vector4d& g, const unsigned int version); // NOLINT
78
79template <class Archive>
80void load(Archive& ar, Eigen::Vector4d& g, const unsigned int version); // NOLINT
81
82template <class Archive>
83void serialize(Archive& ar, Eigen::Vector4d& g, const unsigned int version); // NOLINT
84
85/*****************************/
86/****** Eigen::VectorXi ******/
87/*****************************/
88template <class Archive>
89void save(Archive& ar, const Eigen::VectorXi& g, const unsigned int version); // NOLINT
90
91template <class Archive>
92void load(Archive& ar, Eigen::VectorXi& g, const unsigned int version); // NOLINT
93
94template <class Archive>
95void serialize(Archive& ar, Eigen::VectorXi& g, const unsigned int version); // NOLINT
96
97/*****************************/
98/****** Eigen::VectorXd ******/
99/*****************************/
100
101template <class Archive>
102void save(Archive& ar, const Eigen::Isometry3d& g, const unsigned int version); // NOLINT
103
104template <class Archive>
105void load(Archive& ar, Eigen::Isometry3d& g, const unsigned int version); // NOLINT
106
107template <class Archive>
108void serialize(Archive& ar, Eigen::Isometry3d& g, const unsigned int version); // NOLINT
109
110/*****************************/
111/****** Eigen::MatrixX2d *****/
112/*****************************/
113template <class Archive>
114void save(Archive& ar, const Eigen::MatrixX2d& g, const unsigned int version); // NOLINT
115
116template <class Archive>
117void load(Archive& ar, Eigen::MatrixX2d& g, const unsigned int version); // NOLINT
118
119template <class Archive>
120void serialize(Archive& ar, Eigen::MatrixX2d& g, const unsigned int version); // NOLINT
121
122/*********************************************************/
123/****** std::variant<std::string, Eigen::Isometry3d> *****/
124/*********************************************************/
125template <class Archive>
126void save(Archive& ar, const std::variant<std::string, Eigen::Isometry3d>& g, const unsigned int version); // NOLINT
127
128template <class Archive>
129void load(Archive& ar, std::variant<std::string, Eigen::Isometry3d>& g, const unsigned int version); // NOLINT
130
131template <class Archive>
132void serialize(Archive& ar, std::variant<std::string, Eigen::Isometry3d>& g, const unsigned int version); // NOLINT
133
134} // namespace boost::serialization
135
136// Set the tracking to track_never for all Eigen types.
137BOOST_CLASS_TRACKING(Eigen::VectorXd, boost::serialization::track_never);
138BOOST_CLASS_TRACKING(Eigen::Vector3d, boost::serialization::track_never);
139BOOST_CLASS_TRACKING(Eigen::Vector4d, boost::serialization::track_never);
140BOOST_CLASS_TRACKING(Eigen::VectorXi, boost::serialization::track_never);
141BOOST_CLASS_TRACKING(Eigen::Isometry3d, boost::serialization::track_never);
142BOOST_CLASS_TRACKING(Eigen::MatrixX2d, boost::serialization::track_never);
143
144#endif // TESSERACT_COMMON_SERIALIZATION_H
BOOST_CLASS_TRACKING(Eigen::VectorXd, boost::serialization::track_never)
Common Tesseract Macros.
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
Definition: serialization.h:45
void serialize(Archive &ar, tesseract_collision::ContactResult &g, const unsigned int version)
Definition: serialization.cpp:85
void load(Archive &ar, tesseract_collision::ContactResult &g, const unsigned int version)
Definition: serialization.cpp:67
void save(Archive &ar, const tesseract_collision::ContactResult &g, const unsigned int version)
Definition: serialization.cpp:49
SceneGraph g
Definition: tesseract_srdf_unit.cpp:239