18 #ifndef __tsid_python_task_joint_posVelAcc_bounds_hpp__
19 #define __tsid_python_task_joint_posVelAcc_bounds_hpp__
30 namespace bp = boost::python;
33 template <
typename Task>
35 :
public boost::python::def_visitor<
36 TaskJointPosVelAccBoundsPythonVisitor<Task>> {
37 template <
class PyClass>
42 (bp::arg(
"name"), bp::arg(
"robot"), bp::arg(
"Time step"),
44 "Default Constructor"))
45 .add_property(
"dim", &Task::dim,
"return dimension size")
48 .def(
"setPositionBounds",
50 bp::args(
"lower",
"upper"))
51 .def(
"setVelocityBounds",
54 .def(
"setAccelerationBounds",
58 bp::args(
"t",
"q",
"v",
"data"))
63 .def(
"setImposeBounds",
65 bp::args(
"impose_position_bounds",
"impose_velocity_bounds",
66 "impose_viability_bounds",
"impose_acceleration_bounds"))
69 (bp::arg(
"q"), bp::arg(
"dq"), bp::arg(
"verbose") =
true))
70 .def(
"computeAccLimitsFromPosLimits",
73 (bp::arg(
"q"), bp::arg(
"dq"), bp::arg(
"verbose") =
true))
74 .def(
"computeAccLimitsFromViability",
77 (bp::arg(
"q"), bp::arg(
"dq"), bp::arg(
"verbose") =
true))
78 .def(
"computeAccLimits",
80 (bp::arg(
"q"), bp::arg(
"dq"), bp::arg(
"verbose") =
true))
84 "getAccelerationBounds",
87 bp::return_value_policy<bp::copy_const_reference>()))
92 bp::return_value_policy<bp::copy_const_reference>()))
94 "getPositionLowerBounds",
97 bp::return_value_policy<bp::copy_const_reference>()))
99 "getPositionUpperBounds",
102 bp::return_value_policy<bp::copy_const_reference>()))
105 static std::string
name(Task&
self) {
106 std::string
name =
self.name();
110 const Eigen::VectorXd& q,
111 const Eigen::VectorXd& v,
113 self.compute(t, q, v, data);
126 return self.getAccelerationBounds();
129 return self.getVelocityBounds();
132 return self.getPositionLowerBounds();
135 return self.getPositionUpperBounds();
138 return self.setTimeStep(dt);
141 const Eigen::VectorXd upper) {
142 return self.setPositionBounds(lower, upper);
145 return self.setVelocityBounds(upper);
148 return self.setAccelerationBounds(upper);
150 static void expose(
const std::string& class_name) {
151 std::string doc =
"Task info.";
152 bp::class_<Task>(class_name.c_str(), doc.c_str(), bp::no_init)
156 return self.setVerbose(verbose);
159 bool impose_velocity_bounds,
160 bool impose_viability_bounds,
161 bool impose_acceleration_bounds) {
162 return self.setImposeBounds(impose_position_bounds, impose_velocity_bounds,
163 impose_viability_bounds,
164 impose_acceleration_bounds);
168 bool verbose =
true) {
169 return self.isStateViable(q, dq, verbose);
173 bool verbose =
true) {
174 return self.computeAccLimitsFromPosLimits(q, dq, verbose);
178 bool verbose =
true) {
179 return self.computeAccLimitsFromViability(q, dq, verbose);
182 bool verbose =
true) {
183 return self.computeAccLimits(q, dq, verbose);
186 return self.setMask(mask);
Definition: constraint-bound.hpp:26
Wrapper for a robot based on pinocchio.
Definition: robot-wrapper.hpp:37
const Eigen::Ref< const Vector > ConstRefVector
Definition: fwd.hpp:48
math::ConstRefVector ConstRefVector
Definition: task-joint-posVelAcc-bounds.hpp:31
Definition: constraint-bound.hpp:25
Definition: task-joint-posVelAcc-bounds.hpp:36
static math::ConstraintBound compute(Task &self, const double t, const Eigen::VectorXd &q, const Eigen::VectorXd &v, pinocchio::Data &data)
Definition: task-joint-posVelAcc-bounds.hpp:109
static void computeAccLimitsFromViability(Task &self, ConstRefVector q, ConstRefVector dq, bool verbose=true)
Definition: task-joint-posVelAcc-bounds.hpp:176
static const Eigen::VectorXd & getPositionUpperBounds(const Task &self)
Definition: task-joint-posVelAcc-bounds.hpp:134
static math::ConstraintBound getConstraint(const Task &self)
Definition: task-joint-posVelAcc-bounds.hpp:119
static void setImposeBounds(Task &self, bool impose_position_bounds, bool impose_velocity_bounds, bool impose_viability_bounds, bool impose_acceleration_bounds)
Definition: task-joint-posVelAcc-bounds.hpp:158
static const Eigen::VectorXd & getPositionLowerBounds(const Task &self)
Definition: task-joint-posVelAcc-bounds.hpp:131
static void expose(const std::string &class_name)
Definition: task-joint-posVelAcc-bounds.hpp:150
static void setVerbose(Task &self, bool verbose)
Definition: task-joint-posVelAcc-bounds.hpp:155
static void isStateViable(Task &self, ConstRefVector q, ConstRefVector dq, bool verbose=true)
Definition: task-joint-posVelAcc-bounds.hpp:167
static std::string name(Task &self)
Definition: task-joint-posVelAcc-bounds.hpp:105
static void computeAccLimitsFromPosLimits(Task &self, ConstRefVector q, ConstRefVector dq, bool verbose=true)
Definition: task-joint-posVelAcc-bounds.hpp:171
static void setAccelerationBounds(Task &self, const Eigen::VectorXd upper)
Definition: task-joint-posVelAcc-bounds.hpp:147
static const Eigen::VectorXd & getAccelerationBounds(const Task &self)
Definition: task-joint-posVelAcc-bounds.hpp:125
static void setVelocityBounds(Task &self, const Eigen::VectorXd upper)
Definition: task-joint-posVelAcc-bounds.hpp:144
static void setMask(Task &self, math::ConstRefVector mask)
Definition: task-joint-posVelAcc-bounds.hpp:185
static void setPositionBounds(Task &self, const Eigen::VectorXd lower, const Eigen::VectorXd upper)
Definition: task-joint-posVelAcc-bounds.hpp:140
static const Eigen::VectorXd & getVelocityBounds(const Task &self)
Definition: task-joint-posVelAcc-bounds.hpp:128
void visit(PyClass &cl) const
Definition: task-joint-posVelAcc-bounds.hpp:39
static void setTimeStep(Task &self, const double dt)
Definition: task-joint-posVelAcc-bounds.hpp:137
static void computeAccLimits(Task &self, ConstRefVector q, ConstRefVector dq, bool verbose=true)
Definition: task-joint-posVelAcc-bounds.hpp:181