18 #ifndef __tsid_python_HQPOutput_hpp__
19 #define __tsid_python_HQPOutput_hpp__
23 #include <pinocchio/bindings/python/utils/deprecation.hpp>
47 :
public boost::python::def_visitor<InvDynPythonVisitor<T> > {
48 template <
class PyClass>
51 cl.def(bp::init<std::string, robots::RobotWrapper&, bool>(
52 (bp::args(
"name",
"robot",
"verbose"))))
54 .add_property(
"nVar", &T::nVar)
55 .add_property(
"nEq", &T::nEq)
56 .add_property(
"nIn", &T::nIn)
59 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
61 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
63 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
65 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
68 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
70 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
73 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
75 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
77 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
79 bp::args(
"task_name",
"weight"))
80 .def(
"updateRigidContactWeights",
82 bp::args(
"contact_name",
"force_regularization_weight"))
83 .def(
"updateRigidContactWeights",
85 bp::args(
"contact_name",
"force_regularization_weight",
87 .def(
"addRigidContact",
91 "Method addRigidContact(ContactBase) is deprecated. You "
92 "should use addRigidContact(ContactBase, double) instead"))
94 bp::args(
"contact",
"force_reg_weight"))
95 .def(
"addRigidContact",
97 bp::args(
"contact",
"force_reg_weight",
"motion_weight",
100 bp::args(
"contact",
"force_reg_weight"))
101 .def(
"addRigidContact",
103 bp::args(
"contact",
"force_reg_weight",
"motion_weight",
105 .def(
"addRigidContact",
107 bp::args(
"contact",
"force_reg_weight"))
108 .def(
"addRigidContact",
111 bp::args(
"contact",
"force_reg_weight",
"motion_weight",
114 bp::args(
"task_name",
"duration"))
116 bp::args(
"contact_name",
"duration"))
118 bp::args(
"constraint_name"))
120 bp::args(
"time",
"q",
"v"))
123 bp::args(
"HQPOutput"))
125 bp::args(
"HQPOutput"))
127 bp::args(
"HQPOutput"))
129 bp::args(
"name",
"HQPOutput"))
131 bp::args(
"name",
"HQPOutput"))
133 bp::args(
"measured_force"));
140 double weight,
unsigned int priorityLevel,
141 double transition_duration) {
142 return self.addMotionTask(task, weight, priorityLevel, transition_duration);
145 double weight,
unsigned int priorityLevel,
146 double transition_duration) {
147 return self.addMotionTask(task, weight, priorityLevel, transition_duration);
150 double weight,
unsigned int priorityLevel,
151 double transition_duration) {
152 return self.addMotionTask(task, weight, priorityLevel, transition_duration);
156 unsigned int priorityLevel,
157 double transition_duration) {
158 return self.addMotionTask(task, weight, priorityLevel, transition_duration);
162 unsigned int priorityLevel,
double transition_duration) {
163 return self.addMotionTask(task, weight, priorityLevel, transition_duration);
166 double weight,
unsigned int priorityLevel,
167 double transition_duration) {
168 return self.addMotionTask(task, weight, priorityLevel, transition_duration);
172 unsigned int priorityLevel,
double transition_duration) {
173 return self.addMotionTask(task, weight, priorityLevel, transition_duration);
176 double weight,
unsigned int priorityLevel,
177 double transition_duration) {
178 return self.addForceTask(task, weight, priorityLevel, transition_duration);
181 double weight,
unsigned int priorityLevel,
182 double transition_duration) {
183 return self.addActuationTask(task, weight, priorityLevel,
184 transition_duration);
188 return self.updateTaskWeight(task_name, weight);
191 const std::string& contact_name,
192 double force_regularization_weight) {
193 return self.updateRigidContactWeights(contact_name,
194 force_regularization_weight);
197 T&
self,
const std::string& contact_name,
198 double force_regularization_weight,
double motion_weight) {
199 return self.updateRigidContactWeights(
200 contact_name, force_regularization_weight, motion_weight);
204 return self.addRigidContact(
contact, 1e-5);
207 double force_regularization_weight) {
208 return self.addRigidContact(
contact, force_regularization_weight);
212 double motion_weight,
const bool priority_level) {
213 return self.addRigidContact(
contact, force_regularization_weight,
214 motion_weight, priority_level);
217 double force_regularization_weight) {
218 return self.addRigidContact(
contact, force_regularization_weight);
222 double force_regularization_weight,
double motion_weight,
223 const bool priority_level) {
224 return self.addRigidContact(
contact, force_regularization_weight,
225 motion_weight, priority_level);
229 double force_regularization_weight) {
230 return self.addRigidContact(
contact, force_regularization_weight);
234 double force_regularization_weight,
double motion_weight,
235 const bool priority_level) {
236 return self.addRigidContact(
contact, force_regularization_weight,
237 motion_weight, priority_level);
239 static bool removeTask(T&
self,
const std::string& task_name,
240 double transition_duration) {
241 return self.removeTask(task_name, transition_duration);
244 double transition_duration) {
245 return self.removeRigidContact(contactName, transition_duration);
248 return self.removeFromHqpData(constraintName);
251 const Eigen::VectorXd&
q,
252 const Eigen::VectorXd&
v) {
259 return self.getActuatorForces(
sol);
263 return self.getAccelerations(
sol);
267 return self.getContactForces(
sol);
272 if (
f.size() > 0)
return true;
277 return self.getContactForces(
name,
sol);
281 return self.addMeasuredForce(measured_force);
284 static void expose(
const std::string& class_name) {
285 std::string doc =
"InvDyn info.";
286 bp::class_<T>(
class_name.c_str(), doc.c_str(), bp::no_init)
293 #endif // ifndef __tsid_python_HQPOutput_hpp__