Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip on Position3h #662

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/RoME.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ using SnoopPrecompile

# to avoid name conflicts
import Manifolds
using Manifolds: hat, ProductGroup, ProductManifold, SpecialEuclidean, ProductRepr, SpecialOrthogonal, TranslationGroup, identity_element, submanifold_component, Identity, affine_matrix
using Manifolds: hat, ProductGroup, ProductManifold, SpecialEuclidean
using Manifolds: ProjectiveSpace, SpecialOrthogonal, TranslationGroup
using Manifolds: identity_element, submanifold_component, Identity, affine_matrix

import Manifolds: project, project!, identity_element

Expand Down
8 changes: 4 additions & 4 deletions src/factors/Range2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ function (cfo::CalcFactor{<:Pose2Point2Range})(rho, xi::Manifolds.ArrayPartition
# Basically `EuclidDistance`
return rho .- norm(lm .- xi.x[1])
end
function (cfo::CalcFactor{<:Pose2Point2Range})(rho, xi::ProductRepr, lm)
# Basically `EuclidDistance`
return rho .- norm(lm .- xi.parts[1])
end
# function (cfo::CalcFactor{<:Pose2Point2Range})(rho, xi::ProductRepr, lm)
# # Basically `EuclidDistance`
# return rho .- norm(lm .- xi.parts[1])
# end


Base.@kwdef struct PackedPose2Point2Range <: AbstractPackedFactor
Expand Down
4 changes: 2 additions & 2 deletions src/services/FixmeManifolds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const SE2E2_Manifold = _SE2E2()

MB.manifold_dimension(::_SE2E2) = 5

AMP.makeCoordsFromPoint(::Type{<:typeof(SE2E2_Manifold)}, p::Manifolds.ProductRepr) = [p.parts[1][1], p.parts[1][2], atan(p.parts[2][2,1],p.parts[2][1,1]), p.parts[3][1], p.parts[3][2]]
AMP.makeCoordsFromPoint(::Type{<:typeof(SE2E2_Manifold)}, p::ArrayPartition) = [p.x[1][1], p.x[1][2], atan(p.x[2][2,1],p.x[2][1,1]), p.x[3][1], p.x[3][2]]

function AMP.makePointFromCoords(::typeof(SE2E2_Manifold), p::AbstractVector{<:Real})
α = p[3]
Expand Down Expand Up @@ -56,7 +56,7 @@ MB.manifold_dimension(::_CircleEuclid) = 2
const BearingRange_Manifold = _CircleEuclid()
# MB.manifold_dimension(::BearingRange_Manifold) = 2

AMP.makeCoordsFromPoint(::Type{<:typeof(BearingRange_Manifold)}, p::ProductRepr) = [p.parts[1][1]; p.parts[2][1]]
AMP.makeCoordsFromPoint(::Type{<:typeof(BearingRange_Manifold)}, p::ArrayPartition) = [p.x[1][1]; p.x[2][1]]

function AMP.makePointFromCoords(::typeof(BearingRange_Manifold), p::AbstractVector{<:Real})
ArrayPartition(([p[1];]), ([p[2];]))
Expand Down
21 changes: 19 additions & 2 deletions src/variables/VariableTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export projectCartesian
"""
$(TYPEDEF)
XY Euclidean manifold variable node softtype.
XY Euclidean manifold variable type.
"""
@defVariable Point2 TranslationGroup(2) [0.0;0.0]


"""
$(TYPEDEF)
XYZ Euclidean manifold variable node softtype.
XYZ Euclidean manifold variable type.
Example
-------
Expand All @@ -27,6 +27,23 @@ p3 = Point3()
@defVariable Point3 TranslationGroup(3) [0;0;0.0]


"""
$(TYPEDEF)
Homogeneous XYZ projective manifold variable type.
NOTE, NOT WORKING AS A GROUP SINCE RECONCILIATION WITH MANIFOLDS EXMAP STILL TBD
- see https://github.com/JuliaRobotics/RoME.jl/issues/661
Example
-------
```julia
p3 = Point3()
```
"""
@defVariable Point3h ProjectiveSpace(3) MVector{4,Float64}(0,0,0,1.)


"""
$(TYPEDEF)
Expand Down