diff --git a/dgp/utils/pose.py b/dgp/utils/pose.py index d44f7f84..b94453f2 100644 --- a/dgp/utils/pose.py +++ b/dgp/utils/pose.py @@ -44,8 +44,8 @@ def copy(self): """Return a copy of this pose object. Returns - ---------- - result: Pose + ------- + Pose Copied pose object. """ return self.__class__(Quaternion(self.quat), self.tvec.copy(), self.reference_coordinate_system) @@ -62,8 +62,8 @@ def __mul__(self, other): (i.e. X' = self_pose * X) Returns - ---------- - result: Pose or np.ndarray + ------- + Pose or np.ndarray Transformed pose or point cloud """ if isinstance(other, Pose): @@ -85,10 +85,15 @@ def inverse(self, new_reference_coordinate_system=""): """Returns a new Pose that corresponds to the inverse of this one. - Returns + Parameters ---------- - result: Pose - Inverted pose + new_reference_coordinate_system: str + The reference coordinate system the inverse Pose (Transform) is expressed with respect to. I.e. the name of the current Pose + + Returns + ------- + Pose + new_reference_coordinate_system pose """ qinv = self.quat.inverse return self.__class__(qinv, qinv.rotate(-self.tvec), @@ -99,7 +104,7 @@ def matrix(self): """Returns a 4x4 homogeneous matrix of the form [R t; 0 1] Returns - ---------- + ------- result: np.ndarray 4x4 homogeneous matrix """ @@ -112,8 +117,8 @@ def rotation_matrix(self): """Returns the 3x3 rotation matrix (R) Returns - ---------- - result: np.ndarray + ------- + np.ndarray 3x3 rotation matrix """ result = self.quat.transformation_matrix @@ -124,8 +129,8 @@ def rotation(self): """Return the rotation component of the pose as a Quaternion object. Returns - ---------- - self.quat: Quaternion + ------- + Quaternion Rotation component of the Pose object. """ return self.quat @@ -135,8 +140,8 @@ def translation(self): """Return the translation component of the pose as a np.ndarray. Returns - ---------- - self.tvec: np.ndarray + ------- + np.ndarray Translation component of the Pose object. """ return self.tvec @@ -149,6 +154,8 @@ def from_matrix(cls, transformation_matrix, reference_coordinate_system=""): ---------- transformation_matrix: np.ndarray 4x4 containing rotation/translation + reference_coordinate_system: str + Reference coordinate system this Pose (Transform) is expressed with respect to Returns ------- @@ -168,6 +175,8 @@ def from_rotation_translation(cls, rotation_matrix, tvec, reference_coordinate_s 3x3 rotation matrix tvec : np.ndarray length-3 translation vector + reference_coordinate_system: str + Reference coordinate system this Pose (Transform) is expressed with respect to """ return cls(wxyz=Quaternion(matrix=rotation_matrix), tvec=np.float64(tvec), reference_coordinate_system=reference_coordinate_system)