Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1
26#ifndef TESSERACT_COMMON_TYPES_H
27#define TESSERACT_COMMON_TYPES_H
28
31#include <boost/serialization/access.hpp>
32#include <Eigen/Core>
33#include <Eigen/Geometry>
34#include <vector>
35#include <memory>
36#include <map>
37#include <unordered_map>
38#include <boost/filesystem.hpp>
39#include <yaml-cpp/yaml.h>
41
43
44namespace tesseract_common
45{
47namespace fs = boost::filesystem;
48
49template <typename T>
50using AlignedVector = std::vector<T, Eigen::aligned_allocator<T>>;
51
52template <typename Key, typename Value>
53using AlignedMap = std::map<Key, Value, std::less<Key>, Eigen::aligned_allocator<std::pair<const Key, Value>>>;
54
55template <typename Key, typename Value>
56using AlignedUnorderedMap = std::unordered_map<Key,
57 Value,
58 std::hash<Key>,
59 std::equal_to<Key>,
60 Eigen::aligned_allocator<std::pair<const Key, Value>>>;
61
64using VectorVector3d = std::vector<Eigen::Vector3d>;
68
69using TrajArray = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
70
71using LinkNamesPair = std::pair<std::string, std::string>;
72
74{
75 std::size_t operator()(const LinkNamesPair& pair) const;
76};
77
86LinkNamesPair makeOrderedLinkPair(const std::string& link_name1, const std::string& link_name2);
87
99void makeOrderedLinkPair(LinkNamesPair& pair, const std::string& link_name1, const std::string& link_name2);
100
102// NOLINTNEXTLINE
104{
106 std::string class_name;
107
109 YAML::Node config;
110
112 std::string getConfigString() const;
113
114 bool operator==(const PluginInfo& rhs) const;
115 bool operator!=(const PluginInfo& rhs) const;
116
117private:
119 template <class Archive>
120 void save(Archive& ar, const unsigned int version) const; // NOLINT
121
122 template <class Archive>
123 void load(Archive& ar, const unsigned int version); // NOLINT
124
125 template <class Archive>
126 void serialize(Archive& ar, const unsigned int version); // NOLINT
127};
128
130using PluginInfoMap = std::map<std::string, PluginInfo>;
131
133{
134 std::string default_plugin;
136 void clear();
137
138 bool operator==(const PluginInfoContainer& rhs) const;
139 bool operator!=(const PluginInfoContainer& rhs) const;
140
141private:
143 template <class Archive>
144 void serialize(Archive& ar, const unsigned int version); // NOLINT
145};
146
149{
151 std::set<std::string> search_paths;
152
154 std::set<std::string> search_libraries;
155
157 std::map<std::string, tesseract_common::PluginInfoContainer> fwd_plugin_infos;
158
160 std::map<std::string, tesseract_common::PluginInfoContainer> inv_plugin_infos;
161
163 void insert(const KinematicsPluginInfo& other);
164
166 void clear();
167
169 bool empty() const;
170
171 // Yaml Config key
172 static inline const std::string CONFIG_KEY{ "kinematic_plugins" };
173
174 bool operator==(const KinematicsPluginInfo& rhs) const;
175 bool operator!=(const KinematicsPluginInfo& rhs) const;
176
177private:
179 template <class Archive>
180 void serialize(Archive& ar, const unsigned int version); // NOLINT
181};
182
185{
187 std::set<std::string> search_paths;
188
190 std::set<std::string> search_libraries;
191
194
197
199 void insert(const ContactManagersPluginInfo& other);
200
202 void clear();
203
205 bool empty() const;
206
207 // Yaml Config key
208 static inline const std::string CONFIG_KEY{ "contact_manager_plugins" };
209
210 bool operator==(const ContactManagersPluginInfo& rhs) const;
211 bool operator!=(const ContactManagersPluginInfo& rhs) const;
212
213private:
215 template <class Archive>
216 void serialize(Archive& ar, const unsigned int version); // NOLINT
217};
218
221{
223 std::set<std::string> search_paths;
224
226 std::set<std::string> search_libraries;
227
230
233
235 void insert(const TaskComposerPluginInfo& other);
236
238 void clear();
239
241 bool empty() const;
242
243 // Yaml Config key
244 static inline const std::string CONFIG_KEY{ "task_composer_plugins" };
245
246 bool operator==(const TaskComposerPluginInfo& rhs) const;
247 bool operator!=(const TaskComposerPluginInfo& rhs) const;
248
249private:
251 template <class Archive>
252 void serialize(Archive& ar, const unsigned int version); // NOLINT
253};
254
257{
258 // LCOV_EXCL_START
259 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
260 // LCOV_EXCL_STOP
261
262 CalibrationInfo() = default;
263
270
272 void insert(const CalibrationInfo& other);
273
275 void clear();
276
278 bool empty() const;
279
280 // Yaml Config key
281 static inline const std::string CONFIG_KEY{ "calibration" };
282
283 bool operator==(const CalibrationInfo& rhs) const;
284 bool operator!=(const CalibrationInfo& rhs) const;
285
286private:
288 template <class Archive>
289 void serialize(Archive& ar, const unsigned int version); // NOLINT
290};
291} // namespace tesseract_common
292
293#include <boost/serialization/export.hpp>
294#include <boost/serialization/tracking.hpp>
295BOOST_CLASS_EXPORT_KEY2(tesseract_common::PluginInfo, "PluginInfo")
296BOOST_CLASS_EXPORT_KEY2(tesseract_common::PluginInfoContainer, "PluginInfoContainer")
297BOOST_CLASS_EXPORT_KEY2(tesseract_common::KinematicsPluginInfo, "KinematicsPluginInfo")
298BOOST_CLASS_EXPORT_KEY2(tesseract_common::ContactManagersPluginInfo, "ContactManagersPluginInfo")
299BOOST_CLASS_EXPORT_KEY2(tesseract_common::TaskComposerPluginInfo, "TaskComposerPluginInfo")
300BOOST_CLASS_EXPORT_KEY2(tesseract_common::CalibrationInfo, "CalibrationInfo")
301
302#endif // TESSERACT_COMMON_TYPES_H
Common Tesseract Kinematic Limits and Related Utility Functions.
Common Tesseract Macros.
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
Definition: allowed_collision_matrix.h:16
std::vector< T, Eigen::aligned_allocator< T > > AlignedVector
Enable easy switching to std::filesystem when available.
Definition: types.h:50
LinkNamesPair makeOrderedLinkPair(const std::string &link_name1, const std::string &link_name2)
Create a pair of strings, where the pair.first is always <= pair.second.
Definition: types.cpp:56
std::map< Key, Value, std::less< Key >, Eigen::aligned_allocator< std::pair< const Key, Value > > > AlignedMap
Definition: types.h:53
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > TrajArray
Definition: types.h:69
std::map< std::string, PluginInfo > PluginInfoMap
A map of PluginInfo to user defined name.
Definition: types.h:130
std::pair< std::string, std::string > LinkNamesPair
Definition: types.h:71
AlignedMap< std::string, Eigen::Isometry3d > TransformMap
Definition: types.h:66
AlignedVector< Eigen::Vector4d > VectorVector4d
Definition: types.h:63
std::unordered_map< Key, Value, std::hash< Key >, std::equal_to< Key >, Eigen::aligned_allocator< std::pair< const Key, Value > > > AlignedUnorderedMap
Definition: types.h:60
AlignedVector< VectorIsometry3d > Toolpath
Definition: types.h:67
AlignedVector< Eigen::Isometry3d > VectorIsometry3d
Definition: types.h:62
AlignedVector< Eigen::Vector2d > VectorVector2d
Definition: types.h:65
std::vector< Eigen::Vector3d > VectorVector3d
Definition: types.h:64
The CalibrationInfo struct.
Definition: types.h:257
bool operator==(const CalibrationInfo &rhs) const
Definition: types.cpp:334
EIGEN_MAKE_ALIGNED_OPERATOR_NEW CalibrationInfo()=default
bool empty() const
Check if structure is empty.
Definition: types.cpp:332
void insert(const CalibrationInfo &other)
Insert the content of an other CalibrationInfo.
Definition: types.cpp:324
static const std::string CONFIG_KEY
Definition: types.h:281
bool operator!=(const CalibrationInfo &rhs) const
Definition: types.cpp:345
void serialize(Archive &ar, const unsigned int version)
Definition: types.cpp:348
void clear()
Clear the contents.
Definition: types.cpp:330
friend class boost::serialization::access
Definition: types.h:287
tesseract_common::TransformMap joints
The joint origin calibration information.
Definition: types.h:269
The contact managers plugin information structure.
Definition: types.h:185
bool empty() const
Check if structure is empty.
Definition: types.cpp:240
void serialize(Archive &ar, const unsigned int version)
Definition: types.cpp:258
void clear()
Clear the contents.
Definition: types.cpp:232
static const std::string CONFIG_KEY
Definition: types.h:208
std::set< std::string > search_libraries
A list of library names without the prefix or suffix that contain plugins.
Definition: types.h:190
bool operator==(const ContactManagersPluginInfo &rhs) const
Definition: types.cpp:246
friend class boost::serialization::access
Definition: types.h:214
tesseract_common::PluginInfoContainer continuous_plugin_infos
A map of name to continuous contact manager plugin information.
Definition: types.h:196
std::set< std::string > search_paths
A list of paths to search for plugins.
Definition: types.h:187
tesseract_common::PluginInfoContainer discrete_plugin_infos
A map of name to discrete contact manager plugin information.
Definition: types.h:193
void insert(const ContactManagersPluginInfo &other)
Insert the content of an other ContactManagersPluginInfo.
Definition: types.cpp:208
bool operator!=(const ContactManagersPluginInfo &rhs) const
Definition: types.cpp:255
The kinematics plugin information structure.
Definition: types.h:149
bool empty() const
Check if structure is empty.
Definition: types.cpp:177
void insert(const KinematicsPluginInfo &other)
Insert the content of an other KinematicsPluginInfo.
Definition: types.cpp:145
static const std::string CONFIG_KEY
Definition: types.h:172
std::map< std::string, tesseract_common::PluginInfoContainer > inv_plugin_infos
A map of group name to inverse kinematics plugin information.
Definition: types.h:160
std::set< std::string > search_libraries
A list of library names without the prefix or suffix that contain plugins.
Definition: types.h:154
bool operator==(const KinematicsPluginInfo &rhs) const
Definition: types.cpp:182
friend class boost::serialization::access
Definition: types.h:178
std::map< std::string, tesseract_common::PluginInfoContainer > fwd_plugin_infos
A map of group name to forward kinematics plugin information.
Definition: types.h:157
std::set< std::string > search_paths
A list of paths to search for plugins.
Definition: types.h:151
bool operator!=(const KinematicsPluginInfo &rhs) const
Definition: types.cpp:194
void serialize(Archive &ar, const unsigned int version)
Definition: types.cpp:197
void clear()
Clear the contents.
Definition: types.cpp:169
Definition: types.h:74
std::size_t operator()(const LinkNamesPair &pair) const
Definition: types.cpp:47
void clear()
Definition: types.cpp:119
PluginInfoMap plugins
Definition: types.h:135
bool operator!=(const PluginInfoContainer &rhs) const
Definition: types.cpp:133
void serialize(Archive &ar, const unsigned int version)
Definition: types.cpp:136
std::string default_plugin
Definition: types.h:134
bool operator==(const PluginInfoContainer &rhs) const
Definition: types.cpp:125
friend class boost::serialization::access
Definition: types.h:142
The Plugin Information struct.
Definition: types.h:104
void load(Archive &ar, const unsigned int version)
Definition: types.cpp:100
std::string class_name
The plugin class name.
Definition: types.h:106
YAML::Node config
The plugin config data.
Definition: types.h:109
std::string getConfigString() const
Get the yaml config as a string.
Definition: types.cpp:79
bool operator==(const PluginInfo &rhs) const
Definition: types.cpp:81
void save(Archive &ar, const unsigned int version) const
Definition: types.cpp:92
friend class boost::serialization::access
Definition: types.h:118
void serialize(Archive &ar, const unsigned int version)
Definition: types.cpp:110
bool operator!=(const PluginInfo &rhs) const
Definition: types.cpp:89
The task composer plugin information structure.
Definition: types.h:221
bool empty() const
Check if structure is empty.
Definition: types.cpp:295
void clear()
Clear the contents.
Definition: types.cpp:287
tesseract_common::PluginInfoContainer task_plugin_infos
A map of name to task composer task plugin information.
Definition: types.h:232
void insert(const TaskComposerPluginInfo &other)
Insert the content of an other TaskComposerPluginInfo.
Definition: types.cpp:269
bool operator==(const TaskComposerPluginInfo &rhs) const
Definition: types.cpp:301
bool operator!=(const TaskComposerPluginInfo &rhs) const
Definition: types.cpp:310
static const std::string CONFIG_KEY
Definition: types.h:244
tesseract_common::PluginInfoContainer executor_plugin_infos
A map of name to task composer executor plugin information.
Definition: types.h:229
std::set< std::string > search_libraries
A list of library names without the prefix or suffix that contain plugins.
Definition: types.h:226
std::set< std::string > search_paths
A list of paths to search for plugins.
Definition: types.h:223
friend class boost::serialization::access
Definition: types.h:250
void serialize(Archive &ar, const unsigned int version)
Definition: types.cpp:313