| 22 | assert_allclose(turtle.position, (3, 3, 3)) |
| 23 | |
| 24 | def test_initial_rotation(self): |
| 25 | turtle = Turtle() |
| 26 | assert_allclose(turtle.rotation.as_matrix(), np.eye(3)) |
| 27 | |
| 28 | # A rotation 180 degrees about the global x axis should flip both the y and z axes. |
| 29 | rotation = Rotation.from_euler("x", [np.pi]) |
| 30 | expected = [[1, 0, 0], [0, -1, 0], [0, 0, -1]] |
| 31 | turtle = Turtle(rotation=rotation) |
| 32 | # There's a little bit of numerical instability in the works. |
| 33 | assert_allclose(turtle.rotation.as_matrix(), [expected], atol=1e-15) |
| 34 | |
| 35 | def test_forward(self): |
| 36 | turtle = Turtle() |