@@ -983,18 +983,20 @@ def angdist(self, other: SO3, metric: int = 6) -> Union[float, ndarray]:
983983 return ad
984984
985985 def mean (self , tol : float = 20 ) -> SO3 :
986- """Mean of a set of rotations
986+ """Mean of a set of SO(3) values
987987
988988 :param tol: iteration tolerance in units of eps, defaults to 20
989989 :type tol: float, optional
990990 :return: the mean rotation
991991 :rtype: :class:`SO3` instance.
992992
993- Computes the Karcher mean of the set of rotations within the SO(3) instance.
993+ Computes the Karcher mean of the set of SO(3) rotations within the :class:`SO3` instance.
994994
995995 :references:
996996 - `**Hartley, Trumpf** - "Rotation Averaging" - IJCV 2011 <https://users.cecs.anu.edu.au/~hartley/Papers/PDF/Hartley-Trumpf:Rotation-averaging:IJCV.pdf>`_, Algorithm 1, page 15.
997997 - `Karcher mean <https://en.wikipedia.org/wiki/Karcher_mean>`_
998+
999+ :seealso: :class:`SE3.mean`
9981000 """
9991001
10001002 eta = tol * np .finfo (float ).eps
@@ -2194,6 +2196,28 @@ def angdist(self, other: SE3, metric: int = 6) -> float:
21942196 else :
21952197 return ad
21962198
2199+ def mean (self , tol : float = 20 ) -> SE3 :
2200+ """Mean of a set of SE(3) values
2201+
2202+ :param tol: iteration tolerance in units of eps, defaults to 20
2203+ :type tol: float, optional
2204+ :return: the mean SE(3) pose
2205+ :rtype: :class:`SE3` instance.
2206+
2207+ Computes the mean of all the SE(3) values within the :class:`SE3` instance. Rotations are
2208+ averaged using the Karcher mean, and translations are averaged using the
2209+ arithmetic mean.
2210+
2211+ :references:
2212+ - `**Hartley, Trumpf** - "Rotation Averaging" - IJCV 2011 <https://users.cecs.anu.edu.au/~hartley/Papers/PDF/Hartley-Trumpf:Rotation-averaging:IJCV.pdf>`_, Algorithm 1, page 15.
2213+ - `Karcher mean <https://en.wikipedia.org/wiki/Karcher_mean>`_
2214+
2215+ :seealso: :meth:`SO3.mean`
2216+ """
2217+ R_mean = SO3 (self ).mean (tol )
2218+ t_mean = self .t .mean (axis = 0 )
2219+ return SE3 .Rt (R_mean , t_mean )
2220+
21972221 # @classmethod
21982222 # def SO3(cls, R, t=None, check=True):
21992223 # if isinstance(R, SO3):
0 commit comments