Skip to content

Commit 41ee177

Browse files
authored
Merge pull request #751 from JuliaRobotics/master
v0.13.1-rc1
2 parents 5005b82 + b9fc5a1 commit 41ee177

File tree

3 files changed

+34
-17
lines changed

3 files changed

+34
-17
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.13.0"
3+
version = "0.13.1"
44

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

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
Click on badges to follow links:
44

5-
Release v0.11 | Release v0.12 | Dev | Coverage | Documentation |
5+
Release v0.12 | Release v0.13 | Dev | Coverage | Documentation |
66
---------|---------|-----|------------|------------|
7-
[![Build Status][dfg-build-v0.11]][dfg-build-url] | [![Build Status][dfg-build-v0.12]][dfg-build-url] | [![Build Status][dfg-build-img]][dfg-build-url] <br> [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![codecov.io][dfg-cov-img]][dfg-cov-url] <br> [![Percentage of issues still open](https://isitmaintained.com/badge/open/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![docs](https://img.shields.io/badge/DFGDocs-latest-blue.svg)](http://juliarobotics.github.io/DistributedFactorGraphs.jl/latest/) <br> [![docs](https://img.shields.io/badge/CaesarDocs-latest-blue.svg)](http://juliarobotics.github.io/Caesar.jl/latest/)
7+
[![Build Status][dfg-build-v0.12]][dfg-build-url] | [![Build Status][dfg-build-v0.13]][dfg-build-url] | [![Build Status][dfg-build-img]][dfg-build-url] <br> [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![codecov.io][dfg-cov-img]][dfg-cov-url] <br> [![Percentage of issues still open](https://isitmaintained.com/badge/open/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![docs](https://img.shields.io/badge/DFGDocs-latest-blue.svg)](http://juliarobotics.github.io/DistributedFactorGraphs.jl/latest/) <br> [![docs](https://img.shields.io/badge/CaesarDocs-latest-blue.svg)](http://juliarobotics.github.io/Caesar.jl/latest/)
88

99

10-
[dfg-build-v0.11]: https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.11
10+
[dfg-build-v0.13]: https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.13
1111
[dfg-build-v0.12]: https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.12
1212

1313
[dfg-cov-img]: https://codecov.io/github/JuliaRobotics/DistributedFactorGraphs.jl/coverage.svg?branch=master

src/services/DFGVariable.jl

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,23 @@ 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+
DevWork
42+
- TODO, see IncrementalInference.jl 1228
43+
4144
Related
4245
4346
getVariableType
4447
"""
48+
getVariableType(v::DFGVariable{T}) where T <: InferenceVariable = T()
49+
4550
function getVariableType(vnd::VariableNodeData)
51+
# @warn "getVariableType(::VariableNodeData) is being deprecated, use getVariableType(::DFGVariable) instead."
4652
return vnd.variableType
4753
end
4854

4955

5056
# TODO: Confirm that we can switch this out, instead of retrieving the complete variable.
51-
# getVariableType(v::DFGVariable{T}) where T <: InferenceVariable = T()
52-
getVariableType(v::DFGVariable) = getVariableType(getSolverData(v))
57+
# getVariableType(v::DFGVariable) = getVariableType(getSolverData(v))
5358

5459
# Optimized in CGDFG
5560
getVariableType(dfg::AbstractDFG, lbl::Symbol) = getVariableType(getVariable(dfg,lbl))
@@ -326,7 +331,10 @@ end
326331
$SIGNATURES
327332
Set solver data structure stored in a variable.
328333
"""
329-
setSolverData!(v::DFGVariable, data::VariableNodeData, key::Symbol=:default) = v.solverDataDict[key] = data
334+
function setSolverData!(v::DFGVariable, data::VariableNodeData, key::Symbol=:default)
335+
@assert key == data.solveKey "VariableNodeData.solveKey=:$(data.solveKey) does not match requested :$(key)"
336+
v.solverDataDict[key] = data
337+
end
330338

331339
##------------------------------------------------------------------------------
332340
## smallData
@@ -520,7 +528,9 @@ function updateVariableSolverData!(dfg::AbstractDFG,
520528
# for InMemoryDFGTypes do memory copy or repointing, for cloud this would be an different kind of update.
521529
usevnd = useCopy ? deepcopy(vnd) : vnd
522530
# should just one, or many pointers be updated?
523-
if haskey(var.solverDataDict, vnd.solveKey) && isa(var.solverDataDict[vnd.solveKey], VariableNodeData) && length(fields) != 0
531+
useExisting = haskey(var.solverDataDict, vnd.solveKey) && isa(var.solverDataDict[vnd.solveKey], VariableNodeData) && length(fields) != 0
532+
# @error useExisting vnd.solveKey
533+
if useExisting
524534
# change multiple pointers inside the VND var.solverDataDict[solvekey]
525535
for field in fields
526536
destField = getfield(var.solverDataDict[vnd.solveKey], field)
@@ -561,13 +571,20 @@ function updateVariableSolverData!(dfg::AbstractDFG,
561571
end
562572

563573

564-
updateVariableSolverData!(dfg::AbstractDFG,
565-
sourceVariable::DFGVariable,
566-
solveKey::Symbol=:default,
567-
useCopy::Bool=true,
568-
fields::Vector{Symbol}=Symbol[];
569-
warn_if_absent::Bool=true ) =
570-
updateVariableSolverData!(dfg, sourceVariable.label, getSolverData(sourceVariable, solveKey), useCopy, fields; warn_if_absent=warn_if_absent)
574+
function updateVariableSolverData!( dfg::AbstractDFG,
575+
sourceVariable::DFGVariable,
576+
solveKey::Symbol=:default,
577+
useCopy::Bool=true,
578+
fields::Vector{Symbol}=Symbol[];
579+
warn_if_absent::Bool=true )
580+
#
581+
vnd = getSolverData(sourceVariable, solveKey)
582+
# toshow = listSolveKeys(sourceVariable) |> collect
583+
# @info "update DFGVar solveKey" solveKey vnd.solveKey
584+
# @show toshow
585+
@assert solveKey == vnd.solveKey "VariableNodeData's solveKey=:$(vnd.solveKey) does not match requested :$solveKey"
586+
updateVariableSolverData!(dfg, sourceVariable.label, vnd, useCopy, fields; warn_if_absent=warn_if_absent)
587+
end
571588

572589
function updateVariableSolverData!(dfg::AbstractDFG,
573590
sourceVariables::Vector{<:DFGVariable},
@@ -674,13 +691,13 @@ function getPPE(dfg::AbstractDFG, variablekey::Symbol, ppekey::Symbol=:default)
674691
end
675692

676693
# Not the most efficient call but it at least reuses above (in memory it's probably ok)
677-
getPPE(dfg::AbstractDFG, sourceVariable::VariableDataLevel1, ppekey::Symbol=default)::AbstractPointParametricEst = getPPE(dfg, sourceVariable.label, ppekey)
694+
getPPE(dfg::AbstractDFG, sourceVariable::VariableDataLevel1, ppekey::Symbol=:default) = getPPE(dfg, sourceVariable.label, ppekey)
678695

679696
"""
680697
$(SIGNATURES)
681698
Add variable PPE, errors if it already exists.
682699
"""
683-
function addPPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::P)::AbstractPointParametricEst where {P <: AbstractPointParametricEst}
700+
function addPPE!(dfg::AbstractDFG, variablekey::Symbol, ppe::P) where {P <: AbstractPointParametricEst}
684701
var = getVariable(dfg, variablekey)
685702
if haskey(var.ppeDict, ppe.solveKey)
686703
error("PPE '$(ppe.solveKey)' already exists")

0 commit comments

Comments
 (0)