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
30#include <fstream>
31#include <iostream>
32#include <privatepgtypes.hh>
33
34namespace PatternGeneratorJRL {
38 //
39 // Public types
40 //
41 public:
46
48 reference_t Ref;
49
51 com_t CoM;
52
54 trunk_t Trunk;
55
57 Eigen::MatrixXd V;
59 Eigen::MatrixXd Vshift;
61 Eigen::MatrixXd VT;
63 Eigen::VectorXd VcX, VcY;
66 Eigen::VectorXd VcshiftX, VcshiftY;
68 Eigen::VectorXd Vc_fX, Vc_fY;
70 Eigen::MatrixXd V_f;
72 support_state_t SupportState;
73 };
76
81 double weight;
82
84 objective_e type;
85
86 std::ostream &print(std::ostream &o) const;
87 void dump(const char *filename) const;
88 };
91
92 //
93 // Public methods
94 //
95 public:
101
104 inline state_variant_t const &State() const { return StateMatrices_; };
105 inline state_variant_t &State() { return StateMatrices_; };
106
107 objective_variant_t const &Objective(objective_e type) const;
108 objective_variant_t &Objective(objective_e type);
109
110 linear_inequality_t const &Inequalities(ineq_e type) const;
111 linear_inequality_t &Inequalities(ineq_e type);
112
113 inline com_t const &CoM() const { return StateMatrices_.CoM; };
114 inline void CoM(const com_t &CoM) { StateMatrices_.CoM = CoM; };
115
116 inline trunk_t const &Trunk() const { return StateMatrices_.Trunk; }
117 inline void Trunk(const trunk_t &Trunk) { StateMatrices_.Trunk = Trunk; }
118
119 inline reference_t const &Reference() const { return StateMatrices_.Ref; };
120 inline reference_t &Reference() { return StateMatrices_.Ref; };
121 inline void Reference(const reference_t &Ref) { StateMatrices_.Ref = Ref; };
122
123 inline support_state_t const &SupportState() const {
124 return StateMatrices_.SupportState;
125 };
126 inline support_state_t &SupportState() {
127 return StateMatrices_.SupportState;
128 };
129 inline void SupportState(const support_state_t &SupportState) {
130 StateMatrices_.SupportState = SupportState;
131 };
133
137 void dump_objective(objective_e type, std::ostream &aos);
138 void dump_state(std::ostream &aos);
139 void dump_objective(const char *filename, objective_e type);
140 void dump_state(const char *filename);
142
143 //
144 // Private members
145 //
146 private:
147 objective_variant_t MeanVelocity_, InstantVelocity_, COPCentering_, JerkMin_;
148
149 state_variant_t StateMatrices_;
150
151 linear_inequality_t IneqCoP_, IneqCoM_, IneqFeet_;
152};
153
154std::ostream &operator<<(std::ostream &o,
156} // namespace PatternGeneratorJRL
157
158#endif /* INTERMEDQPMAT_HH_ */
Custom (value based) container providing intermediate elements for the construction of a QP.
Definition intermediate-qp-matrices.hh:37
void Reference(const reference_t &Ref)
Definition intermediate-qp-matrices.hh:121
objective_variant_s objective_variant_t
Definition intermediate-qp-matrices.hh:89
state_variant_s state_variant_t
Definition intermediate-qp-matrices.hh:74
objective_variant_t const & Objective(objective_e type) const
Definition intermediate-qp-matrices.cpp:46
state_variant_t & State()
Definition intermediate-qp-matrices.hh:105
state_variant_t const & State() const
Definition intermediate-qp-matrices.hh:104
support_state_t & SupportState()
Definition intermediate-qp-matrices.hh:126
trunk_t const & Trunk() const
Definition intermediate-qp-matrices.hh:116
support_state_t const & SupportState() const
Definition intermediate-qp-matrices.hh:123
IntermedQPMat()
Definition intermediate-qp-matrices.cpp:34
void dump_state(std::ostream &aos)
Definition intermediate-qp-matrices.cpp:119
linear_inequality_t const & Inequalities(ineq_e type) const
Definition intermediate-qp-matrices.cpp:73
com_t const & CoM() const
Definition intermediate-qp-matrices.hh:113
void dump_objective(objective_e type, std::ostream &aos)
Definition intermediate-qp-matrices.cpp:103
void CoM(const com_t &CoM)
Definition intermediate-qp-matrices.hh:114
void SupportState(const support_state_t &SupportState)
Definition intermediate-qp-matrices.hh:129
reference_t & Reference()
Definition intermediate-qp-matrices.hh:120
~IntermedQPMat()
Definition intermediate-qp-matrices.cpp:44
reference_t const & Reference() const
Definition intermediate-qp-matrices.hh:119
void Trunk(const trunk_t &Trunk)
Definition intermediate-qp-matrices.hh:117
\doc Simulate a rigid body
Definition patterngeneratorinterface.hh:41
std::ostream & operator<<(std::ostream &os, const COMPosition_s &aCp)
Definition pgtypes.hh:62
Definition intermediate-qp-matrices.hh:79
void dump(const char *filename) const
Definition intermediate-qp-matrices.cpp:144
std::ostream & print(std::ostream &o) const
Definition intermediate-qp-matrices.cpp:138
double weight
Ponderation.
Definition intermediate-qp-matrices.hh:81
objective_e type
Minimization objective type.
Definition intermediate-qp-matrices.hh:84
Definition intermediate-qp-matrices.hh:44
Eigen::VectorXd VcshiftX
Shifted selection matrix multiplied with the current feet position.
Definition intermediate-qp-matrices.hh:66
Eigen::MatrixXd VT
Transpose of V.
Definition intermediate-qp-matrices.hh:61
Eigen::MatrixXd V
Selection matrix for the previewed feet positions.
Definition intermediate-qp-matrices.hh:57
Eigen::VectorXd Vc_fX
Selection matrix for the current foot position.
Definition intermediate-qp-matrices.hh:68
support_state_t SupportState
Current support state.
Definition intermediate-qp-matrices.hh:72
Eigen::VectorXd VcX
Selection matrix multiplied with the current foot position.
Definition intermediate-qp-matrices.hh:63
Eigen::MatrixXd V_f
Selection matrix for relative feet positions.
Definition intermediate-qp-matrices.hh:70
Eigen::VectorXd Vc_fY
Definition intermediate-qp-matrices.hh:68
Eigen::VectorXd VcshiftY
Definition intermediate-qp-matrices.hh:66
Eigen::MatrixXd Vshift
Shifted selection matrix for the previewed feet positions.
Definition intermediate-qp-matrices.hh:59
trunk_t Trunk
TrunkState.
Definition intermediate-qp-matrices.hh:54
Eigen::VectorXd VcY
Definition intermediate-qp-matrices.hh:63
reference_t Ref
Objective independent QP elements.
Definition intermediate-qp-matrices.hh:48
com_t CoM
State of the Center of Mass.
Definition intermediate-qp-matrices.hh:51