|
18 | 18 |
|
19 | 19 | from gz_test_deps.common import set_verbosity
|
20 | 20 | from gz_test_deps.sim import K_NULL_ENTITY, TestFixture, Link, Model, World, world_entity
|
21 |
| -from gz_test_deps.math import Inertiald, Matrix3d, Vector3d, Pose3d |
| 21 | +from gz_test_deps.math import AxisAlignedBox, Inertiald, Matrix3d, Vector3d, Pose3d |
22 | 22 |
|
23 | 23 | class TestModel(unittest.TestCase):
|
24 | 24 | post_iterations = 0
|
@@ -88,6 +88,18 @@ def on_pre_udpate_cb(_info, _ecm):
|
88 | 88 | self.assertEqual(0, link.world_kinetic_energy(_ecm))
|
89 | 89 | link.enable_velocity_checks(_ecm, False)
|
90 | 90 | link.enable_acceleration_checks(_ecm, False)
|
| 91 | + # Axis Aligned Box Test |
| 92 | + # Offset of 0.5 meters along z-axis |
| 93 | + self.assertEqual( |
| 94 | + AxisAlignedBox(Vector3d(-0.5, -0.5, 0), Vector3d(0.5, 0.5, 1)), |
| 95 | + link.axis_aligned_box(_ecm) |
| 96 | + ) |
| 97 | + # World Axis Aligned Box Test |
| 98 | + # Same as above since the link is at the origin |
| 99 | + self.assertEqual( |
| 100 | + AxisAlignedBox(Vector3d(-0.5, -0.5, 0), Vector3d(0.5, 0.5, 1)), |
| 101 | + link.world_axis_aligned_box(_ecm) |
| 102 | + ) |
91 | 103 |
|
92 | 104 |
|
93 | 105 | def on_udpate_cb(_info, _ecm):
|
|
0 commit comments