hpp-rbprm 4.15.1
Implementation of RB-PRM planner using hpp.
Loading...
Searching...
No Matches
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/centroidal-dynamics/centroidal_dynamics.hh>
23#include <hpp/core/config-validation.hh>
25namespace hpp {
26namespace pinocchio {
27class RbPrmDevice; // fwd declaration of rbprmDevice class
28typedef shared_ptr<RbPrmDevice> RbPrmDevicePtr_t;
29} // namespace pinocchio
30namespace rbprm {
31
33class DynamicValidationReport : public core::ValidationReport {
34 public:
35 DynamicValidationReport(centroidal_dynamics::Vector3 acc)
36 : ValidationReport(), acc_(acc) {}
38 virtual std::ostream& print(std::ostream& os) const {
39 os << "Acceleration " << acc_.transpose()
40 << " invalid with current contacts.";
41 return os;
42 }
43
44 centroidal_dynamics::Vector3 acc_;
45};
46
48typedef shared_ptr<DynamicValidation> DynamicValidationPtr_t;
49
50class DynamicValidation : public core::ConfigValidation {
51 public:
52 static DynamicValidationPtr_t create(bool rectangularContact,
53 double sizeFootX, double sizeFootY,
54 double mass, double mu,
55 core::DevicePtr_t robot);
56
65 virtual bool validate(const core::Configuration_t& config,
66 core::ValidationReportPtr_t& validationReport);
67
68 void setInitialReport(core::ValidationReportPtr_t initialReport);
69
70 protected:
71 DynamicValidation(bool rectangularContact, double sizeFootX, double sizeFootY,
72 double mass, double mu, core::DevicePtr_t robot);
73
74 private:
75 bool rectangularContact_;
76 double sizeFootX_;
77 double sizeFootY_;
78 double mass_;
79 double mu_;
81 centroidal_dynamics::Equilibrium* sEq_;
83 bool initContacts_;
84 core::Configuration_t lastAcc_;
85 centroidal_dynamics::Matrix63 H_;
86 centroidal_dynamics::Vector6 h_;
87
88}; // class dynamicValidation
90} // namespace rbprm
91} // namespace hpp
92
93#endif // HPP_RBPRM_DYNAMIC_VALIDATION_HH
Definition: rbprm-device.hh:43
Exception thrown when a configuration is not within the bounds.
Definition: dynamic-validation.hh:33
DynamicValidationReport(centroidal_dynamics::Vector3 acc)
Definition: dynamic-validation.hh:35
centroidal_dynamics::Vector3 acc_
Definition: dynamic-validation.hh:44
virtual std::ostream & print(std::ostream &os) const
Print report in a stream.
Definition: dynamic-validation.hh:38
Definition: dynamic-validation.hh:50
virtual bool validate(const core::Configuration_t &config, core::ValidationReportPtr_t &validationReport)
DynamicValidation(bool rectangularContact, double sizeFootX, double sizeFootY, double mass, double mu, core::DevicePtr_t robot)
void setInitialReport(core::ValidationReportPtr_t initialReport)
static DynamicValidationPtr_t create(bool rectangularContact, double sizeFootX, double sizeFootY, double mass, double mu, core::DevicePtr_t robot)
shared_ptr< RbprmValidationReport > RbprmValidationReportPtr_t
Definition: rbprm-validation-report.hh:29
shared_ptr< RbPrmDevice > RbPrmDevicePtr_t
Definition: dynamic-validation.hh:28
shared_ptr< DynamicValidation > DynamicValidationPtr_t
Definition: dynamic-validation.hh:48
HPP_PREDEF_CLASS(RbPrmFullBody)
Definition: algorithm.hh:26