2 import pinocchio
as pin
5 from pycppad
import AD, ADFun, Independent
7 pinmodel = pin.buildSampleModelHumanoidRandom()
8 model = ADpin.Model(pinmodel)
9 data = model.createData()
14 q = ADpin.neutral(model)
15 v = np.array([AD(1.0)] * nv)
16 a = np.zeros(nv, dtype=AD)
21 y = ADpin.rnea(model, data, q, v, a)
28 ADdtau_dv = f.Jacobian(dv).reshape(nv, nv)
29 (dtau_dq, dtau_dv, dtau_da) = pin.computeRNEADerivatives(
30 pinmodel, pinmodel.createData(), pin.neutral(pinmodel), np.ones(nv), np.zeros(nv)
32 isapprox(ADdtau_dv, dtau_dv, 1e-12)