2 import pinocchio
as pin
5 from test_case
import PinocchioTestCase
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)
14 data = self.model.createData()
15 q = pin.randomConfiguration(self.
model)
16 v = np.random.rand(self.model.nv)
17 a = np.random.rand(self.model.nv)
18 pin.forwardKinematics(self.
model, data, q, v, a)
24 v = pin.getVelocity(self.
model, data, self.
joint_idx, pin.ReferenceFrame.LOCAL)
26 v = pin.getVelocity(self.
model, data, self.
joint_idx, pin.ReferenceFrame.WORLD)
28 v = pin.getVelocity(self.
model, data, self.
joint_idx, pin.ReferenceFrame.LOCAL_WORLD_ALIGNED)
33 a = pin.getAcceleration(self.
model, data, self.
joint_idx, pin.ReferenceFrame.LOCAL)
35 a = pin.getAcceleration(self.
model, data, self.
joint_idx, pin.ReferenceFrame.WORLD)
37 a = pin.getAcceleration(self.
model, data, self.
joint_idx, pin.ReferenceFrame.LOCAL_WORLD_ALIGNED)
41 a = pin.getClassicalAcceleration(self.
model, data, self.
joint_idx, pin.ReferenceFrame.LOCAL)
42 a = pin.getClassicalAcceleration(self.
model, data, self.
joint_idx, pin.ReferenceFrame.WORLD)
43 a = pin.getClassicalAcceleration(self.
model, data, self.
joint_idx, pin.ReferenceFrame.LOCAL_WORLD_ALIGNED)
45 if __name__ ==
'__main__':
def assertApprox(self, a, b, eps=1e-6)
static void act(const Eigen::MatrixBase< Mat > &iV, const ForceDense< ForceDerived > &f, Eigen::MatrixBase< MatRet > const &jF)
Action of a motion set on a force object. The input motion set is represented by a 6xN matrix whose e...