Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1
25#ifndef TESSERACT_COLLISION_CORE_UTILS_H
26#define TESSERACT_COLLISION_CORE_UTILS_H
27
34
35namespace tesseract_collision
36{
45 const IsContactAllowedFn& override,
47
54template <typename ManagerType>
58{
59 IsContactAllowedFn original = manager.getIsContactAllowedFn();
60 IsContactAllowedFn override = [acm](const std::string& str1, const std::string& str2) {
61 return acm.isCollisionAllowed(str1, str2);
62 };
63 manager.setIsContactAllowedFn(combineContactAllowedFn(original, override, type));
64}
65
72template <typename ManagerType>
73inline void applyModifyObjectEnabled(ManagerType& manager,
74 const std::unordered_map<std::string, bool>& modify_object_enabled)
75{
76 for (const auto& entry : modify_object_enabled)
77 {
78 if (entry.second)
79 manager.enableCollisionObject(entry.first);
80 else
81 manager.disableCollisionObject(entry.first);
82 }
83}
84} // namespace tesseract_collision
85
86#endif // TESSERACT_COLLISION_TYPES_H
Definition: allowed_collision_matrix.h:23
auto acm
Definition: collision_core_unit.cpp:33
This is the continuous contact manager base class.
This is the discrete contact manager base class.
Common Tesseract Macros.
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
Definition: bullet_cast_bvh_manager.h:49
void applyIsContactAllowedFnOverride(ManagerType &manager, const tesseract_common::AllowedCollisionMatrix &acm, ACMOverrideType type)
Applies ACM to contact manager using override type.
Definition: utils.h:55
IsContactAllowedFn combineContactAllowedFn(const IsContactAllowedFn &original, const IsContactAllowedFn &override, ACMOverrideType type=ACMOverrideType::OR)
Combines two IsContactAllowedFns using the override type.
Definition: utils.cpp:30
void applyModifyObjectEnabled(ManagerType &manager, const std::unordered_map< std::string, bool > &modify_object_enabled)
Loops over the map and for every object string either enables or disables it based on the value (true...
Definition: utils.h:73
ACMOverrideType
Identifies how the provided AllowedCollisionMatrix should be applied relative to the isAllowedFn in t...
Definition: types.h:373
@ OR
New IsContactAllowedFn combines the contact manager fn and the ACM generated fn with and OR.
std::function< bool(const std::string &, const std::string &)> IsContactAllowedFn
Should return true if contact allowed, otherwise false.
Definition: types.h:59
Tesseracts Collision Common Types.
mCollisionCheckConfig contact_request type
Definition: tesseract_environment_collision.cpp:103
DiscreteContactManager::Ptr manager
Definition: tesseract_environment_collision.cpp:109