5 #ifndef HPP_FCL_SERIALIZATION_COLLISION_DATA_H
6 #define HPP_FCL_SERIALIZATION_COLLISION_DATA_H
12 namespace serialization {
14 template <
class Archive>
16 const unsigned int ) {
17 ar& make_nvp(
"b1", contact.
b1);
18 ar& make_nvp(
"b2", contact.
b2);
19 ar& make_nvp(
"normal", contact.
normal);
21 ar& make_nvp(
"pos", contact.
pos);
25 template <
class Archive>
27 const unsigned int ) {
28 ar >> make_nvp(
"b1", contact.
b1);
29 ar >> make_nvp(
"b2", contact.
b2);
30 ar >> make_nvp(
"normal", contact.
normal);
31 std::array<hpp::fcl::Vec3f, 2> nearest_points;
32 ar >> make_nvp(
"nearest_points", nearest_points);
35 ar >> make_nvp(
"pos", contact.
pos);
43 template <
class Archive>
45 const unsigned int ) {
50 ar& make_nvp(
"enable_cached_gjk_guess",
54 ar& make_nvp(
"cached_support_func_guess",
58 ar& make_nvp(
"gjk_variant", query_request.
gjk_variant);
59 ar& make_nvp(
"gjk_convergence_criterion",
61 ar& make_nvp(
"gjk_convergence_criterion_type",
65 ar& make_nvp(
"collision_distance_threshold",
70 template <
class Archive>
72 const unsigned int ) {
74 ar& make_nvp(
"cached_support_func_guess",
78 template <
class Archive>
80 const unsigned int ) {
82 boost::serialization::base_object<hpp::fcl::QueryRequest>(
88 ar& make_nvp(
"enable_distance_lower_bound",
96 template <
class Archive>
98 const unsigned int ) {
99 ar& make_nvp(
"base", boost::serialization::base_object<hpp::fcl::QueryResult>(
101 ar& make_nvp(
"contacts", collision_result.
getContacts());
104 ar& make_nvp(
"normal", collision_result.
normal);
107 template <
class Archive>
109 const unsigned int ) {
111 make_nvp(
"base", boost::serialization::base_object<hpp::fcl::QueryResult>(
113 std::vector<hpp::fcl::Contact> contacts;
114 ar >> make_nvp(
"contacts", contacts);
115 collision_result.
clear();
116 for (
size_t k = 0; k < contacts.size(); ++k)
119 std::array<hpp::fcl::Vec3f, 2> nearest_points;
120 ar >> make_nvp(
"nearest_points", nearest_points);
123 ar >> make_nvp(
"normal", collision_result.
normal);
128 template <
class Archive>
130 const unsigned int ) {
132 boost::serialization::base_object<hpp::fcl::QueryRequest>(
138 ar& make_nvp(
"enable_signed_distance",
140 ar& make_nvp(
"rel_err", distance_request.
rel_err);
141 ar& make_nvp(
"abs_err", distance_request.
abs_err);
144 template <
class Archive>
146 const unsigned int ) {
147 ar& make_nvp(
"base", boost::serialization::base_object<hpp::fcl::QueryResult>(
149 ar& make_nvp(
"min_distance", distance_result.
min_distance);
151 ar& make_nvp(
"normal", distance_result.
normal);
152 ar& make_nvp(
"b1", distance_result.
b1);
153 ar& make_nvp(
"b2", distance_result.
b2);
156 template <
class Archive>
158 const unsigned int ) {
160 make_nvp(
"base", boost::serialization::base_object<hpp::fcl::QueryResult>(
162 ar >> make_nvp(
"min_distance", distance_result.
min_distance);
163 std::array<hpp::fcl::Vec3f, 2> nearest_points;
164 ar >> make_nvp(
"nearest_points", nearest_points);
167 ar >> make_nvp(
"normal", distance_result.
normal);
168 ar >> make_nvp(
"b1", distance_result.
b1);
169 ar >> make_nvp(
"b2", distance_result.
b2);
170 distance_result.
o1 = NULL;
171 distance_result.
o2 = NULL;
#define HPP_FCL_SERIALIZATION_DECLARE_EXPORT(T)
Definition: fwd.h:30
#define HPP_FCL_SERIALIZATION_SPLIT(Type)
Definition: fwd.h:24
#define HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
Definition: fwd.hh:122
#define HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
Definition: fwd.hh:120
#define HPP_FCL_COMPILER_DIAGNOSTIC_POP
Definition: fwd.hh:121
void save(Archive &ar, const hpp::fcl::BVSplitter< BV > &splitter_, const unsigned int)
Definition: BV_splitter.h:30
void load(Archive &ar, hpp::fcl::BVSplitter< BV > &splitter_, const unsigned int)
Definition: BV_splitter.h:44
void serialize(Archive &ar, hpp::fcl::AABB &aabb, const unsigned int)
Definition: AABB.h:15
Main namespace.
Definition: broadphase_bruteforce.h:44
request to the collision algorithm
Definition: collision_data.h:312
size_t num_max_contacts
The maximum number of contacts that can be returned.
Definition: collision_data.h:314
bool enable_distance_lower_bound
Whether a lower bound on distance is returned when objects are disjoint.
Definition: collision_data.h:322
FCL_REAL distance_upper_bound
Distance above which GJK solver makes an early stopping. GJK stops searching for the closest points w...
Definition: collision_data.h:341
FCL_REAL security_margin
Distance below which objects are considered in collision. See Collision.
Definition: collision_data.h:329
bool enable_contact
whether the contact information (normal, penetration depth and contact position) will return.
Definition: collision_data.h:318
FCL_REAL break_distance
Distance below which bounding volumes are broken down. See Collision.
Definition: collision_data.h:333
collision result
Definition: collision_data.h:391
std::array< Vec3f, 2 > nearest_points
nearest points. A CollisionResult can have multiple contacts. The nearest points in CollisionResults ...
Definition: collision_data.h:415
void clear()
clear the results obtained
Definition: collision_data.h:483
void addContact(const Contact &c)
add one contact into result structure
Definition: collision_data.h:431
Vec3f normal
normal associated to nearest_points. Same as CollisionResult::nearest_points but for the normal.
Definition: collision_data.h:406
void getContacts(std::vector< Contact > &contacts_) const
get all the contacts
Definition: collision_data.h:475
FCL_REAL distance_lower_bound
Definition: collision_data.h:402
request to the distance computation
Definition: collision_data.h:987
bool enable_nearest_points
whether to return the nearest points. Nearest points are always computed and are the points of the sh...
Definition: collision_data.h:998
bool enable_signed_distance
whether to compute the penetration depth when objects are in collision. Turning this off can save com...
Definition: collision_data.h:1012
FCL_REAL rel_err
error threshold for approximate distance
Definition: collision_data.h:1015
FCL_REAL abs_err
Definition: collision_data.h:1016
distance result
Definition: collision_data.h:1053
const CollisionGeometry * o2
collision object 2
Definition: collision_data.h:1073
std::array< Vec3f, 2 > nearest_points
nearest points. See CollisionResult::nearest_points.
Definition: collision_data.h:1067
Vec3f normal
normal.
Definition: collision_data.h:1063
const CollisionGeometry * o1
collision object 1
Definition: collision_data.h:1070
int b2
information about the nearest point in object 2 if object 2 is mesh or point cloud,...
Definition: collision_data.h:1085
int b1
information about the nearest point in object 1 if object 1 is mesh or point cloud,...
Definition: collision_data.h:1079
FCL_REAL min_distance
minimum distance between two objects. If two objects are in collision and DistanceRequest::enable_sig...
Definition: collision_data.h:1060
base class for all query requests
Definition: collision_data.h:171
GJKVariant gjk_variant
whether to enable the Nesterov accleration of GJK
Definition: collision_data.h:196
Vec3f cached_gjk_guess
the gjk initial guess set by user
Definition: collision_data.h:181
GJKInitialGuess gjk_initial_guess
Definition: collision_data.h:173
GJKConvergenceCriterion gjk_convergence_criterion
convergence criterion used to stop GJK
Definition: collision_data.h:199
size_t gjk_max_iterations
maximum iteration for the GJK algorithm
Definition: collision_data.h:187
support_func_guess_t cached_support_func_guess
the support function initial guess set by user
Definition: collision_data.h:184
FCL_REAL gjk_tolerance
tolerance for the GJK algorithm. Note: This tolerance determines the precision on the estimated dista...
Definition: collision_data.h:193
size_t epa_max_iterations
max number of iterations for EPA
Definition: collision_data.h:205
bool enable_timings
enable timings when performing collision/distance request
Definition: collision_data.h:215
FCL_REAL epa_tolerance
tolerance for EPA. Note: This tolerance determines the precision on the estimated distance between tw...
Definition: collision_data.h:212
bool enable_cached_gjk_guess
whether enable gjk initial guess @Deprecated Use gjk_initial_guess instead
Definition: collision_data.h:178
FCL_REAL collision_distance_threshold
threshold below which a collision is considered.
Definition: collision_data.h:218
GJKConvergenceCriterionType gjk_convergence_criterion_type
convergence criterion used to stop GJK
Definition: collision_data.h:202
base class for all query results
Definition: collision_data.h:276
support_func_guess_t cached_support_func_guess
stores the last support function vertex index, when relevant.
Definition: collision_data.h:281
Vec3f cached_gjk_guess
stores the last GJK ray when relevant.
Definition: collision_data.h:278