2 from test_case
import PinocchioTestCase
as TestCase
4 import pinocchio
as pin
10 self.
model = pin.buildSampleModelHumanoidRandom()
11 self.
data = self.model.createData()
13 qmax = np.full((self.model.nq,1),np.pi)
14 self.
q = pin.randomConfiguration(self.
model,-qmax,qmax)
15 self.
v = np.random.rand((self.model.nv))
16 self.
tau = np.random.rand((self.model.nv))
19 for _
in range(self.model.njoints):
20 self.fext.append(pin.Force.Random())
23 res = pin.computeABADerivatives(self.
model,self.
data,self.
q,self.
v,self.
tau)
25 self.assertTrue(len(res) == 3)
27 data2 = self.model.createData()
28 pin.aba(self.
model,data2,self.
q,self.
v,self.
tau)
30 self.assertApprox(self.data.ddq,data2.ddq)
35 self.assertTrue(len(res) == 3)
39 self.assertApprox(self.data.ddq,data2.ddq)
41 if __name__ ==
'__main__':
def test_aba_derivatives(self)