humoto
task_copvelocity.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4  @author Jan Michalczyk
5  @copyright 2014-2017 INRIA. Licensed under the Apache License, Version 2.0.
6  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
7 
8  @brief
9 */
10 
11 #pragma once
12 
13 namespace humoto
14 {
15  namespace wpg04
16  {
17  /**
18  * @brief [task_dz.m]
19  */
21  {
22  #define HUMOTO_CONFIG_ENTRIES \
23  HUMOTO_CONFIG_PARENT_CLASS(TaskAB)
24  #include HUMOTO_CONFIG_DEFINE_ACCESSORS
25 
26 
27  protected:
28  void setDefaults()
29  {
31  setGain(0.223606797749979);
32  }
33 
34 
35  void finalize()
36  {
38  }
39 
40 
41  public:
42  explicit TaskCoPVelocity (const double gain = 0.223606797749979)
43  : TaskAB("TaskCoPVelocity", gain)
44  {
45  }
46 
47 
48  /// @copydoc humoto::TaskBase::form
49  void form( const humoto::SolutionStructure &sol_structure,
50  const humoto::Model &model_base,
51  const humoto::ControlProblem &control_problem)
52  {
53  const humoto::wpg04::MPCforWPG &mpc = dynamic_cast <const humoto::wpg04::MPCforWPG &> (control_problem);
54 
55 
56  Eigen::MatrixXd &A = getA();
57  Eigen::VectorXd &b = getB();
58 
59  A.resize(mpc.Sdz_.rows(), sol_structure.getNumberOfVariables());
60 
61 
62  sol_structure.getMatrixPart(COP_VARIABLES_ID, A).noalias() =
63  getGain() * sol_structure.getMatrixPart(COP_VARIABLES_ID, mpc.Sdz_);
64 
65  sol_structure.getMatrixPart(FOOTPOS_VARIABLES_ID, A).noalias() =
66  getGain() * sol_structure.getMatrixPart(FOOTPOS_VARIABLES_ID, mpc.Sdz_);
67 
68 
69  b.noalias() = -getGain() * mpc.sdz_;
70  };
71  };
72  }
73 }
Abstract base class (for control problems)
std::size_t getNumberOfVariables() const
Get total number of variables in the solution vector.
Definition: solution.h:109
static const char * COP_VARIABLES_ID
Definition: common.h:17
void finalize()
This function is called automaticaly after reading a configuration file. Does nothing by default...
#define HUMOTO_LOCAL
Definition: export_import.h:26
Eigen::Block< Eigen::MatrixXd > getMatrixPart(const std::string &id, Eigen::MatrixXd &matrix) const
Get part of a matrix corresponding to given part of the solution.
Definition: solution.h:147
void setDefaults()
Set members to their default values.
Analog of &#39;sol_structure&#39; struct in Octave code. [determine_solution_structure.m].
Definition: solution.h:33
virtual void setDefaults()
Set members to their default values.
Definition: task.h:332
Eigen::MatrixXd Sdz_
Definition: mpc_wpg.h:247
static const char * FOOTPOS_VARIABLES_ID
Definition: common.h:18
Model Predictive Control problem for walking pattern generation [determine_solution_structure.m, form_rotation_matrices.m, form_foot_pos_matrices.m, form_condensing_matrices.m].
Definition: mpc_wpg.h:21
The root namespace of HuMoTo.
Definition: config.h:12
Instances of this class are passed to a virtual method &#39;humoto::TaskBase::form()&#39;, so even though this class is basically useless in its present form we cannot avoid its definition using a template.
Definition: model.h:41
TaskCoPVelocity(const double gain=0.223606797749979)
void finalize()
This function is called automaticaly after reading a configuration file. Does nothing by default...
Definition: task.h:337
Eigen::MatrixXd sdz_
Definition: mpc_wpg.h:248
Task: A*x = b.
Definition: task.h:542
void form(const humoto::SolutionStructure &sol_structure, const humoto::Model &model_base, const humoto::ControlProblem &control_problem)
Form the task.