Skip to content

Commit

Permalink
docs: add missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
David Torres Ocana (TME) committed May 23, 2023
1 parent 76d8d92 commit 74550bb
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions dgp/utils/pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand All @@ -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),
Expand All @@ -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
"""
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
-------
Expand All @@ -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)
Expand Down

0 comments on commit 74550bb

Please sign in to comment.