parameters.h
Go to the documentation of this file.
1 /******************************************************************************
2 Copyright (c) 2018, Alexander W. Winkler. All rights reserved.
3 
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are met:
6 
7 * Redistributions of source code must retain the above copyright notice, this
8  list of conditions and the following disclaimer.
9 
10 * Redistributions in binary form must reproduce the above copyright notice,
11  this list of conditions and the following disclaimer in the documentation
12  and/or other materials provided with the distribution.
13 
14 * Neither the name of the copyright holder nor the names of its
15  contributors may be used to endorse or promote products derived from
16  this software without specific prior written permission.
17 
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 ******************************************************************************/
29 
30 #ifndef TOWR_OPTIMIZATION_PARAMETERS_H_
31 #define TOWR_OPTIMIZATION_PARAMETERS_H_
32 
33 #include <vector>
34 #include <array>
35 #include <utility> // std::pair, std::make_pair
36 
37 namespace towr {
38 
133 class Parameters {
134 public:
147  };
154  };
155 
156  using CostWeights = std::vector<std::pair<CostName, double>>;
157  using UsedConstraints = std::vector<ConstraintName>;
158  using VecTimes = std::vector<double>;
159  using EEID = unsigned int;
160 
164  Parameters();
165  virtual ~Parameters() = default;
166 
168  std::vector<VecTimes> ee_phase_durations_;
169 
171  std::vector<bool> ee_in_contact_at_start_;
172 
175 
178 
181 
184 
187 
190 
193 
196 
199 
201  std::vector<int> bounds_final_lin_pos_,
205 
212  std::pair<double,double> bound_phase_duration_;
213 
215  void OptimizePhaseDurations();
216 
219 
221  int GetPhaseCount(EEID ee) const;
222 
224  bool IsOptimizeTimings() const;
225 
227  int GetEECount() const;
228 
230  double GetTotalTime() const;
231 };
232 
233 } // namespace towr
234 
235 #endif /* TOWR_OPTIMIZATION_PARAMETERS_H_ */
std::pair< double, double > bound_phase_duration_
Definition: parameters.h:212
The parameters to tune the optimization problem.
Definition: parameters.h:133
sets SplineAccConstraint
Definition: parameters.h:146
sets DynamicConstraint
Definition: parameters.h:139
int GetEECount() const
The number of endeffectors.
Definition: parameters.cc:107
int force_polynomials_per_stance_phase_
Number of polynomials to parameterize each contact force during stance phase.
Definition: parameters.h:195
sets RangeOfMotionConstraint
Definition: parameters.h:140
ConstraintName
Identifiers to be used to add certain constraints to the optimization problem.
Definition: parameters.h:139
sets BaseMotionConstraint
Definition: parameters.h:145
std::vector< int > bounds_final_ang_vel_
Definition: parameters.h:201
virtual ~Parameters()=default
sets NodeCost on endeffector velocity
Definition: parameters.h:153
sets SwingConstraint
Definition: parameters.h:144
sets ForceConstraint
Definition: parameters.h:143
std::vector< int > bounds_final_lin_pos_
which dimensions (x,y,z) of the final base state should be bounded
Definition: parameters.h:201
CostName
Indentifiers to be used to add certain costs to the optimization problem.
Definition: parameters.h:152
std::vector< std::pair< CostName, double > > CostWeights
Definition: parameters.h:156
int ee_polynomials_per_swing_phase_
Number of polynomials to parameterize foot movement during swing phases.
Definition: parameters.h:192
double dt_constraint_range_of_motion_
Interval at which the range of motion constraint is enforced.
Definition: parameters.h:183
std::vector< int > bounds_final_lin_vel_
Definition: parameters.h:201
double duration_base_polynomial_
Fixed duration of each cubic polynomial describing the base motion.
Definition: parameters.h:189
double dt_constraint_dynamic_
Interval at which the dynamic constraint is enforced.
Definition: parameters.h:180
sets NodeCost on force nodes
Definition: parameters.h:152
double GetTotalTime() const
Total duration [s] of the motion.
Definition: parameters.cc:113
std::vector< VecTimes > ee_phase_durations_
Number and initial duration of each foot&#39;s swing and stance phases.
Definition: parameters.h:168
void OptimizePhaseDurations()
Specifies that timings of all feet, so the gait, should be optimized.
Definition: parameters.cc:77
double force_limit_in_normal_direction_
The maximum allowable force [N] in normal direction.
Definition: parameters.h:198
int GetPhaseCount(EEID ee) const
The number of phases allowed for endeffector ee.
Definition: parameters.cc:101
sets TotalDurationConstraint
Definition: parameters.h:141
double dt_constraint_base_motion_
Interval at which the base motion constraint is enforced.
Definition: parameters.h:186
std::vector< double > VecTimes
Definition: parameters.h:158
std::vector< int > bounds_final_ang_pos_
Definition: parameters.h:201
Parameters()
Default parameters to get started.
Definition: parameters.cc:40
std::vector< bool > ee_in_contact_at_start_
True if the foot is initially in contact with the terrain.
Definition: parameters.h:171
UsedConstraints constraints_
Which constraints should be used in the optimization problem.
Definition: parameters.h:174
unsigned int EEID
Definition: parameters.h:159
std::vector< ConstraintName > UsedConstraints
Definition: parameters.h:157
CostWeights costs_
Which costs should be used in the optimiation problem.
Definition: parameters.h:177
sets TerrainConstraint
Definition: parameters.h:142
VecTimes GetBasePolyDurations() const
The durations of each base polynomial in the spline (lin+ang).
Definition: parameters.cc:83
bool IsOptimizeTimings() const
True if the phase durations should be optimized over.
Definition: parameters.cc:129


towr
Author(s): Alexander W. Winkler
autogenerated on Mon Feb 28 2022 23:54:22