The special Euclidean group
LieGroups.SpecialEuclideanGroup β TypeSpecialEuclideanGroup{T}The special Euclidean group $\mathrm{SE}(n) = \mathrm{SO}(n) β \mathcal T(n)$ is the Lie group consisting of the LeftSemidirectProductGroupOperation of the SpecialOrthogonalGroup and the TranslationGroup together with the GroupOperationAction{LeftGroupOperationAction}.
To be precise, the group operation is defined on $\mathrm{SO}(n) β \mathcal T(n)$ as follows:
\[(r_1, t_1) β (r_2, t_2) = (r_1βr_2, t_1 + r_1β t_2),\]
where $r_1,r_2 β \mathrm{SO}(n)$ and $t_1,t_2 β \mathcal T(n)$
Analogously you can write this on elements of $\mathrm{SO}(n) β \mathcal T(n)$ as
\[(t_1, r_1) β (t_2, r_2) = (t_1 + r_1β s_2, r_1βr_2)\]
Both these cases can be represented in a single matrix in affine form
\[g = \begin{pmatrix} r & t\\ \mathbf{0}_n^{\mathrm{T}} & 1\end{pmatrix}, \qquad r β \mathrm{SO}(n), t β \mathcal T(n),\]
where $\mathbf{0}_n β β^n$ denotes the vector containing zeros.
We refer also in general to elements on $\mathrm{SE}(n)$ as $g$ and their rotation and translation components as $r$ and $t$, respectively.
Note further that in the notation above and in matrix form the default is the ActionActsOnRight action.
Constructor
SpecialEuclideanGroup(n::Int; variant=:left, kwargs...)
SpecialOrthogonalGroup(n; kwargs...) β TranslationGroup(n; kwargs...)
TranslationGroup(n; kwargs...) β SpecialOrthogonalGroup(n; kwargs...)Generate special Euclidean group $\mathrm{SE}(n) = \mathrm{SO}(n) β \mathcal T(n)$, where the first constructor is equivalent to the second.
All keyword arguments in kwargs... are passed on to Rotations as well.
The default representation for $\mathrm{SE}(n)$ is the affine form. Alternatively you can use the ArrayPartition from RecursiveArrayTools.jl to work on $(r,t)$. or for $\mathcal T(n) β \mathrm{SO}(n)$ using the ArrayPartitions $(t,r)$; which corresponds to setting variant=:right in the first constructor.
Representation of points and tangent vectors
LieGroups.SpecialEuclideanMatrixPoint β TypeSpecialEuclideanMatrixPoint <: AbstractLieGroupPointrepresent a point on some AbstractLieGroup by an affine matrix.
\[\begin{pmatrix} M & v\\ \mathbf{0}_n^{\mathrm{T}} & 1\end{pmatrix} β β^{(n+1)Γ(n+1)}, \qquad M β β^{nΓn}, v β \mathcal T(n),\]
where $\mathbf{0}_n β β^n$ denotes the vector containing zeros.
LieGroups.SpecialEuclideanMatrixTangentVector β TypeSpecialEuclideanMatrixTangentVector <: AbstractLieAlgebraTangentVectorrepresent a tangent vector on some AbstractLieGroup by a matrix of the form
\[\begin{pmatrix} M & v\\ \mathbf{0}_n^{\mathrm{T}} & 0\end{pmatrix} β β^{(n+1)Γ(n+1)}, \qquad M β β^{nΓn}, v β \mathcal T(n),\]
where $\mathbf{0}_n β β^n$ denotes the vector containing zeros.
While this tangent vector itself is not an affine matrix itself, it can be used for the Lie algebra of the affine group
LieGroups.SpecialEuclideanProductPoint β TypeSpecialEuclideanProductPoint <: AbstractLieGroupPointRepresent a point on a Lie group (explicitly) as a point that consists of components
LieGroups.SpecialEuclideanProductTangentVector β TypeSpecialEuclideanProductTangentVector <: AbstractLieAlgebraTangentVectorRepresent a point on a Lie algebra (explicitly) as a tangent vector that consists of components.
Specific functions
Base.exp β Methodexp(G::SpecialEuclidean, X)
exp!(G::SpecialEuclidean, g, X)Compute the Lie group exponential function on the SpecialEuclideanGroup G$=\mathrm{SE}(2)$ using a TypeParameter{Tuple{2}} for dispatch.
The Lie algebra vector $X = (Y, v) β \mathfrak se(2)$ consists of a rotation component $Y β \mathfrak so(2)$ and a translation component $v β \mathfrak t(2)$, so we can use vee on $\mathrm{SO}(2)$ to obtain the angle of rotation $Ξ±$ (or alternatively using $\sqrt{2}Ξ± = \lVert Y \rVert_{}$)
For $Ξ± β 0$ define
\[U_Ξ± = \frac{\sinΞ±}{Ξ±}I_2 + \frac{1-\cosΞ±}{Ξ±^2}Y,\]
and $U_0 = I_2$, where $I_2$ is the identity matrix.
Then the result $g=(R,t)$ is given by
\[R = \exp_{\mathrm{SO}(2)}Y β \mathrm{SO}(2), \quad \text{ and } \quad t = U_Ξ±v β \mathcal T(2).\]
This result can be computed in-place of g.
Base.exp β Methodexp(G::SpecialEuclidean, X)
exp!(G::SpecialEuclidean, g, X)Compute the Lie group exponential function on the SpecialEuclideanGroup G$=\mathrm{SE}(3)$ using a TypeParameter{Tuple{3}} for dispatch.
Since $X = (Y, v) β \mathfrak se(3)$ consists of a rotation component $Y β \mathfrak se(3)$ and a translation component $v β \mathfrak t(3)$, we can use vee on $\mathrm{SO}(3)$ computing the coefficients norm to obtain the angle of rotation $Ξ±$ (or alternatively using $\sqrt{2}Ξ± = \lVert Y \rVert_{}$).
For $Ξ± β 0$ define
\[U_Ξ± = I_3 + \frac{1-\cosΞ±}{Ξ±^2}Y + \frac{Ξ±-\sinΞ±}{Ξ±^3}Y^2,\]
and $U_0 = I_3$, where $I_2$ is the identity matrix.
Then the result $g=(R,t)$ is given by
\[R = \exp_{\mathrm{SO}(3)}Y β \mathrm{SO}(3), \quad \text{ and } \quad t = U_Ξ±v β \mathcal T(3).\]
This result can be computed in-place of g.
Base.getindex β Methodg[G::SpecialEuclideanGroup,s]
getindex(g, G::SpecialEuclideanGroup, s)
X[π€,s]
getindex(g, π€, s)Access sub-parts of a SpecialEuclideanGroup G or its Lie algebra π€. where s can be an index :Rotation, :Translation to access the single parts. Use : to access all submanifold components as a unified tuple.
Base.getindex β Methodg[G::SpecialEuclideanGroup,s]
getindex(g, G::SpecialEuclideanGroup, s)
X[π€,s]
getindex(g, π€, s)Access sub-parts of a SpecialEuclideanGroup G or its Lie algebra π€. where s can be an index :Rotation, :Translation to access the single parts. Use : to access all submanifold components as a unified tuple.
Base.getindex β Methodg[G::SpecialEuclideanGroup,s]
getindex(g, G::SpecialEuclideanGroup, s)
X[π€,s]
getindex(g, π€, s)Access sub-parts of a SpecialEuclideanGroup G or its Lie algebra π€. where s can be an index :Rotation, :Translation to access the single parts. Use : to access all submanifold components as a unified tuple.
Base.inv β Methodinv(G::SpecialEuclideanGroup, g)
inv(G::SpecialEuclideanGroup, h, g)Compute the inverse element of a $g β \mathrm{SE}(n)$ from the SpecialEuclideanGroup(n).
In affine form, $g = \begin{pmatrix} r & t\\ \mathbf{0}_n^{\mathrm{T}} & 1\end{pmatrix}$, where $\mathbf{0}_n β β^n$ denotes the vector containing zeros.
The inverse reads
\[g^{-1} = \begin{pmatrix} r^{\mathrm{T}} & -r^{\mathrm{T}}t\\ \mathbf{0}_n^{\mathrm{T}} & 1\end{pmatrix}.\]
This computation can be done in-place of h.
Base.log β Methodlog(G::SpecialEuclidean, g)
log!(G::SpecialEuclidean, X, g)Compute the Lie group logarithm function on the SpecialEuclideanGroup G$=\mathrm{SE}(2)$, and G uses a TypeParameter{Tuple{2}} for dispatch.
Since $g=(R,t) β \mathrm{SE}(2)$ consists of a rotation component $R β \mathrm{SO}(2)$ and a translation component $t β \mathcal T(2)$, we first compute $Y = \log_{\mathrm{SO}(2)}R$. Then we can use vee on $\mathrm{SO}(2)$ to obtain the angle of rotation $Ξ±$ (or alternatively using $\sqrt{2}Ξ± = \lVert Y \rVert_{}$)
For $Ξ± β 0$ define
\[V_Ξ± = \frac{Ξ±}{2} \begin{pmatrix} \frac{\sinΞ±}{1-\cosΞ±} & 1\\ -1 & \frac{\sinΞ±}{1-\cosΞ±}\end{pmatrix}\]
and $V_0 = I_2$, where $I_2$ is the identity matrix. Note that this is the inverse of $U_Ξ±$ as given in the group exponential
Then the result $X = (Y, v) β \mathfrak se(2)$ is given by $Y β \mathfrak so(2)$ as computed above and
\[v = V_Ξ±r β \mathcal T(2),\]
where $v$ is computed in-place without setting up $V_Ξ±$
This result can be computed in-place of g.
Base.log β Methodlog(G::SpecialEuclidean, g)
log!(G::SpecialEuclidean, X, g)Compute the Lie group logarithm function on the SpecialEuclideanGroup G$=\mathrm{SE}(3)$, where e is the Identity on $\mathrm{SE}(3)$ G uses a TypeParameter{Tuple{3}} for dispatch.
Since $g=(R,t) β \mathrm{SE}(3)$ consists of a rotation component $R β \mathrm{SO}(3)$ and a translation component $t β \mathcal T(2)$, we first compute $Y = \log_{\mathrm{SO}(3)}R$. Then we can use vee on $\mathrm{SO}(3)$ to obtain the angle of rotation $Ξ±$ (or alternatively using $\sqrt{2}Ξ± = \lVert Y \rVert_{}$)
For $Ξ± β 0$ define
\[V_Ξ± = I_3 - \frac{1}{2}Y + Ξ² Y^2, \quad\text{ where } Ξ² = \frac{1}{Ξ±^2} - \frac{1 + \cos(Ξ±)}{2Ξ±\sin(Ξ±)}\]
and $V_0 = I_3$, where $I_3$ is the identity matrix. Note that this is the inverse of $U_Ξ±$ as given in the group exponential
Then the result $X = (Y, v) β \mathfrak se(3)$ is given by $Y β \mathfrak so(3)$ as computed above and $v = V_Ξ± t β \mathfrak t(3)$.
This result can be computed in-place of X.
LieGroups._inv! β Methodinv(G::SpecialEuclideanGroup, g)
inv(G::SpecialEuclideanGroup, h, g)Compute the inverse element of a $g β \mathrm{SE}(n)$ from the SpecialEuclideanGroup(n).
In affine form, $g = \begin{pmatrix} r & t\\ \mathbf{0}_n^{\mathrm{T}} & 1\end{pmatrix}$, where $\mathbf{0}_n β β^n$ denotes the vector containing zeros.
The inverse reads
\[g^{-1} = \begin{pmatrix} r^{\mathrm{T}} & -r^{\mathrm{T}}t\\ \mathbf{0}_n^{\mathrm{T}} & 1\end{pmatrix}.\]
This computation can be done in-place of h.
LieGroups.apply! β Methodapply(::GroupAction{LeftMultiplicationGroupAction, <:SpecialEuclideanGroup, <:Euclidean}, g, p)
apply!(::GroupAction{LeftMultiplicationGroupAction, <:SpecialEuclideanGroup, <:Euclidean}, q, g, p)Given the Lie group SpecialEuclideanGroup and the Euclidean manifold $β^n$, this action performs both the rotation and translation on a vector $p β β^n$, that is, for $g = (R, t) β \mathrm{SE}(n)$, the action is given by
\[q = Ο_g(p) = g β p = Rp + t,\]
where the name of the action, LeftMultiplicationGroupAction, indicates that the group element g acts on the left of the vector p, and directly yields a multiplication if interpreted in homogeneous coordinates.
LieGroups.apply β Methodapply(::GroupAction{LeftMultiplicationGroupAction, <:SpecialEuclideanGroup, <:Euclidean}, g, p)
apply!(::GroupAction{LeftMultiplicationGroupAction, <:SpecialEuclideanGroup, <:Euclidean}, q, g, p)Given the Lie group SpecialEuclideanGroup and the Euclidean manifold $β^n$, this action performs both the rotation and translation on a vector $p β β^n$, that is, for $g = (R, t) β \mathrm{SE}(n)$, the action is given by
\[q = Ο_g(p) = g β p = Rp + t,\]
where the name of the action, LeftMultiplicationGroupAction, indicates that the group element g acts on the left of the vector p, and directly yields a multiplication if interpreted in homogeneous coordinates.
LieGroups.default_left_action β Methoddefault_left_action(::SpecialOrthogonalGroup, ::TranslationGroup)Return the default AbstractGroupActionType for the special Euclidean group $\mathrm{SO}(n) β \mathcal T(n)$, which is the LeftMultiplicationGroupAction
LieGroups.default_right_action β Methoddefault_right_action(::TranslationGroup, ::SpecialOrthogonalGroup)Return the default AbstractGroupActionType for the special Euclidean group $\mathcal T(n) β \mathrm{SO}(n)$, which is the LeftMultiplicationGroupAction
LieGroups.diff_apply! β Methoddiff_apply(::GroupAction{LeftMultiplicationGroupAction,SpecialEuclideanGroup,Euclidean}, g, p, X)
diff_apply!(::GroupAction{LeftMultiplicationGroupAction,SpecialEuclideanGroup,Euclidean}, Y, g, p, X)Given the Lie group SpecialEuclideanGroup and the Euclidean manifold $β^n$, the differential of the group action this action performs both the rotation and translation on a vector $p β β^n$, that is, for $g = (R, t) β \mathrm{SE}(n)$, the differential is given by
\[Y = DΟ_g(p)[X] = RX,\]
where the name of the action, LeftMultiplicationGroupAction, indicates that the group element g acts on the left of the vector p, and directly yields a multiplication if interpreted in homogeneous coordinates.
LieGroups.diff_apply β Methoddiff_apply(::GroupAction{LeftMultiplicationGroupAction,SpecialEuclideanGroup,Euclidean}, g, p, X)
diff_apply!(::GroupAction{LeftMultiplicationGroupAction,SpecialEuclideanGroup,Euclidean}, Y, g, p, X)Given the Lie group SpecialEuclideanGroup and the Euclidean manifold $β^n$, the differential of the group action this action performs both the rotation and translation on a vector $p β β^n$, that is, for $g = (R, t) β \mathrm{SE}(n)$, the differential is given by
\[Y = DΟ_g(p)[X] = RX,\]
where the name of the action, LeftMultiplicationGroupAction, indicates that the group element g acts on the left of the vector p, and directly yields a multiplication if interpreted in homogeneous coordinates.
LieGroups.init_constants! β Methodinit_constants!(G::SpecialEuclidean, g)
init_Constants!(π°π’::LieAlgebra{β, SpecialEuclideanGroupOperation, SpecialEuclidean}, X)Initialize the constant elements of g or X.
The matrix representation of $gβ\mathrm{SE}(n)$ has a last row, that contains zeros, besides the diagonal element, which is $g_{n+1,n+1} = 1$.
The matrix representation of $Xβ\mathfrak se(n)$ has a last row that contains zeros.
this function sets these entries accordingly.
Per default for other representations, this function does not change entries for them.
LieGroups.init_constants! β Methodinit_constants!(G::SpecialEuclidean, g)
init_Constants!(π°π’::LieAlgebra{β, SpecialEuclideanGroupOperation, SpecialEuclidean}, X)Initialize the constant elements of g or X.
The matrix representation of $gβ\mathrm{SE}(n)$ has a last row, that contains zeros, besides the diagonal element, which is $g_{n+1,n+1} = 1$.
The matrix representation of $Xβ\mathfrak se(n)$ has a last row that contains zeros.
this function sets these entries accordingly.
Per default for other representations, this function does not change entries for them.
LieGroups.lie_bracket! β Methodlie_bracket(π°π’::LieAlgebra{β, SpecialEuclideanGroupOperation, SpecialEuclideanGroup}, X, Y)
lie_bracket!(π°π’::LieAlgebra{β, SpecialEuclideanGroupOperation, SpecialEuclideanGroup}, Z, X, Y)Calculate the Lie bracket between elements X and Y of the Lie algebra of the SpecialEuclideanGroup. For the matrix representation, cf. SpecialEuclideanMatrixTangentVector or a <:AbstractMatrix, the formula reads
\[[X, Y] = XY-YX\]
LieGroups.lie_bracket β Methodlie_bracket(π°π’::LieAlgebra{β, SpecialEuclideanGroupOperation, SpecialEuclideanGroup}, X, Y)
lie_bracket!(π°π’::LieAlgebra{β, SpecialEuclideanGroupOperation, SpecialEuclideanGroup}, Z, X, Y)Calculate the Lie bracket between elements X and Y of the Lie algebra of the SpecialEuclideanGroup. For the matrix representation, cf. SpecialEuclideanMatrixTangentVector or a <:AbstractMatrix, the formula reads
\[[X, Y] = XY-YX\]
ManifoldsBase.exp! β Methodexp(G::SpecialEuclidean, X)
exp!(G::SpecialEuclidean, g, X)Compute the Lie group exponential function on the SpecialEuclideanGroup G$=\mathrm{SE}(3)$ using a TypeParameter{Tuple{3}} for dispatch.
Since $X = (Y, v) β \mathfrak se(3)$ consists of a rotation component $Y β \mathfrak se(3)$ and a translation component $v β \mathfrak t(3)$, we can use vee on $\mathrm{SO}(3)$ computing the coefficients norm to obtain the angle of rotation $Ξ±$ (or alternatively using $\sqrt{2}Ξ± = \lVert Y \rVert_{}$).
For $Ξ± β 0$ define
\[U_Ξ± = I_3 + \frac{1-\cosΞ±}{Ξ±^2}Y + \frac{Ξ±-\sinΞ±}{Ξ±^3}Y^2,\]
and $U_0 = I_3$, where $I_2$ is the identity matrix.
Then the result $g=(R,t)$ is given by
\[R = \exp_{\mathrm{SO}(3)}Y β \mathrm{SO}(3), \quad \text{ and } \quad t = U_Ξ±v β \mathcal T(3).\]
This result can be computed in-place of g.
ManifoldsBase.exp! β Methodexp(G::SpecialEuclidean, X)
exp!(G::SpecialEuclidean, g, X)Compute the Lie group exponential function on the SpecialEuclideanGroup G$=\mathrm{SE}(2)$ using a TypeParameter{Tuple{2}} for dispatch.
The Lie algebra vector $X = (Y, v) β \mathfrak se(2)$ consists of a rotation component $Y β \mathfrak so(2)$ and a translation component $v β \mathfrak t(2)$, so we can use vee on $\mathrm{SO}(2)$ to obtain the angle of rotation $Ξ±$ (or alternatively using $\sqrt{2}Ξ± = \lVert Y \rVert_{}$)
For $Ξ± β 0$ define
\[U_Ξ± = \frac{\sinΞ±}{Ξ±}I_2 + \frac{1-\cosΞ±}{Ξ±^2}Y,\]
and $U_0 = I_2$, where $I_2$ is the identity matrix.
Then the result $g=(R,t)$ is given by
\[R = \exp_{\mathrm{SO}(2)}Y β \mathrm{SO}(2), \quad \text{ and } \quad t = U_Ξ±v β \mathcal T(2).\]
This result can be computed in-place of g.
ManifoldsBase.log! β Methodlog(G::SpecialEuclidean, g)
log!(G::SpecialEuclidean, X, g)Compute the Lie group logarithm function on the SpecialEuclideanGroup G$=\mathrm{SE}(2)$, and G uses a TypeParameter{Tuple{2}} for dispatch.
Since $g=(R,t) β \mathrm{SE}(2)$ consists of a rotation component $R β \mathrm{SO}(2)$ and a translation component $t β \mathcal T(2)$, we first compute $Y = \log_{\mathrm{SO}(2)}R$. Then we can use vee on $\mathrm{SO}(2)$ to obtain the angle of rotation $Ξ±$ (or alternatively using $\sqrt{2}Ξ± = \lVert Y \rVert_{}$)
For $Ξ± β 0$ define
\[V_Ξ± = \frac{Ξ±}{2} \begin{pmatrix} \frac{\sinΞ±}{1-\cosΞ±} & 1\\ -1 & \frac{\sinΞ±}{1-\cosΞ±}\end{pmatrix}\]
and $V_0 = I_2$, where $I_2$ is the identity matrix. Note that this is the inverse of $U_Ξ±$ as given in the group exponential
Then the result $X = (Y, v) β \mathfrak se(2)$ is given by $Y β \mathfrak so(2)$ as computed above and
\[v = V_Ξ±r β \mathcal T(2),\]
where $v$ is computed in-place without setting up $V_Ξ±$
This result can be computed in-place of g.
ManifoldsBase.log! β Methodlog(G::SpecialEuclidean, g)
log!(G::SpecialEuclidean, X, g)Compute the Lie group logarithm function on the SpecialEuclideanGroup G$=\mathrm{SE}(3)$, where e is the Identity on $\mathrm{SE}(3)$ G uses a TypeParameter{Tuple{3}} for dispatch.
Since $g=(R,t) β \mathrm{SE}(3)$ consists of a rotation component $R β \mathrm{SO}(3)$ and a translation component $t β \mathcal T(2)$, we first compute $Y = \log_{\mathrm{SO}(3)}R$. Then we can use vee on $\mathrm{SO}(3)$ to obtain the angle of rotation $Ξ±$ (or alternatively using $\sqrt{2}Ξ± = \lVert Y \rVert_{}$)
For $Ξ± β 0$ define
\[V_Ξ± = I_3 - \frac{1}{2}Y + Ξ² Y^2, \quad\text{ where } Ξ² = \frac{1}{Ξ±^2} - \frac{1 + \cos(Ξ±)}{2Ξ±\sin(Ξ±)}\]
and $V_0 = I_3$, where $I_3$ is the identity matrix. Note that this is the inverse of $U_Ξ±$ as given in the group exponential
Then the result $X = (Y, v) β \mathfrak se(3)$ is given by $Y β \mathfrak so(3)$ as computed above and $v = V_Ξ± t β \mathfrak t(3)$.
This result can be computed in-place of X.