-
Notifications
You must be signed in to change notification settings - Fork 13
use ApproxManiProds.skew instead #747
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,20 +5,6 @@ using LinearAlgebra | |
| using DistributedFactorGraphs | ||
| using Dates | ||
|
|
||
| # FIXME use ApproxManifoldsProducts version instead | ||
| function TransformUtils.skew(v::SVector{3,T}) where T<:Real | ||
| return SMatrix{3,3,T}( | ||
| 0, | ||
| v[3], | ||
| -v[2], | ||
| -v[3], | ||
| 0, | ||
| v[1], | ||
| v[2], | ||
| -v[1], | ||
| 0 | ||
| ) | ||
| end | ||
|
|
||
| struct IMUDeltaManifold <: AbstractManifold{ℝ} end | ||
|
|
||
|
|
@@ -101,7 +87,7 @@ end | |
|
|
||
| function Manifolds.hat(M::IMUDeltaGroup, Xⁱ::SVector{10, T}) where T<:Real | ||
| return ArrayPartition( | ||
| skew(Xⁱ[SA[7:9...]]), # θ ωΔt | ||
| ApproxManifoldProducts.skew(Xⁱ[SA[7:9...]]), # θ ωΔt | ||
| Xⁱ[SA[4:6...]], # ν aΔt | ||
| Xⁱ[SA[1:3...]], # ρ vΔt | ||
| Xⁱ[10], # Δt | ||
|
|
@@ -131,7 +117,7 @@ function _Q(θ⃗) | |
| else | ||
| u = θ⃗/θ | ||
| sθ, cθ = sincos(θ) | ||
| uₓ = skew(u) | ||
| uₓ = ApproxManifoldProducts.skew(u) | ||
| # NOTE difference in references here --- (θ - sθ)/θ^2 vs (θ - sθ)/θ | ||
| # with no ^2 looking correct when compared to exp of SE3 | ||
| return SMatrix{3,3,T}(I) + (1 - cθ)/θ * uₓ + (θ - sθ)/θ * uₓ^2 | ||
|
|
@@ -146,7 +132,7 @@ function _P(θ⃗) | |
| else | ||
| u = θ⃗/θ | ||
| sθ, cθ = sincos(θ) | ||
| uₓ = skew(u) | ||
| uₓ = ApproxManifoldProducts.skew(u) | ||
| return 1/2*SMatrix{3,3,T}(I) + (θ - sθ)/θ^2 * uₓ + (cθ + 1/2*θ^2 - 1)/θ^2 * uₓ^2 | ||
| end | ||
| end | ||
|
|
@@ -255,8 +241,8 @@ function adjointMatrix(::IMUDeltaGroup, X::ArrayPartition{T}) where T | |
|
|
||
| IΔt = SMatrix{3,3,T}(X.x[4]*I) | ||
|
|
||
| ρₓ = skew(ρ) | ||
| νₓ = skew(ν) | ||
| ρₓ = ApproxManifoldProducts.skew(ρ) | ||
| νₓ = ApproxManifoldProducts.skew(ν) | ||
|
|
||
| m0 = zeros(3,3) | ||
| v0 = zeros(3) | ||
|
|
@@ -277,8 +263,8 @@ function AdjointMatrix(::IMUDeltaGroup, p::ArrayPartition{T}) where T | |
| Δp = p.x[3] | ||
| Δt = p.x[4] | ||
|
|
||
| Δvₓ = skew(Δv) | ||
| pmvtₓ = skew(Δp - Δv*Δt) | ||
| Δvₓ = ApproxManifoldProducts.skew(Δv) | ||
| pmvtₓ = ApproxManifoldProducts.skew(Δp - Δv*Δt) | ||
|
|
||
| m0 = zeros(3,3) | ||
| v0 = zeros(3) | ||
|
|
@@ -324,7 +310,7 @@ Base.@kwdef struct IMUDeltaFactor{T <: SamplableBelief} <: AbstractManifoldMinim | |
| J_b::SMatrix{10,6,Float64} = zeros(SMatrix{10,6,Float64}) | ||
| # accelerometer bias, gyroscope bias | ||
| b::SVector{6, Float64} = zeros(SVector{6, Float64}) | ||
| #optional raw measurements | ||
| #optional raw measurements, FIXME replace with BlobEntry -- dont do abstract types here, or raw data if not needed in hotloop | ||
|
Affie marked this conversation as resolved.
|
||
| raw_measurements::Union{Nothing,IMUMeasurements} = nothing | ||
| end | ||
|
|
||
|
|
@@ -340,6 +326,9 @@ end | |
| IIF.getManifold(::IMUDeltaFactor) = IMUDeltaGroup() | ||
|
|
||
| function IIF.preambleCache(fg::AbstractDFG, vars::AbstractVector{<:DFGVariable}, ::IMUDeltaFactor) | ||
| # FIXME, nsec should only contain fractional second information, i.e. < 1.0s. Use together with `trunc(timestamp) + 1e-9*nsec` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is not how I use it and not how its documented.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, we should do what ROS does and not our own special thing. By the way, the suggested code here works for both cases. We should also update our documentation to reflect the same as ROS.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We had this discussion before and also didn't agree then.
I feel like a parrot, but it doesn't, I've had multiple cases where there are 2 different timestamps. Not all timestamps are synced, and not all timestamps are unix epoch.
This comment was marked as duplicate.
Sorry, something went wrong.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So what I'm looking to get right here is that this should never be allowed to happen. Sounds like imposing a restriction (along with Synchronization may well be a session-delta (or clone of session to resolve). Ultimately the unsync'd graph variables (or whole graph fragment) should be replaced so that only consistent timestamps remain. We should not kick the can down and have users struggle with timestamps downstream.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I mean that we stay with 64 bit (obviously). Note some web stacks only support 32 bit at this time. Some of the json libraries was the example we bumped into before. In that case we should then still be good, but would not be our "fault" if it happens somewhere.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated the
dehann marked this conversation as resolved.
Outdated
|
||
| # pt = floor(Float64, datetime2unix(getTimestamp(vars[1]))) + (1e-9*vars[1].nstime % 1.0) | ||
| # qt = floor(Float64, datetime2unix(getTimestamp(vars[2]))) + (1e-9*vars[2].nstime % 1.0) | ||
| (timestams=(vars[1].nstime,vars[2].nstime),) | ||
| end | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.