bindings_kinematics_derivatives.py
Go to the documentation of this file.
1 import unittest
2 import pinocchio as pin
3 import numpy as np
4 
5 from test_case import PinocchioTestCase
6 
8 
9  def setUp(self):
10  self.model = pin.buildSampleModelHumanoidRandom()
11  self.joint_idx = self.model.getJointId("rarm2_joint") if self.model.existJointName("rarm2_joint") else (self.model.njoints-1)
12 
13  self.data = self.model.createData()
14  self.q = pin.randomConfiguration(self.model)
15  self.v = np.random.rand((self.model.nv))
16  self.a = np.random.rand((self.model.nv))
17 
18  def tearDown(self):
19  del self.model
20 
21  def test_derivatives(self):
22  model = self.model
23  data = self.data
24 
25  q = self.q
26  v = self.v
27  a = self.a
28 
29  pin.computeForwardKinematicsDerivatives(model,data,q,v,a)
30 
31  pin.getJointVelocityDerivatives(model,data,self.joint_idx,pin.WORLD)
32  pin.getJointVelocityDerivatives(model,data,self.joint_idx,pin.LOCAL)
33  pin.getJointVelocityDerivatives(model,data,self.joint_idx,pin.LOCAL_WORLD_ALIGNED)
34 
35  pin.getJointAccelerationDerivatives(model,data,self.joint_idx,pin.WORLD)
36  pin.getJointAccelerationDerivatives(model,data,self.joint_idx,pin.LOCAL)
37  pin.getJointAccelerationDerivatives(model,data,self.joint_idx,pin.LOCAL_WORLD_ALIGNED)
38 
39 if __name__ == '__main__':
40  unittest.main()
JointDataTpl< Scalar, Options, JointCollectionTpl > createData(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through CreateData visitor to create a JointDataTpl.


pinocchio
Author(s):
autogenerated on Fri Jun 23 2023 02:38:28