bindings/python/tasks/task-actuation-bounds.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_task_actuation_bounds_hpp__
19 #define __tsid_python_task_actuation_bounds_hpp__
20 
22 
27 
28 namespace tsid {
29 namespace python {
30 namespace bp = boost::python;
31 
32 template <typename Task>
34  : public boost::python::def_visitor<
35  TaskActuationBoundsPythonVisitor<Task> > {
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", &Task::dim, "return dimension size")
42  .add_property("mask",
43  bp::make_function(
45  bp::return_value_policy<bp::copy_const_reference>()),
46  "Return mask")
48  bp::arg("mask"))
50  bp::args("lower", "upper"))
52  bp::args("t", "q", "v", "data"))
54  .add_property("getLowerBounds",
55  bp::make_function(
57  bp::return_value_policy<bp::copy_const_reference>()))
58  .add_property("getUpperBounds",
59  bp::make_function(
61  bp::return_value_policy<bp::copy_const_reference>()))
62  .add_property("name", &TaskActuationBoundsPythonVisitor::name);
63  }
64  static std::string name(Task& self) {
65  std::string name = self.name();
66  return name;
67  }
68  static math::ConstraintInequality compute(Task& self, const double t,
69  const Eigen::VectorXd& q,
70  const Eigen::VectorXd& v,
72  self.compute(t, q, v, data);
74  self.getConstraint().name(), self.getConstraint().matrix(),
75  self.getConstraint().lowerBound(), self.getConstraint().upperBound());
76  return cons;
77  }
78  static math::ConstraintInequality getConstraint(const Task& self) {
80  self.getConstraint().name(), self.getConstraint().matrix(),
81  self.getConstraint().lowerBound(), self.getConstraint().upperBound());
82  return cons;
83  }
84  static const Eigen::VectorXd& getmask(const Task& self) {
85  return self.mask();
86  }
87  static void setmask(Task& self, const Eigen::VectorXd mask) {
88  return self.mask(mask);
89  }
90  static const Eigen::VectorXd& getLowerBounds(const Task& self) {
91  return self.getLowerBounds();
92  }
93  static const Eigen::VectorXd& getUpperBounds(const Task& self) {
94  return self.getUpperBounds();
95  }
96  static void setBounds(Task& self, const Eigen::VectorXd lower,
97  const Eigen::VectorXd upper) {
98  return self.setBounds(lower, upper);
99  }
100  static void expose(const std::string& class_name) {
101  std::string doc = "Task info.";
102  bp::class_<Task>(class_name.c_str(), doc.c_str(), bp::no_init)
104  }
105 };
106 } // namespace python
107 } // namespace tsid
108 
109 #endif // ifndef __tsid_python_task_actuation_bounds_hpp__
static void setmask(Task &self, const Eigen::VectorXd mask)
static const Eigen::VectorXd & getLowerBounds(const Task &self)
void def(const char *name, Func func)
data
Definition: setup.in.py:48
static const Eigen::VectorXd & getUpperBounds(const Task &self)
Transform3f t
static void setBounds(Task &self, const Eigen::VectorXd lower, const Eigen::VectorXd upper)
static math::ConstraintInequality compute(Task &self, const double t, const Eigen::VectorXd &q, const Eigen::VectorXd &v, pinocchio::Data &data)
static math::ConstraintInequality getConstraint(const Task &self)


tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Sun Jul 2 2023 02:21:51