29 #ifndef HPP_MANIPULATION_GRAPHPATHVALIDATOR_HH
30 #define HPP_MANIPULATION_GRAPHPATHVALIDATOR_HH
32 #include <hpp/core/obstacle-user.hh>
33 #include <hpp/core/path-validation.hh>
39 namespace manipulation {
40 using hpp::core::Path;
41 using hpp::core::PathPtr_t;
42 using hpp::core::PathValidation;
44 using hpp::core::PathVector;
45 using hpp::core::PathVectorPtr_t;
57 :
public PathValidation,
58 public core::ObstacleUserInterface {
71 virtual bool validate(
const PathPtr_t& path,
bool reverse,
77 pathValidation_ = pathValidation;
85 constraintGraph_ = graph;
107 void addObstacle(
const hpp::core::CollisionObjectConstPtr_t&
object) {
108 shared_ptr<core::ObstacleUserInterface> oui =
109 HPP_DYNAMIC_PTR_CAST(core::ObstacleUserInterface, pathValidation_);
110 if (oui) oui->addObstacle(
object);
121 const pinocchio::CollisionObjectConstPtr_t& obstacle) {
122 shared_ptr<core::ObstacleUserInterface> oui =
123 HPP_DYNAMIC_PTR_CAST(core::ObstacleUserInterface, pathValidation_);
124 if (oui) oui->removeObstacleFromJoint(joint, obstacle);
134 const core::RelativeMotion::matrix_type& relMotion) {
135 shared_ptr<core::ObstacleUserInterface> oui =
136 HPP_DYNAMIC_PTR_CAST(core::ObstacleUserInterface, pathValidation_);
137 if (oui) oui->filterCollisionPairs(relMotion);
147 shared_ptr<core::ObstacleUserInterface> oui =
148 HPP_DYNAMIC_PTR_CAST(core::ObstacleUserInterface, pathValidation_);
149 if (oui) oui->setSecurityMargins(securityMargins);
159 const std::string& body_b,
161 shared_ptr<core::ObstacleUserInterface> oui =
162 HPP_DYNAMIC_PTR_CAST(core::ObstacleUserInterface, pathValidation_);
163 if (oui) oui->setSecurityMarginBetweenBodies(body_a, body_b, margin);
172 bool impl_validate(
const PathVectorPtr_t& path,
bool reverse,
175 bool impl_validate(
const PathPtr_t& path,
bool reverse, PathPtr_t& validPart,
183 template <
typename T>
Definition: graph-path-validation.hh:58
static GraphPathValidationPtr_t create(const PathValidationPtr_t &pathValidation)
void setSecurityMargins(const matrix_t &securityMargins)
Definition: graph-path-validation.hh:146
const PathValidationPtr_t & innerValidation()
Get the encapsulated path validator.
Definition: graph-path-validation.hh:81
void innerValidation(const PathValidationPtr_t &pathValidation)
Set the encapsulated path validator.
Definition: graph-path-validation.hh:76
GraphPathValidation(const PathValidationPtr_t &pathValidation)
Constructor.
void constraintGraph(const graph::GraphPtr_t &graph)
Set the graph of constraints.
Definition: graph-path-validation.hh:84
void setSecurityMarginBetweenBodies(const std::string &body_a, const std::string &body_b, const value_type &margin)
Definition: graph-path-validation.hh:158
virtual bool validate(const PathPtr_t &path, bool reverse, PathPtr_t &validPart, PathValidationReportPtr_t &report)
void addObstacle(const hpp::core::CollisionObjectConstPtr_t &object)
Definition: graph-path-validation.hh:107
void filterCollisionPairs(const core::RelativeMotion::matrix_type &relMotion)
Filter collision pairs.
Definition: graph-path-validation.hh:133
graph::GraphPtr_t constraintGraph() const
Get the graph of constraints.
Definition: graph-path-validation.hh:89
void removeObstacleFromJoint(const JointPtr_t &joint, const pinocchio::CollisionObjectConstPtr_t &obstacle)
Definition: graph-path-validation.hh:119
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:88
shared_ptr< Graph > GraphPtr_t
Definition: fwd.hh:47
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:43
core::PathValidationPtr_t PathValidationPtr_t
Definition: fwd.hh:144
core::PathValidationReportPtr_t PathValidationReportPtr_t
Definition: fwd.hh:145
shared_ptr< GraphPathValidation > GraphPathValidationPtr_t
Definition: fwd.hh:110
core::value_type value_type
Definition: fwd.hh:89
shared_ptr< Device > DevicePtr_t
Definition: fwd.hh:40
core::matrix_t matrix_t
Definition: fwd.hh:146