Verified Commit fe6db097 authored by Gabriele Buondonno's avatar Gabriele Buondonno Committed by Justin Carpentier
Browse files

[bindings] Add bindings for getFrameClassicalAcceleration

parent 48f66548
......@@ -70,6 +70,7 @@ namespace pinocchio
BOOST_PYTHON_FUNCTION_OVERLOADS(getFrameVelocity_overload, (&getFrameVelocity<double,0,JointCollectionDefaultTpl>), 3, 4)
BOOST_PYTHON_FUNCTION_OVERLOADS(getFrameAcceleration_overload, (&getFrameAcceleration<double,0,JointCollectionDefaultTpl>), 3, 4)
BOOST_PYTHON_FUNCTION_OVERLOADS(getFrameClassicalAcceleration_overload, (&getFrameClassicalAcceleration<double,0,JointCollectionDefaultTpl>), 3, 4)
void exposeFramesAlgo()
{
......@@ -100,7 +101,14 @@ namespace pinocchio
bp::args("model","data","frame_id","reference_frame"),
"Returns the spatial acceleration of the frame expressed in the coordinate system given by reference_frame.\n"
"forwardKinematics(model,data,q,v,a) should be called first to compute the joint spatial acceleration stored in data.a ."));
bp::def("getFrameClassicalAcceleration",
&getFrameClassicalAcceleration<double,0,JointCollectionDefaultTpl>,
getFrameClassicalAcceleration_overload(
bp::args("model","data","frame_id","reference_frame"),
"Returns the \"classical\" acceleration of the frame expressed in the coordinate system given by reference_frame.\n"
"forwardKinematics(model,data,q,v,a) should be called first to compute the joint spatial acceleration stored in data.a ."));
bp::def("framesForwardKinematics",
&framesForwardKinematics<double,0,JointCollectionDefaultTpl,VectorXd>,
bp::args("model","data","q"),
......
......@@ -72,5 +72,10 @@ class TestFrameBindings(PinocchioTestCase):
a = pin.getFrameAcceleration(self.model, data, self.frame_idx, pin.ReferenceFrame.LOCAL_WORLD_ALIGNED)
self.assertApprox(a, pin.SE3(T.rotation, np.zeros(3)).act(self.frame_placement.actInv(data.a[self.parent_idx])))
a = pin.getFrameClassicalAcceleration(self.model, data, self.frame_idx)
a = pin.getFrameClassicalAcceleration(self.model, data, self.frame_idx, pin.ReferenceFrame.LOCAL)
a = pin.getFrameClassicalAcceleration(self.model, data, self.frame_idx, pin.ReferenceFrame.WORLD)
a = pin.getFrameClassicalAcceleration(self.model, data, self.frame_idx, pin.ReferenceFrame.LOCAL_WORLD_ALIGNED)
if __name__ == '__main__':
unittest.main()
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