2 import pinocchio
as pin
6 model = pin.buildSampleModelHumanoidRandom()
7 data = model.createData()
11 model.lowerPositionLimit = -np.ones((model.nq, 1))
12 model.upperPositionLimit = np.ones((model.nq, 1))
14 q = pin.randomConfiguration(model)
15 v = np.random.rand(model.nv, 1)
16 a = np.random.rand(model.nv, 1)
20 pin.computeForwardKinematicsDerivatives(model, data, q, v, a)
24 joint_name =
"rleg6_joint"
25 joint_id = model.getJointId(joint_name)
30 (dv_dq, dv_dv) = pin.getJointVelocityDerivatives(
31 model, data, joint_id, pin.ReferenceFrame.WORLD
34 (dv_dq_local, dv_dv_local) = pin.getJointVelocityDerivatives(
35 model, data, joint_id, pin.ReferenceFrame.LOCAL
41 (dv_dq, da_dq, da_dv, da_da) = pin.getJointAccelerationDerivatives(
42 model, data, joint_id, pin.ReferenceFrame.WORLD
45 (dv_dq_local, da_dq_local, da_dv_local, da_da_local) = (
46 pin.getJointAccelerationDerivatives(model, data, joint_id, pin.ReferenceFrame.LOCAL)