bindings_kinematic_regressor.py
Go to the documentation of this file.
1 import unittest
2 
3 import pinocchio as pin
4 from test_case import PinocchioTestCase as TestCase
5 
6 
8  def test_all(self):
9  model = pin.buildSampleModelHumanoidRandom()
10 
11  joint_name = "larm6_joint"
12  joint_id = model.getJointId(joint_name)
13  frame_id = model.addBodyFrame("test_body", joint_id, pin.SE3.Identity(), -1)
14 
15  data = model.createData()
16 
17  model.lowerPositionLimit[:7] = -1.0
18  model.upperPositionLimit[:7] = 1.0
19 
20  q = pin.randomConfiguration(model)
21  pin.forwardKinematics(model, data, q)
22 
23  R1 = pin.computeJointKinematicRegressor(
24  model, data, joint_id, pin.ReferenceFrame.LOCAL, pin.SE3.Identity()
25  )
26  R2 = pin.computeJointKinematicRegressor(
27  model, data, joint_id, pin.ReferenceFrame.LOCAL
28  )
29 
30  self.assertApprox(R1, R2)
31 
32  R3 = pin.computeFrameKinematicRegressor(
33  model, data, frame_id, pin.ReferenceFrame.LOCAL
34  )
35  self.assertApprox(R1, R3)
36 
37 
38 if __name__ == "__main__":
39  unittest.main()
bindings_kinematic_regressor.TestKinematicRegressorBindings
Definition: bindings_kinematic_regressor.py:7
bindings_kinematic_regressor.TestKinematicRegressorBindings.test_all
def test_all(self)
Definition: bindings_kinematic_regressor.py:8


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:06