Skip to content

Commit ab922f1

Browse files
authored
Merge pull request #794 from JuliaRobotics/master
v0.15.1-rc1
2 parents 54c1289 + e30ddde commit ab922f1

File tree

5 files changed

+28
-18
lines changed

5 files changed

+28
-18
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DistributedFactorGraphs"
22
uuid = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
3-
version = "0.15.0"
3+
version = "0.15.1"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/services/CompareUtils.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,14 @@ function compareFactor(A::DFGFactor,
236236
skipsamples::Bool=true,
237237
skipcompute::Bool=true )
238238
#
239-
TP = compareAll(A, B, skip=union([:attributes;:solverData;:_variableOrderSymbols],skip), show=show)
239+
skip_ =
240+
TP = compareAll(A, B, skip=union([:attributes;:solverData;:_variableOrderSymbols;:_gradients],skip), show=show)
240241
# TP = TP & compareAll(A.attributes, B.attributes, skip=[:data;], show=show)
241-
TP = TP & compareAllSpecial(getSolverData(A), getSolverData(B), skip=union([:fnc], skip), show=show)
242+
TP = TP & compareAllSpecial(getSolverData(A), getSolverData(B), skip=union([:fnc;:_gradients], skip), show=show)
242243
if :fnc in skip
243244
return TP
244245
end
245-
TP = TP & compareAllSpecial(getSolverData(A).fnc, getSolverData(B).fnc, skip=union([:cpt;:measurement;:params;:varidx;:threadmodel], skip), show=show)
246+
TP = TP & compareAllSpecial(getSolverData(A).fnc, getSolverData(B).fnc, skip=union([:cpt;:measurement;:params;:varidx;:threadmodel;:_gradients], skip), show=show)
246247
if !(:measurement in skip)
247248
TP = TP & (skipsamples || compareAll(getSolverData(A).fnc.measurement, getSolverData(B).fnc.measurement, show=show, skip=skip))
248249
end

src/services/DFGVariable.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ Related
159159
160160
[`getCoordinates`](@ref)
161161
"""
162-
function getPoint(::Type{T}, v::AbstractVector) where {T <: InferenceVariable}
162+
function getPoint(::Type{T}, v::AbstractVector, basis=ManifoldsBase.DefaultOrthogonalBasis()) where {T <: InferenceVariable}
163163
M = getManifold(T)
164164
p0 = getPointIdentity(T)
165-
X = ManifoldsBase.get_vector(M, p0, v, ManifoldsBase.DefaultOrthonormalBasis())
165+
X = ManifoldsBase.get_vector(M, p0, v, basis)
166166
ManifoldsBase.exp(M, p0, X)
167167
end
168168

@@ -179,11 +179,11 @@ Related
179179
180180
[`getPoint`](@ref)
181181
"""
182-
function getCoordinates(::Type{T}, p) where {T <: InferenceVariable}
182+
function getCoordinates(::Type{T}, p, basis=ManifoldsBase.DefaultOrthogonalBasis()) where {T <: InferenceVariable}
183183
M = getManifold(T)
184184
p0 = getPointIdentity(T)
185185
X = ManifoldsBase.log(M, p0, p)
186-
ManifoldsBase.get_coordinates(M, p0, X, ManifoldsBase.DefaultOrthonormalBasis())
186+
ManifoldsBase.get_coordinates(M, p0, X, basis)
187187
end
188188

189189

src/services/Serialization.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ function unpackVariable(dfg::G,
150150
ppeDict = unpackPPEs ? JSON2.read(packedProps["ppeDict"], Dict{Symbol, MeanMaxPPE}) : Dict{Symbol, MeanMaxPPE}()
151151
smallData = JSON2.read(packedProps["smallData"], Dict{Symbol, SmallDataTypes})
152152

153-
if haskey(packedProps, "softtype")
153+
variableTypeString = if haskey(packedProps, "softtype")
154154
# TODO Deprecate, remove in v0.12
155155
@warn "Packed field `softtype` is deprecated and replaced with `variableType`"
156-
variableTypeString = packedProps["softtype"]
156+
packedProps["softtype"]
157157
else
158-
variableTypeString = packedProps["variableType"]
158+
packedProps["variableType"]
159159
end
160160

161161
variableType = getTypeFromSerializationModule(variableTypeString)
@@ -220,7 +220,7 @@ end
220220
# returns a PackedVariableNodeData
221221
function packVariableNodeData(::G, d::VariableNodeData{T}) where {G <: AbstractDFG, T <: InferenceVariable}
222222
@debug "Dispatching conversion variable -> packed variable for type $(string(d.variableType))"
223-
# @show d.val
223+
# TODO change to Vector{Vector{Float64}} which can be directly packed by JSON
224224
castval = if 0 < length(d.val)
225225
precast = getCoordinates.(T, d.val)
226226
@cast castval[i,j] := precast[j][i]
@@ -315,12 +315,12 @@ function packFactor(dfg::G, f::DFGFactor)::Dict{String, Any} where G <: Abstract
315315
end
316316

317317
function decodePackedType(::Type{T}, packeddata::GenericFunctionNodeData{PT}) where {T<:FactorOperationalMemory, PT}
318-
# usrtyp = convert(FunctorInferenceType, packeddata.fnc)
319-
# Also look at parentmodule
320-
usrtyp = convertStructType(PT)
321-
fulltype = DFG.FunctionNodeData{T{usrtyp}}
322-
factordata = convert(fulltype, packeddata)
323-
return factordata
318+
# usrtyp = convert(FunctorInferenceType, packeddata.fnc)
319+
# Also look at parentmodule
320+
usrtyp = convertStructType(PT)
321+
fulltype = DFG.FunctionNodeData{T{usrtyp}}
322+
factordata = convert(fulltype, packeddata)
323+
return factordata
324324
end
325325

326326

test/test_defVariable.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ struct NotAManifold end
2525

2626
@test getPointType(TestVarType1) == Vector{Float64}
2727
@test getPointType(TestVarType2) == ProductRepr{Tuple{Vector{Float64}, Matrix{Float64}}}
28+
29+
@test getPointIdentity(TestVarType1) == zeros(3)
30+
@test getPointIdentity(TestVarType2).parts[1] == ProductRepr(zeros(3), diagm(ones(3))).parts[1]
31+
@test getPointIdentity(TestVarType2).parts[2] == ProductRepr(zeros(3), diagm(ones(3))).parts[2]
32+
2833
##
2934

3035

@@ -37,4 +42,8 @@ struct NotAManifold end
3742
@test getPointType(TestVarType1()) == Vector{Float64}
3843
@test getPointType(TestVarType2()) == ProductRepr{Tuple{Vector{Float64}, Matrix{Float64}}}
3944

45+
@test getPointIdentity(TestVarType1()) == zeros(3)
46+
@test getPointIdentity(TestVarType2()).parts[1] == ProductRepr(zeros(3), diagm(ones(3))).parts[1]
47+
@test getPointIdentity(TestVarType2()).parts[2] == ProductRepr(zeros(3), diagm(ones(3))).parts[2]
48+
4049
end

0 commit comments

Comments
 (0)