Verified Commit 34e63e97 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

python: expose operator{==,!=} for joints

parent 1d2d3130
//
// Copyright (c) 2015-2020 CNRS INRIA
// Copyright (c) 2015-2021 CNRS INRIA
//
#ifndef __pinocchio_python_joint_variants_hpp__
......@@ -34,6 +34,9 @@ namespace pinocchio
.add_property("nv",&get_nv)
.def("setIndexes",&JointModelDerived::setIndexes)
.def("shortname",&JointModelDerived::shortname)
.def(bp::self == bp::self)
.def(bp::self != bp::self)
;
}
......@@ -72,6 +75,9 @@ namespace pinocchio
.add_property("Dinv",&get_Dinv)
.add_property("UDinv",&get_UDinv)
.def("shortname",&JointDataDerived::shortname)
.def(bp::self == bp::self)
.def(bp::self != bp::self)
;
}
......
......@@ -33,6 +33,9 @@ namespace pinocchio
.add_property("nv",&getNv)
.def("setIndexes",&JointModel::setIndexes)
.def("shortname",&JointModel::shortname)
.def(bp::self == bp::self)
.def(bp::self != bp::self)
;
}
......
......@@ -114,35 +114,39 @@ namespace pinocchio
}
template<>
inline bp::class_<JointModelComposite>& expose_joint_model<JointModelComposite> (bp::class_<JointModelComposite> & cl)
bp::class_<JointModelComposite> & expose_joint_model<JointModelComposite>(bp::class_<JointModelComposite> & cl)
{
return cl
.def(bp::init<const size_t> (bp::args("self","size"),
"Init JointModelComposite with a defined size"))
.def("__init__",
bp::make_constructor(init_proxy1,
bp::default_call_policies(),
bp::args("joint_model")
),
"Init JointModelComposite from a joint"
)
.def("__init__",
bp::make_constructor(init_proxy2,
bp::default_call_policies(),
bp::args("joint_model","joint_placement")
),
"Init JointModelComposite from a joint and a placement"
)
.add_property("joints",&JointModelComposite::joints)
.add_property("jointPlacements",&JointModelComposite::jointPlacements)
.add_property("njoints",&JointModelComposite::njoints)
.def("addJoint",
&addJoint_proxy,
addJoint_proxy_overloads(bp::args("self","joint_model","joint_placement"),
"Add a joint to the vector of joints."
)[bp::return_internal_reference<>()]
)
;
.def(bp::init<const size_t> (bp::args("self","size"),
"Init JointModelComposite with a defined size"))
.def("__init__",
bp::make_constructor(init_proxy1,
bp::default_call_policies(),
bp::args("joint_model")
),
"Init JointModelComposite from a joint"
)
.def("__init__",
bp::make_constructor(init_proxy2,
bp::default_call_policies(),
bp::args("joint_model","joint_placement")
),
"Init JointModelComposite from a joint and a placement"
)
.add_property("joints",&JointModelComposite::joints)
.add_property("jointPlacements",&JointModelComposite::jointPlacements)
.add_property("njoints",&JointModelComposite::njoints)
.def("addJoint",
&addJoint_proxy,
addJoint_proxy_overloads(bp::args("self","joint_model","joint_placement"),
"Add a joint to the vector of joints."
)[bp::return_internal_reference<>()]
)
.def(bp::self == bp::self)
.def(bp::self != bp::self)
;
}
} // namespace python
} // namespace pinocchio
......
Markdown is supported
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