hpp-rbprm  4.10.0
Implementation of RB-PRM planner using hpp.
dynamic-validation.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2017 CNRS
3 // Authors: Fernbach Pierre
4 //
5 // This file is part of hpp-rbprm
6 // hpp-core 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_DYNAMIC_VALIDATION_HH
20 # define HPP_RBPRM_DYNAMIC_VALIDATION_HH
21 
22 # include <hpp/core/config-validation.hh>
23 # include <hpp/centroidal-dynamics/centroidal_dynamics.hh>
25 namespace hpp {
26  namespace pinocchio {
27  class RbPrmDevice; //fwd declaration of rbprmDevice class
28  typedef boost::shared_ptr <RbPrmDevice> RbPrmDevicePtr_t;
29  }
30  namespace rbprm {
31 
32 
34  class DynamicValidationReport : public core::ValidationReport
35  {
36  public:
38  ValidationReport (),acc_(acc)
39  {
40  }
42  virtual std::ostream& print (std::ostream& os) const
43  {
44  os << "Acceleration "<<acc_.transpose()<<" invalid with current contacts.";
45  return os;
46  }
47 
49  };
50 
51 
52 
54  typedef boost::shared_ptr <DynamicValidation> DynamicValidationPtr_t;
55 
56  class DynamicValidation : public core::ConfigValidation
57  {
58  public:
59  static DynamicValidationPtr_t create (bool rectangularContact, double sizeFootX, double sizeFootY, double mass, double mu,core::DevicePtr_t robot);
60 
61 
69  virtual bool validate (const core::Configuration_t& config, core::ValidationReportPtr_t& validationReport);
70 
71  void setInitialReport(core::ValidationReportPtr_t initialReport);
72 
73 
74 
75  protected:
76  DynamicValidation (bool rectangularContact, double sizeFootX, double sizeFootY, double mass, double mu,core::DevicePtr_t robot);
77  private:
78  bool rectangularContact_;
79  double sizeFootX_;
80  double sizeFootY_;
81  double mass_;
82  double mu_;
84  centroidal_dynamics::Equilibrium* sEq_;
86  bool initContacts_;
87  core::Configuration_t lastAcc_;
90 
91  }; // class dynamicValidation
93  } // namespace rbprm
94 } // namespace hpp
95 
96 #endif // HPP_RBPRM_DYNAMIC_VALIDATION_HH
hpp::rbprm::HPP_PREDEF_CLASS
HPP_PREDEF_CLASS(RbPrmFullBody)
hpp::rbprm::DynamicValidation::create
static DynamicValidationPtr_t create(bool rectangularContact, double sizeFootX, double sizeFootY, double mass, double mu, core::DevicePtr_t robot)
hpp::rbprm::Vector3
Eigen::Matrix< pinocchio::value_type, 3, 1 > Vector3
Definition: rbprm-limb.hh:50
hpp::rbprm::DynamicValidation::validate
virtual bool validate(const core::Configuration_t &config, core::ValidationReportPtr_t &validationReport)
hpp::rbprm::DynamicValidation::setInitialReport
void setInitialReport(core::ValidationReportPtr_t initialReport)
hpp::rbprm::DynamicValidationPtr_t
boost::shared_ptr< DynamicValidation > DynamicValidationPtr_t
Definition: dynamic-validation.hh:54
hpp::rbprm::DynamicValidationReport::print
virtual std::ostream & print(std::ostream &os) const
Print report in a stream.
Definition: dynamic-validation.hh:42
hpp::rbprm::DynamicValidation::DynamicValidation
DynamicValidation(bool rectangularContact, double sizeFootX, double sizeFootY, double mass, double mu, core::DevicePtr_t robot)
hpp::core::Matrix63
centroidal_dynamics::Matrix63 Matrix63
Definition: rbprm-node.hh:21
hpp
Definition: algorithm.hh:27
rbprm-validation-report.hh
hpp::pinocchio::RbPrmDevicePtr_t
boost::shared_ptr< RbPrmDevice > RbPrmDevicePtr_t
Definition: dynamic-validation.hh:27
hpp::pinocchio::RbPrmDevice
Definition: rbprm-device.hh:44
hpp::core::Vector6
centroidal_dynamics::Vector6 Vector6
Definition: rbprm-node.hh:22
hpp::rbprm::DynamicValidationReport::DynamicValidationReport
DynamicValidationReport(centroidal_dynamics::Vector3 acc)
Definition: dynamic-validation.hh:37
hpp::core::RbprmValidationReportPtr_t
boost::shared_ptr< RbprmValidationReport > RbprmValidationReportPtr_t
Definition: rbprm-validation-report.hh:29
hpp::rbprm::DynamicValidationReport
Exception thrown when a configuration is not within the bounds.
Definition: dynamic-validation.hh:34
hpp::rbprm::DynamicValidationReport::acc_
centroidal_dynamics::Vector3 acc_
Definition: dynamic-validation.hh:48
hpp::rbprm::DynamicValidation
Definition: dynamic-validation.hh:56