hpp-wholebody-step  4.12.0
Path planning for humanoid robot by sliding on the groud.
small-steps.hh
Go to the documentation of this file.
1 // This file is part of hpp-wholebody-step.
7 // hpp-wholebody-step-planner is free software: you can redistribute it
8 // and/or modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation, either version
10 // 3 of the License, or (at your option) any later version.
11 //
12 // hpp-wholebody-step-planner is distributed in the hope that it will be
13 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Lesser Public License for more details. You should have
16 // received a copy of the GNU Lesser General Public License along with
17 // hpp-wholebody-step-planner. If not, see
18 // <http://www.gnu.org/licenses/>.
19 
20 #ifndef HPP_WHOLEBODY_STEP_SMALL_STEPS_HH
21 # define HPP_WHOLEBODY_STEP_SMALL_STEPS_HH
22 
23 # include <hpp/core/path-optimizer.hh>
24 # include <hpp/walkgen/foot-print.hh>
25 # include <hpp/wholebody-step/fwd.hh>
27 
28 namespace hpp {
29  namespace wholebodyStep {
34  class HPP_WHOLEBODY_STEP_DLLAPI SmallSteps : public core::PathOptimizer
35  {
36  public:
37  typedef walkgen::FootPrints_t FootPrints_t;
38  typedef walkgen::Times_t Times_t;
39  typedef std::map <value_type, value_type> TimeToParameterMap_t;
40 
43  {
45 
46  value_type operator () (const value_type& t) const;
48  void addPair (const value_type& t, const value_type value);
49 
50  Pairs_t pairs_;
51  }; // class PiecewiseAffine
52 
59  static SmallStepsPtr_t create (const ProblemConstPtr_t& problem);
61  virtual PathVectorPtr_t optimize (const PathVectorPtr_t& path);
62 
66  All
67  };
68  struct HandConstraint {
69  bool active;
70  bool optional;
73 
75  active (false), optional (false), type (All), abscissa (-1) {}
76  };
77 
79 
80  protected:
82  SmallSteps (const ProblemConstPtr_t& problem);
84  void init (const SmallStepsWkPtr_t& weak);
85  private:
86 
87  void getStepParameters (const PathVectorPtr_t& path);
88  FootPrint footPrintAtParam (const PathPtr_t& path, value_type s, bool right) const;
89  Times_t buildInitialTimes (const std::size_t& p);
93  PathVectorPtr_t generateOptimizedPath (const PathVectorPtr_t path,
94  const PiecewiseAffine& TTP, CubicBSplinePtr_t com,
95  value_type comHeight, value_type ankleShift,
96  value_type& failureParameter);
97  ConstraintSetPtr_t copyNonStabilityConstraints (ConstraintSetPtr_t orig)
98  const;
100  bool narrowAtTime (const value_type& t, const PathPtr_t& path,
101  const PiecewiseAffine& param, Times_t& times);
102 
103  HumanoidRobotPtr_t robot_;
104  value_type minStepLength_;
105  value_type maxStepLength_;
106  value_type defaultStepHeight_;
107  value_type defaultDoubleSupportTime_;
108  value_type defaultSingleSupportTime_;
109  // Transition time of the ZMP between initial COM position to first step.
110  value_type defaultInitializationTime_;
111  SplineBasedPtr_t pg_;
112  // Parameters along the input path at which positions of the feet are
113  // chosen as foot print
114  std::vector <value_type> stepParameters_;
115  FootPrints_t footPrints_;
116  std::vector <bool> footPrintsIsRight_;
117  SmallStepsWkPtr_t weakPtr_;
118  }; // class SmallSteps
119  } // namespace wholebodyStep
120 } // namespace hpp
121 #endif // HPP_WHOLEBODY_STEP_SMALL_STEPS_HH
Pairs_t pairs_
Definition: small-steps.hh:50
SmallSteps::TimeToParameterMap_t Pairs_t
Definition: small-steps.hh:44
pinocchio::HumanoidRobotPtr_t HumanoidRobotPtr_t
Definition: fwd.hh:62
Definition: fwd.hh:28
walkgen::Times_t Times_t
Definition: small-steps.hh:38
walkgen::FootPrints_t FootPrints_t
Definition: small-steps.hh:37
walkgen::FootPrint FootPrint
Definition: fwd.hh:79
std::map< value_type, value_type > TimeToParameterMap_t
Definition: small-steps.hh:39
core::value_type value_type
Definition: fwd.hh:76
bool optional
Definition: small-steps.hh:70
Definition: small-steps.hh:65
HandConstraint rightHand_
Definition: small-steps.hh:78
HandConstraintType
Definition: small-steps.hh:63
core::PathPtr_t PathPtr_t
Definition: fwd.hh:52
walkgen::SplineBasedPtr_t SplineBasedPtr_t
Definition: fwd.hh:80
Definition: small-steps.hh:64
bool active
Definition: small-steps.hh:69
core::ConstraintSetPtr_t ConstraintSetPtr_t
Definition: fwd.hh:33
core::PathVectorPtr_t PathVectorPtr_t
Definition: fwd.hh:54
value_type abscissa
Definition: small-steps.hh:72
Compute parameter along initial path with respect to time.
Definition: small-steps.hh:42
walkgen::CubicBSplinePtr_t CubicBSplinePtr_t
Definition: fwd.hh:82
#define HPP_WHOLEBODY_STEP_DLLAPI
Definition: config.hh:64
std::shared_ptr< SmallSteps > SmallStepsPtr_t
Definition: fwd.hh:85
Definition: small-steps.hh:34
core::ProblemConstPtr_t ProblemConstPtr_t
Definition: fwd.hh:48
HandConstraintType type
Definition: small-steps.hh:71
HandConstraint()
Definition: small-steps.hh:74