Skip to content

Commit

Permalink
Merge pull request #149 from JuliaRobotics/21Q3/maint/drtchains
Browse files Browse the repository at this point in the history
std to TranslationGroup
  • Loading branch information
dehann committed Aug 11, 2021
2 parents cc190f5 + ac6186a commit 1169d4c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Legacy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

function _reducePartialManifoldElements(el::Symbol)
if el == :Euclid
return Euclidean(1)
return TranslationGroup(1)
elseif el == :Circular
return Circle()
end
Expand Down
8 changes: 4 additions & 4 deletions src/entities/ManifoldDefinitions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ const _AMP_CIRCLE = Manifolds.Circle()
# this is just wrong and needs to be fixed
const Circle1 = Circle()

const Euclid = Euclidean(1)
const Euclid = TranslationGroup(1)
const EuclideanManifold = Euclid

const Euclid2 = Euclidean(2)
const Euclid3 = Euclidean(3)
const Euclid4 = Euclidean(4)
const Euclid2 = TranslationGroup(2)
const Euclid3 = TranslationGroup(3)
const Euclid4 = TranslationGroup(4)

# TODO if not easy simplification exists, then just deprecate this
const SE2_Manifold = SpecialEuclidean(2)
Expand Down
4 changes: 2 additions & 2 deletions src/services/ManifoldPartials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ end
## EXTRACT PARTIAL MANIFOLD


function getManifoldPartial(M::Euclidean{Tuple{N}},
function getManifoldPartial(M::Union{<:Euclidean{Tuple{N}},<:TranslationGroup},
partial::AbstractVector{Int},
repr::_PartiableRepresentationFlat{T}=nothing,
offset::Base.RefValue{Int}=Ref(0);
Expand All @@ -63,7 +63,7 @@ function getManifoldPartial(M::Euclidean{Tuple{N}},
offset[] += manifold_dimension(M)
len = sum(mask)
repr_p = repr === nothing ? nothing : zeros(T,len)
return (Euclidean(len),repr_p)
return (TranslationGroup(len),repr_p)
end

function getManifoldPartial(M::Circle,
Expand Down
4 changes: 2 additions & 2 deletions test/testBasicManiProduct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ pts1 = [[0.05*randn(2);0.75*randn()] for i in 1:N]
pts2 = [[0.05*randn(2);0.75*randn()] for i in 1:N]


P1 = manikde!(Euclidean(3),pts1)
P2 = manikde!(Euclidean(3),pts2)
P1 = manikde!(TranslationGroup(3),pts1)
P2 = manikde!(TranslationGroup(3),pts2)

P12 = P1*P2

Expand Down
10 changes: 5 additions & 5 deletions test/testManifoldPartial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ using Manifolds

##

M = Euclidean(3)
M = TranslationGroup(3)

@test getManifoldPartial(M, [1;2;3])[1] == Euclidean(3)
@test getManifoldPartial(M, [2;3])[1] == Euclidean(2)
@test getManifoldPartial(M, [1;2;3])[1] == TranslationGroup(3)
@test getManifoldPartial(M, [2;3])[1] == TranslationGroup(2)


@test getManifoldPartial(M, [1;2;3], zeros(3))[1] == Euclidean(3)
@test getManifoldPartial(M, [1;2;3], zeros(3))[1] == TranslationGroup(3)
@test isapprox( getManifoldPartial(M, [1;2;3], zeros(3))[2], zeros(3) )

@test getManifoldPartial(M, [2;3], zeros(3))[1] == Euclidean(2)
@test getManifoldPartial(M, [2;3], zeros(3))[1] == TranslationGroup(2)
@test isapprox( getManifoldPartial(M, [2;3], zeros(3))[2], zeros(2))


Expand Down

0 comments on commit 1169d4c

Please sign in to comment.