Skip to content

Commit 5a89599

Browse files
committed
update for DFG v0.19
1 parent 5c818c3 commit 5a89599

File tree

2 files changed

+55
-39
lines changed

2 files changed

+55
-39
lines changed

src/services/FGOSUtils.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,23 @@ function calcPPE(
253253
Pme_ = getCoordinates(varType, Pme)
254254
# Pma_ = getCoordinates(M,Pme)
255255

256+
ppes = getPPEDict(var)
257+
id = if haskey(ppes, ppeKey)
258+
ppes[ppeKey].id
259+
else
260+
nothing
261+
end
262+
256263
# suggested, max, mean, current time
257264
# TODO, poor constructor argument assumptions on `ppeType`
258-
return ppeType(ppeKey, Pme_, Pma, Pme_, timestamp)
265+
return ppeType(;
266+
id,
267+
solveKey=ppeKey,
268+
suggested=Pme_,
269+
max=Pma,
270+
mean=Pme_,
271+
createdTimestamp=ZonedDateTime(timestamp, localzone())
272+
)
259273
end
260274

261275
# calcPPE(var::DFGVariable; method::Type{<:AbstractPointParametricEst}=MeanMaxPPE, solveKey::Symbol=:default) = calcPPE(var, getVariableType(var), method=method, solveKey=solveKey)

src/services/FactorGraph.jl

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -386,25 +386,26 @@ function DefaultNodeDataParametric(
386386
# gbw2, Symbol[], sp,
387387
# dims, false, :_null, Symbol[], variableType, true, 0.0, false, dontmargin)
388388
else
389-
sp = round.(Int, range(dodims; stop = dodims + dims - 1, length = dims))
389+
# dimIDs = round.(Int, range(dodims; stop = dodims + dims - 1, length = dims))
390390
ϵ = getPointIdentity(variableType)
391-
return VariableNodeData(
392-
[ϵ],
393-
zeros(dims, dims),
394-
Symbol[],
395-
sp,
391+
return VariableNodeData(;
392+
id=nothing,
393+
val=[ϵ],
394+
bw=zeros(dims, dims),
395+
# Symbol[],
396+
# dimIDs,
396397
dims,
397-
false,
398-
:_null,
399-
Symbol[],
398+
# false,
399+
# :_null,
400+
# Symbol[],
400401
variableType,
401-
false,
402-
zeros(dims),
403-
false,
402+
initialized=false,
403+
infoPerCoord=zeros(dims),
404+
ismargin=false,
404405
dontmargin,
405-
0,
406-
0,
407-
:parametric,
406+
# 0,
407+
# 0,
408+
solveKey,
408409
)
409410
end
410411
end
@@ -440,7 +441,7 @@ function setDefaultNodeData!(
440441
v::DFGVariable,
441442
dodims::Int,
442443
N::Int,
443-
dims::Int;
444+
dims::Int=getDimension(v);
444445
solveKey::Symbol = :default,
445446
gt = Dict(),
446447
initialized::Bool = true,
@@ -453,42 +454,43 @@ function setDefaultNodeData!(
453454
data = nothing
454455
isinit = false
455456
sp = Int[0;]
456-
(valpts, bws) = if initialized
457+
(val, bw) = if initialized
457458
pN = resample(getBelief(v))
458-
bws = getBW(pN)[:, 1:1]
459+
bw = getBW(pN)[:, 1:1]
459460
pNpts = getPoints(pN)
460461
isinit = true
461-
(pNpts, bws)
462+
(pNpts, bw)
462463
else
463464
sp = round.(Int, range(dodims; stop = dodims + dims - 1, length = dims))
464465
@assert getPointType(varType) != DataType "cannot add manifold point type $(getPointType(varType)), make sure the identity element argument in @defVariable $varType arguments is correct"
465-
valpts = Vector{getPointType(varType)}(undef, N)
466-
for i = 1:length(valpts)
467-
valpts[i] = getPointIdentity(varType)
466+
val = Vector{getPointType(varType)}(undef, N)
467+
for i = 1:length(val)
468+
val[i] = getPointIdentity(varType)
468469
end
469-
bws = zeros(dims, 1)
470+
bw = zeros(dims, 1)
470471
#
471-
(valpts, bws)
472+
(val, bw)
472473
end
473474
# make and set the new solverData
474475
setSolverData!(
475476
v,
476-
VariableNodeData(
477-
valpts,
478-
bws,
479-
Symbol[],
480-
sp,
477+
VariableNodeData(;
478+
id=nothing,
479+
val,
480+
bw,
481+
# Symbol[],
482+
# sp,
481483
dims,
482-
false,
483-
:_null,
484-
Symbol[],
485-
varType,
486-
isinit,
487-
zeros(getDimension(v)),
488-
false,
484+
# false,
485+
# :_null,
486+
# Symbol[],
487+
variableType=varType,
488+
initialized=isinit,
489+
infoPerCoord=zeros(getDimension(v)),
490+
ismargin=false,
489491
dontmargin,
490-
0,
491-
0,
492+
# 0,
493+
# 0,
492494
solveKey,
493495
),
494496
solveKey,

0 commit comments

Comments
 (0)