Commit c130eaf2 authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

[Python] cosmetic changes in contact patch API

parent 83e1748e
......@@ -29,11 +29,11 @@ struct ContactPatchPythonVisitor : public boost::python::def_visitor<ContactPatc
.def(bp::init<ContactPatch>(bp::arg("other"), "Copy contructor."))
// getter require to use "make_function" to pass the return_internal_reference policy (return ref to custom object)
bp::make_function((SE3 & (ContactPatch::*)(void)) &ContactPatch::placement,bp::return_internal_reference<>()),
"Placement of the patch represented as a pinocchio SE3 object.")
bp::make_function((Scalar & (ContactPatch::*)(void)) &ContactPatch::friction,bp::return_value_policy<bp::return_by_value>()),
"Friction coefficient between the robot and the environment for this contact.")
.def(bp::self == bp::self)
......@@ -50,8 +50,10 @@ struct ContactPatchPythonVisitor : public boost::python::def_visitor<ContactPatc
// define setter
// define setter and getter
static SE3& getPlacement(ContactPatch& self){return self.placement();}
static void setPlacement(ContactPatch& self, const SE3& placement) { self.placement() = placement; }
static Scalar& getFriction(ContactPatch& self){return self.friction();}
static void setFriction(ContactPatch& self, const Scalar& friction) { self.friction() = friction; }
static ContactPatch copy(const ContactPatch& self) { return ContactPatch(self); }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment