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


pinocchio
Author(s):
autogenerated on Sun Jun 16 2024 02:43:06