Initialize the turtle with the given position and rotation. Use a traditional RHS coordinate system with Z pointing up. Transformations are performed using intrinsic Euler angles, so rotations about an axis are relative to the turtle's local reference frame. :param
(self, position: np.ndarray = None, rotation: Rotation = None)
| 13 | """ |
| 14 | |
| 15 | def __init__(self, position: np.ndarray = None, rotation: Rotation = None): |
| 16 | """Initialize the turtle with the given position and rotation. |
| 17 | |
| 18 | Use a traditional RHS coordinate system with Z pointing up. |
| 19 | Transformations are performed using intrinsic Euler angles, so rotations about an axis are |
| 20 | relative to the turtle's local reference frame. |
| 21 | |
| 22 | :param position: The starting position of the turtle. Defaults to (0, 0, 0). |
| 23 | :param rotation: The starting rotation of the turtle, applied to the vector (0, 0, 1). |
| 24 | """ |
| 25 | if rotation is not None and not isinstance(rotation, Rotation): |
| 26 | raise TypeError("Rotation must be a scipy.spatial.transform.Rotation") |
| 27 | |
| 28 | self._position = np.array(position) if position is not None else np.array([[0, 0, 0]]) |
| 29 | self.rotation = rotation if rotation is not None else Rotation.from_matrix(np.eye(3)) |
| 30 | |
| 31 | @property |
| 32 | def position(self): |
nothing calls this directly
no outgoing calls
no test coverage detected