@@ -983,18 +983,20 @@ def angdist(self, other: SO3, metric: int = 6) -> Union[float, ndarray]:
983
983
return ad
984
984
985
985
def mean (self , tol : float = 20 ) -> SO3 :
986
- """Mean of a set of rotations
986
+ """Mean of a set of SO(3) values
987
987
988
988
:param tol: iteration tolerance in units of eps, defaults to 20
989
989
:type tol: float, optional
990
990
:return: the mean rotation
991
991
:rtype: :class:`SO3` instance.
992
992
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.
994
994
995
995
:references:
996
996
- `**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.
997
997
- `Karcher mean <https://en.wikipedia.org/wiki/Karcher_mean>`_
998
+
999
+ :seealso: :class:`SE3.mean`
998
1000
"""
999
1001
1000
1002
eta = tol * np .finfo (float ).eps
@@ -2194,6 +2196,28 @@ def angdist(self, other: SE3, metric: int = 6) -> float:
2194
2196
else :
2195
2197
return ad
2196
2198
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
+
2197
2221
# @classmethod
2198
2222
# def SO3(cls, R, t=None, check=True):
2199
2223
# if isinstance(R, SO3):
0 commit comments