18 #ifndef __tsid_python_HQPOutput_hpp__ 19 #define __tsid_python_HQPOutput_hpp__ 23 #include <pinocchio/bindings/python/utils/deprecation.hpp> 44 :
public boost::python::def_visitor<InvDynPythonVisitor<T> > {
45 template <
class PyClass>
48 cl.def(bp::init<std::string, robots::RobotWrapper&, bool>(
49 (bp::args(
"name",
"robot",
"verbose"))))
51 .add_property(
"nVar", &T::nVar)
52 .add_property(
"nEq", &T::nEq)
53 .add_property(
"nIn", &T::nIn)
56 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
58 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
60 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
62 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
65 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
67 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
69 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
71 bp::args(
"task",
"weight",
"priorityLevel",
"transition duration"))
73 bp::args(
"task_name",
"weight"))
74 .def(
"updateRigidContactWeights",
76 bp::args(
"contact_name",
"force_regularization_weight"))
77 .def(
"updateRigidContactWeights",
79 bp::args(
"contact_name",
"force_regularization_weight",
81 .def(
"addRigidContact",
85 "Method addRigidContact(ContactBase) is deprecated. You " 86 "should use addRigidContact(ContactBase, double) instead"))
88 bp::args(
"contact",
"force_reg_weight"))
89 .def(
"addRigidContact",
91 bp::args(
"contact",
"force_reg_weight",
"motion_weight",
94 bp::args(
"contact",
"force_reg_weight"))
95 .def(
"addRigidContact",
97 bp::args(
"contact",
"force_reg_weight",
"motion_weight",
100 bp::args(
"task_name",
"duration"))
102 bp::args(
"contact_name",
"duration"))
104 bp::args(
"constraint_name"))
106 bp::args(
"time",
"q",
"v"))
109 bp::args(
"HQPOutput"))
111 bp::args(
"HQPOutput"))
113 bp::args(
"HQPOutput"))
115 bp::args(
"name",
"HQPOutput"))
117 bp::args(
"name",
"HQPOutput"));
124 double weight,
unsigned int priorityLevel,
125 double transition_duration) {
126 return self.addMotionTask(task, weight, priorityLevel, transition_duration);
129 double weight,
unsigned int priorityLevel,
130 double transition_duration) {
131 return self.addMotionTask(task, weight, priorityLevel, transition_duration);
134 double weight,
unsigned int priorityLevel,
135 double transition_duration) {
136 return self.addMotionTask(task, weight, priorityLevel, transition_duration);
140 unsigned int priorityLevel,
141 double transition_duration) {
142 return self.addMotionTask(task, weight, priorityLevel, transition_duration);
146 unsigned int priorityLevel,
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);
155 double weight,
unsigned int priorityLevel,
156 double transition_duration) {
157 return self.addForceTask(task, weight, priorityLevel, transition_duration);
160 double weight,
unsigned int priorityLevel,
161 double transition_duration) {
162 return self.addActuationTask(task, weight, priorityLevel,
163 transition_duration);
167 return self.updateTaskWeight(task_name, weight);
170 const std::string& contact_name,
171 double force_regularization_weight) {
172 return self.updateRigidContactWeights(contact_name,
173 force_regularization_weight);
176 T&
self,
const std::string& contact_name,
177 double force_regularization_weight,
double motion_weight) {
178 return self.updateRigidContactWeights(
179 contact_name, force_regularization_weight, motion_weight);
183 return self.addRigidContact(contact, 1e-5);
186 double force_regularization_weight) {
187 return self.addRigidContact(contact, force_regularization_weight);
191 double motion_weight,
const bool priority_level) {
192 return self.addRigidContact(contact, force_regularization_weight,
193 motion_weight, priority_level);
196 double force_regularization_weight) {
197 return self.addRigidContact(contact, force_regularization_weight);
201 double force_regularization_weight,
double motion_weight,
202 const bool priority_level) {
203 return self.addRigidContact(contact, force_regularization_weight,
204 motion_weight, priority_level);
206 static bool removeTask(T&
self,
const std::string& task_name,
207 double transition_duration) {
208 return self.removeTask(task_name, transition_duration);
211 double transition_duration) {
212 return self.removeRigidContact(contactName, transition_duration);
215 return self.removeFromHqpData(constraintName);
218 const Eigen::VectorXd&
q,
219 const Eigen::VectorXd&
v) {
226 return self.getActuatorForces(sol);
230 return self.getAccelerations(sol);
234 return self.getContactForces(sol);
239 if (f.size() > 0)
return true;
244 return self.getContactForces(name, sol);
247 static void expose(
const std::string& class_name) {
248 std::string doc =
"InvDyn info.";
249 bp::class_<T>(class_name.c_str(), doc.c_str(), bp::no_init)
256 #endif // ifndef __tsid_python_HQPOutput_hpp__
static bool addMotionTask_AM(T &self, tasks::TaskAMEquality &task, double weight, unsigned int priorityLevel, double transition_duration)
static HQPDatas computeProblemData(T &self, double time, const Eigen::VectorXd &q, const Eigen::VectorXd &v)
static bool addActuationTask_Bounds(T &self, tasks::TaskActuationBounds &task, double weight, unsigned int priorityLevel, double transition_duration)
static bool removeRigidContact(T &self, const std::string &contactName, double transition_duration)
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
static bool addRigidContactPointWithPriorityLevel(T &self, contacts::ContactPoint &contact, double force_regularization_weight, double motion_weight, const bool priority_level)
static bool addMotionTask_SE3(T &self, tasks::TaskSE3Equality &task, double weight, unsigned int priorityLevel, double transition_duration)
static bool updateTaskWeight(T &self, const std::string &task_name, double weight)
static bool removeTask(T &self, const std::string &task_name, double transition_duration)
void def(const char *name, Func func)
static Eigen::VectorXd getAccelerations(T &self, const solvers::HQPOutput &sol)
static bool updateRigidContactWeights(T &self, const std::string &contact_name, double force_regularization_weight)
static pinocchio::Data data(T &self)
static bool addMotionTask_Joint(T &self, tasks::TaskJointPosture &task, double weight, unsigned int priorityLevel, double transition_duration)
static void expose(const std::string &class_name)
static bool addForceTask_COP(T &self, tasks::TaskCopEquality &task, double weight, unsigned int priorityLevel, double transition_duration)
static bool removeFromHqpData(T &self, const std::string &constraintName)
bool set(const HQPData &data)
static bool addMotionTask_JointBounds(T &self, tasks::TaskJointBounds &task, double weight, unsigned int priorityLevel, double transition_duration)
static bool updateRigidContactWeightsWithMotionWeight(T &self, const std::string &contact_name, double force_regularization_weight, double motion_weight)
static bool addRigidContact6dWithPriorityLevel(T &self, contacts::Contact6d &contact, double force_regularization_weight, double motion_weight, const bool priority_level)
static Eigen::VectorXd getContactForce(T &self, const std::string &name, const solvers::HQPOutput &sol)
static bool addMotionTask_COM(T &self, tasks::TaskComEquality &task, double weight, unsigned int priorityLevel, double transition_duration)
static bool addMotionTask_JointPosVelAccBounds(T &self, tasks::TaskJointPosVelAccBounds &task, double weight, unsigned int priorityLevel, double transition_duration)
static bool addRigidContact6d(T &self, contacts::Contact6d &contact, double force_regularization_weight)
void visit(PyClass &cl) const
static Eigen::VectorXd getActuatorForces(T &self, const solvers::HQPOutput &sol)
static Eigen::VectorXd getContactForces(T &self, const solvers::HQPOutput &sol)
static bool addRigidContactPoint(T &self, contacts::ContactPoint &contact, double force_regularization_weight)
static bool addRigidContact6dDeprecated(T &self, contacts::Contact6d &contact)
static bool checkContact(T &self, const std::string &name, const solvers::HQPOutput &sol)