Loading...
Searching...
No Matches
intermediate-qp-matrices.hh
Go to the documentation of this file.
1/*
2 * Copyright 2011,
3 *
4 * Olivier Stasse
5 * Andrei Herdt
6 *
7 * JRL, CNRS/AIST
8 *
9 * This file is part of walkGenJrl.
10 * walkGenJrl is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * walkGenJrl is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Lesser Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with walkGenJrl. If not, see <http://www.gnu.org/licenses/>.
21 *
22 * Research carried out within the scope of the
23 * Joint Japanese-French Robotics Laboratory (JRL)
24 */
25
26#ifndef INTERMEDQPMAT_HH_
27#define INTERMEDQPMAT_HH_
28
29#include <privatepgtypes.hh>
30
31#include <fstream>
32#include <iostream>
33
35
36namespace PatternGeneratorJRL {
40 //
41 // Public types
42 //
43public:
48
50 reference_t Ref;
51
53 com_t CoM;
54
56 trunk_t Trunk;
57
59 Eigen::MatrixXd V;
61 Eigen::MatrixXd Vshift;
63 Eigen::MatrixXd VT;
65 Eigen::VectorXd VcX, VcY;
68 Eigen::VectorXd VcshiftX, VcshiftY;
70 Eigen::VectorXd Vc_fX, Vc_fY;
72 Eigen::MatrixXd V_f;
74 support_state_t SupportState;
75 };
78
83 double weight;
84
86 objective_e type;
87
88 std::ostream &print(std::ostream &o) const;
89 void dump(const char *filename) const;
90 };
93
94 //
95 // Public methods
96 //
97public:
103
106 inline state_variant_t const &State() const { return StateMatrices_; };
107 inline state_variant_t &State() { return StateMatrices_; };
108
109 objective_variant_t const &Objective(objective_e type) const;
110 objective_variant_t &Objective(objective_e type);
111
112 linear_inequality_t const &Inequalities(ineq_e type) const;
113 linear_inequality_t &Inequalities(ineq_e type);
114
115 inline com_t const &CoM() const { return StateMatrices_.CoM; };
116 inline void CoM(const com_t &CoM) { StateMatrices_.CoM = CoM; };
117
118 inline trunk_t const &Trunk() const { return StateMatrices_.Trunk; }
119 inline void Trunk(const trunk_t &Trunk) { StateMatrices_.Trunk = Trunk; }
120
121 inline reference_t const &Reference() const { return StateMatrices_.Ref; };
122 inline reference_t &Reference() { return StateMatrices_.Ref; };
123 inline void Reference(const reference_t &Ref) { StateMatrices_.Ref = Ref; };
124
125 inline support_state_t const &SupportState() const {
126 return StateMatrices_.SupportState;
127 };
128 inline support_state_t &SupportState() {
129 return StateMatrices_.SupportState;
130 };
131 inline void SupportState(const support_state_t &SupportState) {
132 StateMatrices_.SupportState = SupportState;
133 };
135
139 void dump_objective(objective_e type, std::ostream &aos);
140 void dump_state(std::ostream &aos);
141 void dump_objective(const char *filename, objective_e type);
142 void dump_state(const char *filename);
144
145 //
146 // Private members
147 //
148private:
149 objective_variant_t MeanVelocity_, InstantVelocity_, COPCentering_, JerkMin_;
150
151 state_variant_t StateMatrices_;
152
153 linear_inequality_t IneqCoP_, IneqCoM_, IneqFeet_;
154};
155
156std::ostream &operator<<(std::ostream &o,
158} // namespace PatternGeneratorJRL
159
160#endif /* INTERMEDQPMAT_HH_ */
Custom (value based) container providing intermediate elements for the construction of a QP.
Definition: intermediate-qp-matrices.hh:39
void Reference(const reference_t &Ref)
Definition: intermediate-qp-matrices.hh:123
objective_variant_s objective_variant_t
Definition: intermediate-qp-matrices.hh:91
state_variant_s state_variant_t
Definition: intermediate-qp-matrices.hh:76
objective_variant_t const & Objective(objective_e type) const
Definition: intermediate-qp-matrices.cpp:48
state_variant_t & State()
Definition: intermediate-qp-matrices.hh:107
state_variant_t const & State() const
Definition: intermediate-qp-matrices.hh:106
support_state_t & SupportState()
Definition: intermediate-qp-matrices.hh:128
trunk_t const & Trunk() const
Definition: intermediate-qp-matrices.hh:118
support_state_t const & SupportState() const
Definition: intermediate-qp-matrices.hh:125
IntermedQPMat()
Definition: intermediate-qp-matrices.cpp:34
void dump_state(std::ostream &aos)
Definition: intermediate-qp-matrices.cpp:121
linear_inequality_t const & Inequalities(ineq_e type) const
Definition: intermediate-qp-matrices.cpp:74
com_t const & CoM() const
Definition: intermediate-qp-matrices.hh:115
void dump_objective(objective_e type, std::ostream &aos)
Definition: intermediate-qp-matrices.cpp:104
void CoM(const com_t &CoM)
Definition: intermediate-qp-matrices.hh:116
void SupportState(const support_state_t &SupportState)
Definition: intermediate-qp-matrices.hh:131
reference_t & Reference()
Definition: intermediate-qp-matrices.hh:122
~IntermedQPMat()
Definition: intermediate-qp-matrices.cpp:45
reference_t const & Reference() const
Definition: intermediate-qp-matrices.hh:121
void Trunk(const trunk_t &Trunk)
Definition: intermediate-qp-matrices.hh:119
\doc Simulate a rigid body
Definition: patterngeneratorinterface.hh:41
std::ostream & operator<<(std::ostream &os, const COMPosition_s &aCp)
Definition: pgtypes.hh:63
Definition: intermediate-qp-matrices.hh:81
void dump(const char *filename) const
Definition: intermediate-qp-matrices.cpp:146
std::ostream & print(std::ostream &o) const
Definition: intermediate-qp-matrices.cpp:140
double weight
Ponderation.
Definition: intermediate-qp-matrices.hh:83
objective_e type
Minimization objective type.
Definition: intermediate-qp-matrices.hh:86
Definition: intermediate-qp-matrices.hh:46
Eigen::VectorXd VcshiftX
Shifted selection matrix multiplied with the current feet position.
Definition: intermediate-qp-matrices.hh:68
Eigen::MatrixXd VT
Transpose of V.
Definition: intermediate-qp-matrices.hh:63
Eigen::MatrixXd V
Selection matrix for the previewed feet positions.
Definition: intermediate-qp-matrices.hh:59
Eigen::VectorXd Vc_fX
Selection matrix for the current foot position.
Definition: intermediate-qp-matrices.hh:70
support_state_t SupportState
Current support state.
Definition: intermediate-qp-matrices.hh:74
Eigen::VectorXd VcX
Selection matrix multiplied with the current foot position.
Definition: intermediate-qp-matrices.hh:65
Eigen::MatrixXd V_f
Selection matrix for relative feet positions.
Definition: intermediate-qp-matrices.hh:72
Eigen::VectorXd Vc_fY
Definition: intermediate-qp-matrices.hh:70
Eigen::VectorXd VcshiftY
Definition: intermediate-qp-matrices.hh:68
Eigen::MatrixXd Vshift
Shifted selection matrix for the previewed feet positions.
Definition: intermediate-qp-matrices.hh:61
trunk_t Trunk
TrunkState.
Definition: intermediate-qp-matrices.hh:56
Eigen::VectorXd VcY
Definition: intermediate-qp-matrices.hh:65
reference_t Ref
Objective independent QP elements.
Definition: intermediate-qp-matrices.hh:50
com_t CoM
State of the Center of Mass.
Definition: intermediate-qp-matrices.hh:53