2 from test_case
import PinocchioTestCase
as TestCase
3 import pinocchio
as pin
8 model = pin.buildSampleModelHumanoidRandom()
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)
14 data = model.createData()
16 model.lowerPositionLimit[:7] = -1.
17 model.upperPositionLimit[:7] = 1.
19 q = pin.randomConfiguration(model)
20 pin.forwardKinematics(model,data,q)
22 R1 = pin.computeJointKinematicRegressor(model,data,joint_id,pin.ReferenceFrame.LOCAL,pin.SE3.Identity())
23 R2 = pin.computeJointKinematicRegressor(model,data,joint_id,pin.ReferenceFrame.LOCAL)
25 self.assertApprox(R1,R2)
27 R3 = pin.computeFrameKinematicRegressor(model,data,frame_id,pin.ReferenceFrame.LOCAL)
28 self.assertApprox(R1,R3)
30 if __name__ ==
'__main__':