4 import pinocchio
as pin
7 @unittest.skipUnless(pin.WITH_HPP_FCL,
"Needs HPP-FCL")
10 self.
model = pin.buildSampleModelHumanoid()
15 self.assertTrue(col.name ==
"rleg_shoulder_object")
16 col.name =
"new_collision_name"
17 self.assertTrue(col.name ==
"new_collision_name")
21 self.assertTrue(col.parentJoint == 2)
23 self.assertTrue(col.parentJoint == 3)
26 m = pin.SE3.Identity()
27 new_m = pin.SE3.Random()
29 self.assertTrue(np.allclose(col.placement.homogeneous, m.homogeneous))
31 self.assertTrue(np.allclose(col.placement.homogeneous, new_m.homogeneous))
35 self.assertTrue(col.meshPath
is not None)
47 self.assertTrue(self.
model.check(data_2))
48 self.assertEqual(len(collision_data_2.oMg), self.
collision_model.ngeoms)
52 self.assertEqual(self.
collision_model.ngeoms, collision_model_copy.ngeoms)
55 collision_data_copy = collision_data.copy()
56 self.assertEqual(len(collision_data.oMg), len(collision_data_copy.oMg))
60 self.assertTrue(isinstance(col.meshMaterial, (pin.GeometryNoMaterial)))
61 col.meshMaterial = pin.GeometryPhongMaterial()
62 self.assertTrue(isinstance(col.meshMaterial, (pin.GeometryPhongMaterial)))
63 material = col.meshMaterial
64 self.assertTrue(isinstance(material, (pin.GeometryPhongMaterial)))
65 material.meshEmissionColor = np.array([1.0, 1.0, 1.0, 1.0])
66 material.meshShininess = 0.7
68 (material.meshEmissionColor == col.meshMaterial.meshEmissionColor).all()
70 self.assertEqual(material.meshShininess, col.meshMaterial.meshShininess)
73 if __name__ ==
"__main__":