tsid 1.9.0
Efficient Task Space Inverse Dynamics for Multi-body Systems based on Pinocchio
Loading...
Searching...
No Matches
task-cop-equality.hpp
Go to the documentation of this file.
1//
2// Copyright (c) 2021 University of Trento
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_task_cop_hpp__
19#define __tsid_python_task_cop_hpp__
20
22
28namespace tsid {
29namespace python {
30namespace bp = boost::python;
31
32template <typename TaskCOP>
34 : public boost::python::def_visitor<
35 TaskCOPEqualityPythonVisitor<TaskCOP> > {
36 template <class PyClass>
37
38 void visit(PyClass& cl) const {
39 cl.def(bp::init<std::string, robots::RobotWrapper&>(
40 (bp::arg("name"), bp::arg("robot")), "Default Constructor"))
41 .add_property("dim", &TaskCOP::dim, "return dimension size")
43 bp::arg("ref"))
44 .def("setContactNormal",
47 bp::args("t", "q", "v", "data"))
49 .add_property("name", &TaskCOPEqualityPythonVisitor::name);
50 }
51 static std::string name(TaskCOP& self) {
52 std::string name = self.name();
53 return name;
54 }
55 static math::ConstraintEquality compute(TaskCOP& self, const double t,
56 const Eigen::VectorXd& q,
57 const Eigen::VectorXd& v,
58 pinocchio::Data& data) {
59 self.compute(t, q, v, data);
60 math::ConstraintEquality cons(self.getConstraint().name(),
61 self.getConstraint().matrix(),
62 self.getConstraint().vector());
63 return cons;
64 }
65 static math::ConstraintEquality getConstraint(const TaskCOP& self) {
66 math::ConstraintEquality cons(self.getConstraint().name(),
67 self.getConstraint().matrix(),
68 self.getConstraint().vector());
69 return cons;
70 }
71 static void setReference(TaskCOP& self, const Eigen::Vector3d& ref) {
72 self.setReference(ref);
73 }
74 static void setContactNormal(TaskCOP& self, const Eigen::Vector3d& n) {
75 self.setContactNormal(n);
76 }
77 static void expose(const std::string& class_name) {
78 std::string doc = "TaskCOPEqualityPythonVisitor info.";
79 bp::class_<TaskCOP>(class_name.c_str(), doc.c_str(), bp::no_init)
81 }
82};
83} // namespace python
84} // namespace tsid
85
86#endif // ifndef __tsid_python_task_cop_hpp__
Definition constraint-equality.hpp:13
Definition constraint-bound.hpp:26
Definition constraint-bound.hpp:25
Definition task-cop-equality.hpp:35
static math::ConstraintEquality compute(TaskCOP &self, const double t, const Eigen::VectorXd &q, const Eigen::VectorXd &v, pinocchio::Data &data)
Definition task-cop-equality.hpp:55
static void expose(const std::string &class_name)
Definition task-cop-equality.hpp:77
static std::string name(TaskCOP &self)
Definition task-cop-equality.hpp:51
static void setReference(TaskCOP &self, const Eigen::Vector3d &ref)
Definition task-cop-equality.hpp:71
static void setContactNormal(TaskCOP &self, const Eigen::Vector3d &n)
Definition task-cop-equality.hpp:74
static math::ConstraintEquality getConstraint(const TaskCOP &self)
Definition task-cop-equality.hpp:65
void visit(PyClass &cl) const
Definition task-cop-equality.hpp:38