hpp-rbprm  4.11.0
Implementation of RB-PRM planner using hpp.
rbprm-validation.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 CNRS
3 // Authors: Steve Tonneau
4 //
5 // This file is part of hpp-rbprm
6 // hpp-rbprm is free software: you can redistribute it
7 // and/or modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation, either version
9 // 3 of the License, or (at your option) any later version.
10 //
11 // hpp-core is distributed in the hope that it will be
12 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Lesser Public License for more details. You should have
15 // received a copy of the GNU Lesser General Public License along with
16 // hpp-core If not, see
17 // <http://www.gnu.org/licenses/>.
18 
19 #ifndef HPP_RBPRM_VALIDATION_HH
20 #define HPP_RBPRM_VALIDATION_HH
21 
22 #include <hpp/core/collision-validation-report.hh>
23 #include <hpp/core/config-validation.hh>
24 #include <hpp/core/collision-validation.hh>
25 #include <hpp/core/problem-solver.hh>
29 #include <hpp/rbprm/config.hh>
30 
31 namespace hpp {
32 namespace rbprm {
33 
35 typedef std::shared_ptr<RbPrmValidation> RbPrmValidationPtr_t;
36 typedef std::map<std::string, RbPrmRomValidationPtr_t> T_RomValidation;
37 typedef hpp::core::Container<hpp::core::AffordanceObjects_t> affMap_t;
38 
41 
46 class HPP_RBPRM_DLLAPI RbPrmValidation : public core::CollisionValidation {
47  public:
48  static RbPrmValidationPtr_t create(const pinocchio::RbPrmDevicePtr_t& robot,
49  const std::vector<std::string>& filter = std::vector<std::string>(),
50  const std::map<std::string, std::vector<std::string> >& affFilters =
51  std::map<std::string, std::vector<std::string> >(),
52  const affMap_t& affordances = affMap_t(),
53  const core::ObjectStdVector_t& geometries = core::ObjectStdVector_t());
54 
60  virtual bool validate(const core::Configuration_t& config);
61 
68  virtual bool validate(const core::Configuration_t& config, core::ValidationReportPtr_t& validationReport);
69 
76  virtual bool validate(const core::Configuration_t& config, const std::vector<std::string>& filter);
77 
86  virtual bool validate(const core::Configuration_t& config, core::ValidationReportPtr_t& validationReport,
87  const std::vector<std::string>& filter);
88 
94  virtual void addObstacle(const core::CollisionObjectConstPtr_t& object);
95 
101  virtual void removeObstacleFromJoint(const core::JointPtr_t& joint, const core::CollisionObjectPtr_t& obstacle);
102 
106  virtual void randomnizeCollisionPairs();
107 
112  void computeAllContacts(bool computeAllContacts);
113 
114  private:
121  virtual bool validateTrunk(const core::Configuration_t& config, hpp::core::ValidationReportPtr_t& validationReport);
122 
126  bool validateRoms(const core::Configuration_t& config);
127 
132  bool validateRoms(const core::Configuration_t& config, core::RbprmValidationReportPtr_t& validationReport);
133 
139  bool validateRoms(const core::Configuration_t& config, const std::vector<std::string>& filter);
140 
145  bool validateRoms(const core::Configuration_t& config, const std::vector<std::string>& filter,
146  core::RbprmValidationReportPtr_t& validationReport);
147 
148  public:
150  const core::CollisionValidationPtr_t trunkValidation_;
151  const core::JointBoundValidationPtr_t boundValidation_;
153  const T_RomValidation romValidations_;
154  std::vector<std::string> defaultFilter_;
155 
156  protected:
157  RbPrmValidation(const pinocchio::RbPrmDevicePtr_t& robot, const std::vector<std::string>& filter,
158  const std::map<std::string, std::vector<std::string> >& affFilters, const affMap_t& affordances,
159  const core::ObjectStdVector_t& geometries);
160 
161  private:
162  core::ValidationReportPtr_t unusedReport_;
163 
164 }; // class RbPrmValidation
166 } // namespace rbprm
167 } // namespace hpp
168 
169 #endif // HPP_RBPRM_VALIDATION_HH
hpp::core::Container< hpp::core::AffordanceObjects_t > affMap_t
Definition: rbprm-fullbody.hh:47
#define HPP_RBPRM_DLLAPI
Definition: config.hh:64
std::shared_ptr< RbPrmDevice > RbPrmDevicePtr_t
Definition: dynamic-validation.hh:27
Definition: algorithm.hh:27
const core::CollisionValidationPtr_t trunkValidation_
CollisionValidation for the trunk.
Definition: rbprm-validation.hh:150
const T_RomValidation romValidations_
CollisionValidation for the range of motion of the limbs.
Definition: rbprm-validation.hh:153
const core::JointBoundValidationPtr_t boundValidation_
Definition: rbprm-validation.hh:151
std::shared_ptr< RbprmValidationReport > RbprmValidationReportPtr_t
Definition: rbprm-validation-report.hh:29
std::map< std::string, RbPrmRomValidationPtr_t > T_RomValidation
Definition: rbprm-validation.hh:36
std::shared_ptr< RbPrmValidation > RbPrmValidationPtr_t
Definition: rbprm-validation.hh:34
Definition: rbprm-validation.hh:46
std::vector< std::string > defaultFilter_
Definition: rbprm-validation.hh:154