18 #ifndef __tsid_python_task_com_hpp__
19 #define __tsid_python_task_com_hpp__
32 template <
typename TaskCOM>
34 :
public boost::python::def_visitor<
35 TaskCOMEqualityPythonVisitor<TaskCOM> > {
36 template <
class PyClass>
39 cl.def(bp::init<std::string, robots::RobotWrapper&>(
40 (bp::arg(
"name"), bp::arg(
"robot")),
"Default Constructor"))
41 .add_property(
"dim", &TaskCOM::dim,
"return dimension size")
44 .add_property(
"getDesiredAcceleration",
47 bp::return_value_policy<bp::copy_const_reference>()),
51 .add_property(
"position_error",
54 bp::return_value_policy<bp::copy_const_reference>()))
55 .add_property(
"velocity_error",
58 bp::return_value_policy<bp::copy_const_reference>()))
59 .add_property(
"position",
62 bp::return_value_policy<bp::copy_const_reference>()))
63 .add_property(
"velocity",
66 bp::return_value_policy<bp::copy_const_reference>()))
67 .add_property(
"position_ref",
70 bp::return_value_policy<bp::copy_const_reference>()))
71 .add_property(
"velocity_ref",
74 bp::return_value_policy<bp::copy_const_reference>()))
78 bp::return_value_policy<bp::copy_const_reference>()))
82 bp::return_value_policy<bp::copy_const_reference>()))
86 bp::args(
"t",
"q",
"v",
"data"))
92 bp::return_value_policy<bp::copy_const_reference>()),
97 static std::string
name(TaskCOM&
self) {
98 std::string
name =
self.name();
102 const Eigen::VectorXd&
q,
103 const Eigen::VectorXd&
v,
119 self.setReference(
ref);
122 return self.getDesiredAcceleration();
125 const Eigen::VectorXd dv) {
126 return self.getAcceleration(
dv);
129 return self.position_error();
132 return self.velocity_error();
134 static const Eigen::VectorXd&
position(
const TaskCOM&
self) {
135 return self.position();
137 static const Eigen::VectorXd&
velocity(
const TaskCOM&
self) {
138 return self.velocity();
141 return self.position_ref();
144 return self.velocity_ref();
146 static const Eigen::Vector3d&
Kp(TaskCOM&
self) {
return self.Kp(); }
147 static const Eigen::Vector3d&
Kd(TaskCOM&
self) {
return self.Kd(); }
148 static void setKp(TaskCOM&
self, const ::Eigen::VectorXd
Kp) {
151 static void setKd(TaskCOM&
self, const ::Eigen::VectorXd Kv) {
154 static const Eigen::VectorXd&
getmask(
const TaskCOM&
self) {
155 return self.getMask();
157 static void setmask(TaskCOM&
self,
const Eigen::VectorXd mask) {
158 return self.setMask(mask);
160 static void expose(
const std::string& class_name) {
161 std::string doc =
"TaskCOMEqualityPythonVisitor info.";
162 bp::class_<TaskCOM>(
class_name.c_str(), doc.c_str(), bp::no_init)
165 bp::register_ptr_to_python<boost::shared_ptr<math::ConstraintBase> >();
171 #endif // ifndef __tsid_python_task_com_hpp__