contact_allowed_validator.h
Go to the documentation of this file.
1 
27 #ifndef TESSERACT_COMMON_CONTACT_ALLOWED_VALIDATOR_H
28 #define TESSERACT_COMMON_CONTACT_ALLOWED_VALIDATOR_H
29 
30 #include <string>
31 #include <memory>
32 #include <vector>
33 
35 
36 namespace tesseract_common
37 {
40 {
41 public:
42  using Ptr = std::shared_ptr<ContactAllowedValidator>;
43  using ConstPtr = std::shared_ptr<const ContactAllowedValidator>;
44  using UPtr = std::unique_ptr<ContactAllowedValidator>;
45  using ConstUPtr = std::unique_ptr<const ContactAllowedValidator>;
46 
47  virtual ~ContactAllowedValidator() = default;
48 
49  virtual bool operator()(const std::string&, const std::string&) const = 0;
50 
51 private:
54  template <class Archive>
55  void serialize(Archive& ar, const unsigned int version); // NOLINT
56 };
57 
59 {
60 public:
61  using Ptr = std::shared_ptr<ACMContactAllowedValidator>;
62  using ConstPtr = std::shared_ptr<const ACMContactAllowedValidator>;
63  using UPtr = std::unique_ptr<ACMContactAllowedValidator>;
64  using ConstUPtr = std::unique_ptr<const ACMContactAllowedValidator>;
65 
66  ACMContactAllowedValidator() = default; // Required for serialization
68 
69  bool operator()(const std::string& link_name1, const std::string& link_name2) const override;
70 
71 protected:
73 
74 private:
77  template <class Archive>
78  void serialize(Archive& ar, const unsigned int version); // NOLINT
79 };
80 
82 enum class CombinedContactAllowedValidatorType : std::uint8_t
83 {
85  AND,
87  OR,
88 };
89 
91 {
92 public:
93  using Ptr = std::shared_ptr<CombinedContactAllowedValidator>;
94  using ConstPtr = std::shared_ptr<const CombinedContactAllowedValidator>;
95  using UPtr = std::unique_ptr<CombinedContactAllowedValidator>;
96  using ConstUPtr = std::unique_ptr<const CombinedContactAllowedValidator>;
97 
98  CombinedContactAllowedValidator() = default; // Required for serialization
99  CombinedContactAllowedValidator(std::vector<std::shared_ptr<const ContactAllowedValidator>> validators,
101 
102  bool operator()(const std::string& link_name1, const std::string& link_name2) const override;
103 
104 protected:
105  std::vector<std::shared_ptr<const ContactAllowedValidator>> validators_;
107 
108 private:
111  template <class Archive>
112  void serialize(Archive& ar, const unsigned int version); // NOLINT
113 };
114 
115 } // namespace tesseract_common
116 
117 BOOST_SERIALIZATION_ASSUME_ABSTRACT(tesseract_common::ContactAllowedValidator)
118 BOOST_CLASS_EXPORT_KEY(tesseract_common::ACMContactAllowedValidator)
120 
121 #endif // TESSERACT_COMMON_CONTACT_ALLOWED_VALIDATOR_H
allowed_collision_matrix.h
tesseract_common::CombinedContactAllowedValidatorType
CombinedContactAllowedValidatorType
Identify how the two should be combined.
Definition: contact_allowed_validator.h:82
tesseract_common::ContactAllowedValidator
Should return true if links are allowed to be in collision, otherwise false.
Definition: contact_allowed_validator.h:39
tesseract_common::CombinedContactAllowedValidator
Definition: contact_allowed_validator.h:90
tesseract_common
Definition: allowed_collision_matrix.h:19
tesseract_common::ContactAllowedValidator::~ContactAllowedValidator
virtual ~ContactAllowedValidator()=default
tesseract_common::ContactAllowedValidator::access
friend class boost::serialization::access
Definition: contact_allowed_validator.h:52
tesseract_common::Serialization
Definition: serialization.h:97
tesseract_common::ACMContactAllowedValidator::operator()
bool operator()(const std::string &link_name1, const std::string &link_name2) const override
Definition: contact_allowed_validator.cpp:46
tesseract_common::ACMContactAllowedValidator::ACMContactAllowedValidator
ACMContactAllowedValidator()=default
tesseract_common::ContactAllowedValidator::ConstUPtr
std::unique_ptr< const ContactAllowedValidator > ConstUPtr
Definition: contact_allowed_validator.h:45
tesseract_common::ContactAllowedValidator::UPtr
std::unique_ptr< ContactAllowedValidator > UPtr
Definition: contact_allowed_validator.h:44
tesseract_common::ContactAllowedValidator::Ptr
std::shared_ptr< ContactAllowedValidator > Ptr
Definition: contact_allowed_validator.h:42
tesseract_common::CombinedContactAllowedValidator::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: contact_allowed_validator.cpp:85
tesseract_common::ACMContactAllowedValidator
Definition: contact_allowed_validator.h:58
tesseract_common::CombinedContactAllowedValidator::type_
CombinedContactAllowedValidatorType type_
Definition: contact_allowed_validator.h:106
tesseract_common::CombinedContactAllowedValidator::CombinedContactAllowedValidator
CombinedContactAllowedValidator()=default
tesseract_common::CombinedContactAllowedValidatorType::AND
@ AND
Combines the two ContactAllowedValidator with AND operator.
tesseract_common::CombinedContactAllowedValidatorType::OR
@ OR
Combines the two ContactAllowedValidator with OR operator.
tesseract_common::ContactAllowedValidator::ConstPtr
std::shared_ptr< const ContactAllowedValidator > ConstPtr
Definition: contact_allowed_validator.h:43
tesseract_common::AllowedCollisionMatrix
Definition: allowed_collision_matrix.h:28
tesseract_common::ACMContactAllowedValidator::access
friend class boost::serialization::access
Definition: contact_allowed_validator.h:75
tesseract_common::CombinedContactAllowedValidator::operator()
bool operator()(const std::string &link_name1, const std::string &link_name2) const override
Definition: contact_allowed_validator.cpp:65
tesseract_common::ACMContactAllowedValidator::acm_
tesseract_common::AllowedCollisionMatrix acm_
Definition: contact_allowed_validator.h:72
tesseract_common::ContactAllowedValidator::operator()
virtual bool operator()(const std::string &, const std::string &) const =0
tesseract_common::ACMContactAllowedValidator::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: contact_allowed_validator.cpp:52
tesseract_common::ContactAllowedValidator::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: contact_allowed_validator.cpp:37
tesseract_common::CombinedContactAllowedValidator::access
friend class boost::serialization::access
Definition: contact_allowed_validator.h:109
tesseract_common::CombinedContactAllowedValidator::validators_
std::vector< std::shared_ptr< const ContactAllowedValidator > > validators_
Definition: contact_allowed_validator.h:105


tesseract_common
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:40