Skip to content

Commit 222dec3

Browse files
committed
cleanup and fixes
1 parent 66ea504 commit 222dec3

File tree

4 files changed

+45
-20
lines changed

4 files changed

+45
-20
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ManifoldsBase = "0.11"
3535
Neo4j = "2"
3636
Pkg = "1.4, 1.5"
3737
Reexport = "0.2, 0.3, 0.4, 0.5, 1"
38-
Requires = "0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 1"
38+
Requires = "0.5, 1"
3939
TensorCast = "0.3.3, 0.4"
4040
TimeZones = "1.3.1"
4141
Unmarshal = "0.4"

src/services/CompareUtils.jl

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,19 @@ function compareFactor(A::DFGFactor,
239239
TP = compareAll(A, B, skip=union([:attributes;:solverData;:_variableOrderSymbols],skip), show=show)
240240
# TP = TP & compareAll(A.attributes, B.attributes, skip=[:data;], show=show)
241241
TP = TP & compareAllSpecial(getSolverData(A), getSolverData(B), skip=union([:fnc], skip), show=show)
242+
if :fnc in skip
243+
return TP
244+
end
242245
TP = TP & compareAllSpecial(getSolverData(A).fnc, getSolverData(B).fnc, skip=union([:cpt;:measurement;:params;:varidx;:threadmodel], skip), show=show)
246+
if !(:measurement in skip)
243247
TP = TP & (skipsamples || compareAll(getSolverData(A).fnc.measurement, getSolverData(B).fnc.measurement, show=show, skip=skip))
244-
TP = TP & (skipcompute || compareAll(getSolverData(A).fnc.params, getSolverData(B).fnc.params, show=show, skip=skip))
245-
TP = TP & (skipcompute || compareAll(getSolverData(A).fnc.varidx, getSolverData(B).fnc.varidx, show=show, skip=skip))
248+
end
249+
if !(:params in skip)
250+
TP = TP & (skipcompute || compareAll(getSolverData(A).fnc.params, getSolverData(B).fnc.params, show=show, skip=skip))
251+
end
252+
if !(:varidx in skip)
253+
TP = TP & (skipcompute || compareAll(getSolverData(A).fnc.varidx, getSolverData(B).fnc.varidx, show=show, skip=skip))
254+
end
246255

247256
return TP
248257
end
@@ -339,11 +348,12 @@ Related:
339348
340349
`compareFactorGraphs`, `compareSimilarVariables`, `compareAllVariables`, `ls`.
341350
"""
342-
function compareSimilarFactors(fgA::G1,
343-
fgB::G2;
344-
skipsamples::Bool=true,
345-
skipcompute::Bool=true,
346-
show::Bool=true )::Bool where {G1 <: AbstractDFG, G2 <: AbstractDFG}
351+
function compareSimilarFactors( fgA::G1,
352+
fgB::G2;
353+
skipsamples::Bool=true,
354+
skipcompute::Bool=true,
355+
skip::AbstractVector{Symbol}=Symbol[],
356+
show::Bool=true ) where {G1 <: AbstractDFG, G2 <: AbstractDFG}
347357
#
348358
xlA = listFactors(fgA)
349359
xlB = listFactors(fgB)
@@ -354,7 +364,8 @@ function compareSimilarFactors(fgA::G1,
354364

355365
# compare the common set
356366
for var in xlAB
357-
TP = TP && compareFactor(getFactor(fgA, var), getFactor(fgB, var), skipsamples=skipsamples, skipcompute=skipcompute, show=show)
367+
TP = TP && compareFactor( getFactor(fgA, var), getFactor(fgB, var),
368+
skipsamples=skipsamples, skipcompute=skipcompute, skip=skip, show=show)
358369
end
359370

360371
# return comparison result
@@ -376,12 +387,12 @@ Related:
376387
377388
`compareSimilarVariables`, `compareSimilarFactors`, `compareAllVariables`, `ls`.
378389
"""
379-
function compareFactorGraphs(fgA::G1,
380-
fgB::G2;
381-
skipsamples::Bool=true,
382-
skipcompute::Bool=true,
383-
skip::Vector{Symbol}=Symbol[],
384-
show::Bool=true )::Bool where {G1 <: AbstractDFG, G2 <: AbstractDFG}
390+
function compareFactorGraphs( fgA::G1,
391+
fgB::G2;
392+
skipsamples::Bool=true,
393+
skipcompute::Bool=true,
394+
skip::Vector{Symbol}=Symbol[],
395+
show::Bool=true ) where {G1 <: AbstractDFG, G2 <: AbstractDFG}
385396
#
386397
skiplist = Symbol[:g;:bn;:IDs;:fIDs;:id;:nodeIDs;:factorIDs;:fifo;:solverParams; :factorOperationalMemoryType]
387398
skiplist = union(skiplist, skip)

src/services/DFGVariable.jl

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ getLastUpdatedTimestamp(est::AbstractPointParametricEst) = est.lastUpdatedTimest
3838
3939
Variable nodes `variableType` information holding a variety of meta data associated with the type of variable stored in that node of the factor graph.
4040
41+
Notes
42+
- API Quirk in that this function returns and instance of `::T` not a `::Type{<:InferenceVariable}`.
43+
4144
DevWork
4245
- TODO, see IncrementalInference.jl 1228
4346
@@ -134,6 +137,9 @@ getPointType(::T) where {T <: InferenceVariable} = getPointType(T)
134137
"""
135138
$SIGNATURES
136139
Interface function to return the user provided identity point for this InferenceVariable manifold, extend this function for all Types<:InferenceVariable.
140+
141+
Notes
142+
- Used in transition period for Serialization. This function will likely be changed or deprecated entirely.
137143
"""
138144
function getPointIdentity end
139145
getPointIdentity(::T) where {T <: InferenceVariable} = getPointIdentity(T)
@@ -145,31 +151,39 @@ getPointIdentity(::T) where {T <: InferenceVariable} = getPointIdentity(T)
145151
Default escalzation from coordinates to a group representation point. Override if defaults are not correct.
146152
E.g. coords -> se(2) -> SE(2).
147153
154+
DevNotes
155+
- TODO Likely remove as part of serialization updates, see #590
156+
- Used in transition period for Serialization. This function will likely be changed or deprecated entirely.
157+
148158
Related
149159
150160
[`getCoordinates`](@ref)
151161
"""
152162
function getPoint(::Type{T}, v::AbstractVector) where {T <: InferenceVariable}
153163
M = getManifold(T)
154164
p0 = getPointIdentity(T)
155-
X = get_vector(M, p0, v, DefaultOrthonormalBasis())
156-
exp(M, p0, X)
165+
X = ManifoldsBase.get_vector(M, p0, v, ManifoldsBase.DefaultOrthonormalBasis())
166+
ManifoldsBase.exp(M, p0, X)
157167
end
158168

159169
"""
160170
$SIGNATURES
161171
162172
Default reduction of a variable point value (a group element) into coordinates as `Vector`. Override if defaults are not correct.
163173
174+
DevNotes
175+
- TODO Likely remove as part of serialization updates, see #590
176+
- Used in transition period for Serialization. This function will likely be changed or deprecated entirely.
177+
164178
Related
165179
166180
[`getPoint`](@ref)
167181
"""
168182
function getCoordinates(::Type{T}, p) where {T <: InferenceVariable}
169183
M = getManifold(T)
170184
p0 = getPointIdentity(T)
171-
X = log(M, p0, p)
172-
get_coordinates(M, p0, X, DefaultOrthonormalBasis())
185+
X = ManifoldsBase.log(M, p0, p)
186+
ManifoldsBase.get_coordinates(M, p0, X, ManifoldsBase.DefaultOrthonormalBasis())
173187
end
174188

175189

src/services/Serialization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ function unpackVariableNodeData(dfg::G, d::PackedVariableNodeData) where G <: Ab
252252
@cast val_[j][i] := M3[i,j]
253253
vals = Vector{getPointType(T)}(undef, length(val_))
254254
# vals = getPoint.(T, val_)
255-
for v in val_
255+
for (i,v) in enumerate(val_)
256256
vals[i] = getPoint(T, v)
257257
end
258258

0 commit comments

Comments
 (0)