1 |
|
|
// |
2 |
|
|
// Copyright (c) 2018 CNRS |
3 |
|
|
// |
4 |
|
|
// This file is part of tsid |
5 |
|
|
// tsid is free software: you can redistribute it |
6 |
|
|
// and/or modify it under the terms of the GNU Lesser General Public |
7 |
|
|
// License as published by the Free Software Foundation, either version |
8 |
|
|
// 3 of the License, or (at your option) any later version. |
9 |
|
|
// tsid is distributed in the hope that it will be |
10 |
|
|
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
11 |
|
|
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 |
|
|
// General Lesser Public License for more details. You should have |
13 |
|
|
// received a copy of the GNU Lesser General Public License along with |
14 |
|
|
// tsid If not, see |
15 |
|
|
// <http://www.gnu.org/licenses/>. |
16 |
|
|
// |
17 |
|
|
|
18 |
|
|
#include "tsid/bindings/python/solvers/expose-solvers.hpp" |
19 |
|
|
#include "tsid/bindings/python/solvers/HQPData.hpp" |
20 |
|
|
|
21 |
|
|
namespace tsid { |
22 |
|
|
namespace python { |
23 |
|
7 |
void exposeConstraintLevel() { |
24 |
✓✗✓✗
|
7 |
ConstPythonVisitor<ConstraintLevels>::expose("ConstraintLevel"); |
25 |
|
7 |
} |
26 |
|
7 |
void exposeHQPData() { |
27 |
|
|
typedef solvers::QPDataBaseTpl<double> QPDataBase; |
28 |
|
|
typedef solvers::QPDataTpl<double> QPData; |
29 |
|
|
typedef solvers::QPDataQuadProgTpl<double> QPDataQuadProg; |
30 |
|
|
|
31 |
✓✗✓✗
|
7 |
HQPPythonVisitor<HQPDatas>::expose("HQPData"); |
32 |
|
|
|
33 |
|
|
// expose QP data structures |
34 |
|
7 |
bp::class_<QPDataBase>("QPDataBase") |
35 |
✓✗ |
7 |
.def_readonly("H", &QPDataBase::H, "Cost matrix") |
36 |
✓✗ |
7 |
.def_readonly("g", &QPDataBase::g) |
37 |
✓✗ |
7 |
.def_readonly("CE", &QPDataBase::CE, "Equality constraint matrix") |
38 |
✓✗ |
7 |
.def_readonly("ce0", &QPDataBase::ce0); |
39 |
|
|
|
40 |
|
7 |
bp::class_<QPData, bp::bases<QPDataBase>>("QPData") |
41 |
✓✗ |
7 |
.def_readonly("CI", &QPData::CI, "Inequality constraint matrix") |
42 |
✓✗ |
7 |
.def_readonly("lb", &QPData::ci_lb, "Inequality constraint lower bound") |
43 |
✓✗ |
7 |
.def_readonly("ub", &QPData::ci_ub, "Inequality constraint upper bound"); |
44 |
|
|
|
45 |
|
7 |
bp::class_<QPDataQuadProg, bp::bases<QPDataBase>>("QPDataQuadProg") |
46 |
|
|
.def_readonly("CI", &QPDataQuadProg::CI, |
47 |
✓✗ |
7 |
"Inequality constraint matrix (unilateral)") |
48 |
|
|
.def_readonly( |
49 |
|
7 |
"ci0", &QPDataQuadProg::ci0, |
50 |
✓✗ |
7 |
"Inequality constraint vector (stacked lower and upper bounds)"); |
51 |
|
7 |
} |
52 |
|
|
} // namespace python |
53 |
|
|
} // namespace tsid |