hpp-rbprm  4.12.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 std::shared_ptr<RbPrmDevice> RbPrmDevicePtr_t;
29 } // namespace pinocchio
30 namespace rbprm {
31 
33 class DynamicValidationReport : public core::ValidationReport {
34  public:
35  DynamicValidationReport(centroidal_dynamics::Vector3 acc) : ValidationReport(), acc_(acc) {}
37  virtual std::ostream& print(std::ostream& os) const {
38  os << "Acceleration " << acc_.transpose() << " invalid with current contacts.";
39  return os;
40  }
41 
43 };
44 
46 typedef std::shared_ptr<DynamicValidation> DynamicValidationPtr_t;
47 
48 class DynamicValidation : public core::ConfigValidation {
49  public:
50  static DynamicValidationPtr_t create(bool rectangularContact, double sizeFootX, double sizeFootY, double mass,
51  double mu, core::DevicePtr_t robot);
52 
61  virtual bool validate(const core::Configuration_t& config, core::ValidationReportPtr_t& validationReport);
62 
63  void setInitialReport(core::ValidationReportPtr_t initialReport);
64 
65  protected:
66  DynamicValidation(bool rectangularContact, double sizeFootX, double sizeFootY, double mass, double mu,
67  core::DevicePtr_t robot);
68 
69  private:
70  bool rectangularContact_;
71  double sizeFootX_;
72  double sizeFootY_;
73  double mass_;
74  double mu_;
76  centroidal_dynamics::Equilibrium* sEq_;
78  bool initContacts_;
79  core::Configuration_t lastAcc_;
82 
83 }; // class dynamicValidation
85 } // namespace rbprm
86 } // namespace hpp
87 
88 #endif // HPP_RBPRM_DYNAMIC_VALIDATION_HH
Eigen::Matrix< pinocchio::value_type, 3, 1 > Vector3
Definition: rbprm-limb.hh:48
std::shared_ptr< RbPrmDevice > RbPrmDevicePtr_t
Definition: dynamic-validation.hh:27
Definition: algorithm.hh:27
centroidal_dynamics::Vector3 acc_
Definition: dynamic-validation.hh:42
std::shared_ptr< DynamicValidation > DynamicValidationPtr_t
Definition: dynamic-validation.hh:46
centroidal_dynamics::Matrix63 Matrix63
Definition: rbprm-node.hh:20
HPP_PREDEF_CLASS(RbPrmDevice)
std::shared_ptr< RbprmValidationReport > RbprmValidationReportPtr_t
Definition: rbprm-validation-report.hh:29
Definition: rbprm-device.hh:44
DynamicValidationReport(centroidal_dynamics::Vector3 acc)
Definition: dynamic-validation.hh:35
Definition: dynamic-validation.hh:48
virtual std::ostream & print(std::ostream &os) const
Print report in a stream.
Definition: dynamic-validation.hh:37
centroidal_dynamics::Vector6 Vector6
Definition: rbprm-node.hh:21
Exception thrown when a configuration is not within the bounds.
Definition: dynamic-validation.hh:33