coal/serialization/collision_object.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021 INRIA
3 //
4 
5 #ifndef COAL_SERIALIZATION_COLLISION_OBJECT_H
6 #define COAL_SERIALIZATION_COLLISION_OBJECT_H
7 
9 
10 #include "coal/serialization/fwd.h"
12 
13 namespace boost {
14 namespace serialization {
15 
16 template <class Archive>
17 void save(Archive& ar, const coal::CollisionGeometry& collision_geometry,
18  const unsigned int /*version*/) {
19  ar& make_nvp("aabb_center", collision_geometry.aabb_center);
20  ar& make_nvp("aabb_radius", collision_geometry.aabb_radius);
21  ar& make_nvp("aabb_local", collision_geometry.aabb_local);
22  ar& make_nvp("cost_density", collision_geometry.cost_density);
23  ar& make_nvp("threshold_occupied", collision_geometry.threshold_occupied);
24  ar& make_nvp("threshold_free", collision_geometry.threshold_free);
25 }
26 
27 template <class Archive>
28 void load(Archive& ar, coal::CollisionGeometry& collision_geometry,
29  const unsigned int /*version*/) {
30  ar >> make_nvp("aabb_center", collision_geometry.aabb_center);
31  ar >> make_nvp("aabb_radius", collision_geometry.aabb_radius);
32  ar >> make_nvp("aabb_local", collision_geometry.aabb_local);
33  ar >> make_nvp("cost_density", collision_geometry.cost_density);
34  ar >> make_nvp("threshold_occupied", collision_geometry.threshold_occupied);
35  ar >> make_nvp("threshold_free", collision_geometry.threshold_free);
36  collision_geometry.user_data = NULL; // no way to recover this
37 }
38 
40 
41 } // namespace serialization
42 } // namespace boost
43 
44 namespace coal {
45 
46 // fwd declaration
47 template <typename BV>
48 class HeightField;
49 
50 template <typename PolygonT>
51 class Convex;
52 
53 struct OBB;
54 struct OBBRSS;
55 class AABB;
56 
57 class OcTree;
58 class Box;
59 class Sphere;
60 class Ellipsoid;
61 class Capsule;
62 class Cone;
63 class TriangleP;
64 class Cylinder;
65 class Halfspace;
66 class Plane;
67 
68 namespace serialization {
69 template <>
71  template <class Archive>
72  static void on(Archive& ar) {
73  ar.template register_type<Box>();
74  ar.template register_type<Sphere>();
75  ar.template register_type<Ellipsoid>();
76  ar.template register_type<TriangleP>();
77  ar.template register_type<Capsule>();
78  ar.template register_type<Cone>();
79  ar.template register_type<Cylinder>();
80  ar.template register_type<Halfspace>();
81  ar.template register_type<Plane>();
82  ar.template register_type<OcTree>();
83  ar.template register_type<HeightField<OBB>>();
84  ar.template register_type<HeightField<OBBRSS>>();
85  ar.template register_type<HeightField<AABB>>();
86  ar.template register_type<Convex<Triangle>>();
87  ;
88  }
89 };
90 } // namespace serialization
91 } // namespace coal
92 
93 #endif // ifndef COAL_SERIALIZATION_COLLISION_OBJECT_H
fwd.h
boost::serialization::load
void load(Archive &ar, coal::BVSplitter< BV > &splitter_, const unsigned int)
Definition: coal/serialization/BV_splitter.h:44
coal::Halfspace
Half Space: this is equivalent to the Plane in ODE. A Half space has a priviledged direction: the dir...
Definition: coal/shape/geometric_shapes.h:892
AABB.h
coal::Capsule
Capsule It is where is the distance between the point x and the capsule segment AB,...
Definition: coal/shape/geometric_shapes.h:383
coal
Main namespace.
Definition: coal/broadphase/broadphase_bruteforce.h:44
boost
coal::CollisionGeometry::threshold_free
CoalScalar threshold_free
threshold for free (<= is free)
Definition: coal/collision_object.h:170
coal::Ellipsoid
Ellipsoid centered at point zero.
Definition: coal/shape/geometric_shapes.h:305
collision_object.h
coal::CollisionGeometry
The geometry for the object for collision or distance computation.
Definition: coal/collision_object.h:94
coal::AABB
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
Definition: coal/BV/AABB.h:55
coal::Plane
Infinite plane. A plane can be viewed as two half spaces; it has no priviledged direction....
Definition: coal/shape/geometric_shapes.h:983
coal::Box
Center at zero point, axis aligned box.
Definition: coal/shape/geometric_shapes.h:166
coal::Sphere
Center at zero point sphere.
Definition: coal/shape/geometric_shapes.h:240
COAL_SERIALIZATION_SPLIT
#define COAL_SERIALIZATION_SPLIT(Type)
Definition: coal/serialization/fwd.h:24
coal::OBBRSS
Class merging the OBB and RSS, can handle collision and distance simultaneously.
Definition: coal/BV/OBBRSS.h:53
coal::CollisionGeometry::user_data
void * user_data
pointer to user defined data specific to this object
Definition: coal/collision_object.h:161
coal::CollisionGeometry::aabb_local
AABB aabb_local
AABB in local coordinate, used for tight AABB when only translation transform.
Definition: coal/collision_object.h:158
coal::CollisionGeometry::aabb_radius
CoalScalar aabb_radius
AABB radius.
Definition: coal/collision_object.h:154
coal::Convex
Convex polytope.
Definition: coal/serialization/collision_object.h:51
coal::CollisionGeometry::threshold_occupied
CoalScalar threshold_occupied
threshold for occupied ( >= is occupied)
Definition: coal/collision_object.h:167
coal::Cylinder
Cylinder along Z axis. The cylinder is defined at its centroid.
Definition: coal/shape/geometric_shapes.h:560
coal::TriangleP
Triangle stores the points instead of only indices of points.
Definition: coal/shape/geometric_shapes.h:110
coal::serialization::register_type< CollisionGeometry >::on
static void on(Archive &ar)
Definition: coal/serialization/collision_object.h:72
coal::Cone
Cone The base of the cone is at and the top is at .
Definition: coal/shape/geometric_shapes.h:467
coal::OcTree
Octree is one type of collision geometry which can encode uncertainty information in the sensor data.
Definition: coal/octree.h:53
coal::CollisionGeometry::cost_density
CoalScalar cost_density
collision cost for unit volume
Definition: coal/collision_object.h:164
boost::serialization::save
void save(Archive &ar, const coal::BVSplitter< BV > &splitter_, const unsigned int)
Definition: coal/serialization/BV_splitter.h:30
coal::OBB
Oriented bounding box class.
Definition: include/coal/BV/OBB.h:51
coal::serialization::register_type
Definition: coal/serialization/fwd.h:89
coal::CollisionGeometry::aabb_center
Vec3s aabb_center
AABB center in local coordinate.
Definition: coal/collision_object.h:151


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:57