tsid 1.9.0
Efficient Task Space Inverse Dynamics for Multi-body Systems based on Pinocchio
Loading...
Searching...
No Matches
solver-HQP-eiquadprog.hpp
Go to the documentation of this file.
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#ifndef __tsid_python_solver_quadprog_hpp__
19#define __tsid_python_solver_quadprog_hpp__
20
22
28
29namespace tsid {
30namespace python {
31namespace bp = boost::python;
32
33template <typename Solver>
35 : public boost::python::def_visitor<SolverHQuadProgPythonVisitor<Solver> > {
36 template <class PyClass>
37
38 void visit(PyClass& cl) const {
39 cl.def(bp::init<const std::string&>((bp::arg("name")),
40 "Default Constructor with name"))
41
43 bp::args("n", "neq", "nin"))
44 .add_property("ObjVal", &Solver::getObjectiveValue, "return obj value")
45 .def("solve", &SolverHQuadProgPythonVisitor::solve, bp::args("HQPData"))
47 bp::args("HQPData for Python"))
48 .add_property("qpData", &Solver::getQPData, "return QP Data object")
49 .def("retrieveQPData", &Solver::retrieveQPData, bp::args("HQPData"))
51 bp::args("HQPData for Python"));
52 }
53
54 static void resize(Solver& self, unsigned int n, unsigned int neq,
55 unsigned int nin) {
56 self.resize(n, neq, nin);
57 }
58 static solvers::HQPOutput solve(Solver& self,
59 const solvers::HQPData& problemData) {
61 output = self.solve(problemData);
62 return output;
63 }
67
68 output = self.solve(data);
69
70 return output;
71 }
72
76 self.retrieveQPData(data);
77 return self.getQPData();
78 }
79
80 static void expose(const std::string& class_name) {
81 std::string doc = "Solver EiQuadProg info.";
82 bp::class_<Solver>(class_name.c_str(), doc.c_str(), bp::no_init)
84 }
85};
86} // namespace python
87} // namespace tsid
88
89#endif // ifndef __tsid_python_solver_quadprog_hpp__
Definition container.hpp:80
HQPData & get()
Definition container.hpp:116
Definition solver-HQP-output.hpp:29
Definition constraint-bound.hpp:26
QPDataQuadProgTpl< double > QPDataQuadProg
Definition fwd.hpp:104
pinocchio::container::aligned_vector< ConstraintLevel > HQPData
Definition fwd.hpp:99
Definition constraint-bound.hpp:25
Definition solver-HQP-eiquadprog.hpp:35
static solvers::HQPOutput solver_helper(Solver &self, HQPDatas &HQPDatas)
Definition solver-HQP-eiquadprog.hpp:64
static solvers::QPDataQuadProg retrieveQPData(Solver &self, HQPDatas &HQPDatas)
Definition solver-HQP-eiquadprog.hpp:73
void visit(PyClass &cl) const
Definition solver-HQP-eiquadprog.hpp:38
static void resize(Solver &self, unsigned int n, unsigned int neq, unsigned int nin)
Definition solver-HQP-eiquadprog.hpp:54
static solvers::HQPOutput solve(Solver &self, const solvers::HQPData &problemData)
Definition solver-HQP-eiquadprog.hpp:58
static void expose(const std::string &class_name)
Definition solver-HQP-eiquadprog.hpp:80