diff --git a/src/alitra/models/orientation.py b/src/alitra/models/orientation.py index d449385..4c335da 100644 --- a/src/alitra/models/orientation.py +++ b/src/alitra/models/orientation.py @@ -91,3 +91,19 @@ def from_rotation(rotation: Rotation, frame: Frame) -> Orientation: :return: Orientation object """ return Orientation(*rotation.as_quat(), frame=frame) # type: ignore + + def __str__(self): + """ + :return: Unique string representation of the orientation, ignoring the frame + """ + return ( + "[" + + str(self.x) + + "," + + str(self.y) + + "," + + str(self.z) + + "," + + str(self.w) + + "]" + ) diff --git a/src/alitra/models/pose.py b/src/alitra/models/pose.py index 095a662..96e3b68 100644 --- a/src/alitra/models/pose.py +++ b/src/alitra/models/pose.py @@ -41,3 +41,9 @@ def from_array(pos_array: np.ndarray, quat_array: np.ndarray, frame: Frame) -> P Orientation.from_quat_array(quat_array, frame), frame, ) + + def __str__(self): + """ + :return: Unique string representation of the pose + """ + return "pos:" + str(self.position) + ", ori: " + str(self.orientation) diff --git a/src/alitra/models/position.py b/src/alitra/models/position.py index 4616d85..5861989 100644 --- a/src/alitra/models/position.py +++ b/src/alitra/models/position.py @@ -71,3 +71,9 @@ def from_array(position_array: np.ndarray, frame: Frame) -> Positions: Position(x=position[0], y=position[1], z=position[2], frame=frame) ) return Positions(positions=positions, frame=frame) + + def __str__(self): + """ + :return: Unique string representation of the position, ignoring the frame + """ + return "(" + str(self.x) + "," + str(self.y) + "," + str(self.z) + ")"