-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a52177
commit ebf6453
Showing
7 changed files
with
141 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
""" | ||
SpecialEuclideanGroup{T} | ||
The special Euclidean group ``$(_math(:SE))(n) = $(_math(:SO))(n) ⋉ $(_math(:T))(n)``. is the Lie group consisting of the | ||
[`LeftSemidirectProductGroup`](@ref) of the [`SpecialOrthogonalGroup`](@ref) and the | ||
[`TranslationGroup`](@ref) together with the [`GroupOperationAction`](@ref)`{`[`LeftGroupOperationAction`](@ref)`}`. | ||
To be precise, the group operation is defined on ``$(_math(:SO))(n) ⋉ $(_math(:T))(n)`` as follows: | ||
```math | ||
(g_1, t_1) ⋅ (g_2, t_2) = (g_1$(_math(:∘))g_2, t_1 + g_1$(_math(:⋅))t_2) | ||
``` | ||
Analogously you can write this on elements of ``$(_math(:SO))(n) ⋊ $(_math(:T))(n)`` as | ||
```math | ||
(s_1, h_1) ⋅ (s_2, h_2) = (s_1 + h_1$(_math(:⋅))s_2, h_1$(_math(:∘))h_2) | ||
``` | ||
# Constructor | ||
SpecialEuclideanGroup(n; kwargs...) | ||
SpecialOrthogonalGroup(n; kwargs...) ⋉ TranslationGroup(n; kwargs...) | ||
Generate special Euclidean group ``$(_math(:SE))(n) = $(_math(:SO))(n) ⋉ $(_math(:T))(n)``, where the first | ||
constructor is equivalent to the second. | ||
Alternatively you can also use | ||
TranslationGroup(n; kwargs...) ⋊ SpecialOrthogonalGroup(n; kwargs...) | ||
to define ``$(_math(:SO))(n) ⋊ $(_math(:T))(n)``. | ||
If you prefer to have the order of the elements reversed, i.e. a representation with first | ||
the translation vector and then the rotation matrix, use the third constructor. | ||
All keyword arguments in `kwargs...` are passed on to [`Rotations`](@extref `Manifolds.Rotations`) as well. | ||
""" | ||
const SpecialEuclideanGroup{T} = LieGroup{ | ||
ℝ, | ||
<:LeftSemidirectProductGroupOperation{ | ||
<:MatrixMultiplicationGroupOperation, | ||
<:AdditionGroupOperation, | ||
LeftGroupOperationAction, | ||
}, | ||
<:Manifolds.ProductManifold{<:Manifolds.Rotations{T},<:Manifolds.Euclidean{T,ℝ}}, | ||
} | ||
|
||
""" | ||
default_left_action(G::SpecialOrthogonalGroup, ::TranslationGroup) | ||
Return the default left action for the special Euclidean group ``$(_math(:SO))(n) ⋊ $(_math(:T))(n)``, | ||
that is the [`GroupOperationAction`](@ref)`(`[`LeftGroupOperationAction`](@ref)`(G.op))`. | ||
""" | ||
default_left_action(G::SpecialOrthogonalGroup, ::TranslationGroup) = | ||
LeftGroupOperationAction() | ||
|
||
""" | ||
default_right_action(::TranslationGroup, G::SpecialOrthogonalGroup) | ||
Return the default right action for the special Euclidean group, | ||
that is the [`GroupOperationAction`](@ref)`(`[`LeftGroupOperationAction`](@ref)`(G.op))`. | ||
""" | ||
function default_right_action(::TranslationGroup, ::SpecialOrthogonalGroup) | ||
return LeftGroupOperationAction() | ||
end | ||
|
||
function SpecialEuclideanGroup(n; kwargs...) | ||
SOn = SpecialOrthogonalGroup(n; kwargs...) | ||
Tn = TranslationGroup(n; kwargs...) | ||
return SOn ⋉ Tn | ||
end | ||
|
||
function Base.show(io::IO, G::SpecialEuclideanGroup) | ||
size = Manifolds.get_parameter(G.manifold[2].size)[1] | ||
return print(io, "SpecialEuclideanGroup($(size))") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using LieGroups, Random, Test, RecursiveArrayTools | ||
|
||
s = joinpath(@__DIR__, "..", "LieGroupsTestSuite.jl") | ||
!(s in LOAD_PATH) && (push!(LOAD_PATH, s)) | ||
using LieGroupsTestSuite | ||
|
||
begin | ||
G = SpecialEuclideanGroup(2) | ||
g1 = ArrayPartition(1 / sqrt(2) * [1.0 1.0; -1.0 1.0], [1.0, 0.0]) | ||
#g2 = [0.0 -1.0; 1.0 0.0] | ||
#g3 = [1.0 0.0; 0.0 1.0] | ||
# X1, X2, X3 = [1.0 0.0; 0.0 0.0], [0.0 0.0; 0.0 1.0], [0.0 0.5; 0.5 0.0] | ||
properties = Dict( | ||
:Name => "The special Euclidean group", | ||
:Points => [ | ||
g1, #, g2, g3 | ||
], | ||
# :Vectors => [X1, X2, X3], | ||
:Rng => Random.MersenneTwister(), | ||
:Functions => [ | ||
# adjoint, | ||
# compose, | ||
# conjugate, | ||
# diff_inv, | ||
# diff_left_compose, | ||
# diff_right_compose, | ||
# exp, | ||
# hat, | ||
# identity_element, | ||
# inv, | ||
# inv_left_compose, | ||
# inv_right_compose, | ||
# is_identity, | ||
# lie_bracket, | ||
# log, | ||
rand, | ||
show, | ||
# vee, | ||
], | ||
) | ||
expectations = Dict( | ||
# dispatch of show does not yet work. | ||
:repr => "SpecialEuclideanGroup(2)", | ||
#:diff_inv => -X1, | ||
#:diff_left_compose => X1, | ||
#:diff_right_compose => X1, | ||
#:lie_bracket => zero(X1), | ||
) | ||
test_lie_group(G, properties, expectations) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters