Skip to content

Commit 116967a

Browse files
committed
Merge branch 'master' of https://github.com/JuliaRobotics/DistributedFactorGraphs.jl.git into feature/IIFTests
2 parents 65ddd9d + bca01e6 commit 116967a

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

src/GraphsDFG/services/GraphsDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function attributes(v::GraphsNode, g::T)::AttributeDict where T <:GenericInciden
77
AttributeDict(
88
"label" => v.dfgNode.label,
99
"color" => v.dfgNode isa DFGVariable ? "red" : "blue",
10-
"shape" => v.dfgNode isa DFGVariable ? "box" : "ellipse",
10+
"shape" => v.dfgNode isa DFGVariable ? "ellipse" : "box",
1111
"fillcolor" => v.dfgNode isa DFGVariable ? "red" : "blue"
1212
)
1313
end

src/entities/DFGVariable.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ mutable struct VariableNodeData
1515
inferdim::Float64
1616
ismargin::Bool
1717
dontmargin::Bool
18+
# Tonio surprise TODO
19+
# frontalonly::Bool
1820
# A valid, packable default constructor is needed.
1921
VariableNodeData() = new(zeros(1,1), zeros(1,1), Symbol[], Int[], 0, false, :NOTHING, Symbol[], "", false, false, false, false)
2022
VariableNodeData(x1::Array{Float64,2},

src/services/AbstractDFG.jl

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -472,22 +472,12 @@ Notes:
472472
- used by both factor graph variable and Bayes tree clique logic.
473473
"""
474474
function isInitialized(var::DFGVariable; key::Symbol=:default)::Bool
475-
data = solverData(var, key)
476-
if data == nothing
477-
@error "Variable does not have solver data $(key)"
478-
return false
479-
else
480-
return solverData(var, key).initialized
481-
end
475+
solverData(var, key) != nothing && return solverData(var, key).initialized
476+
return false
482477
end
483478
function isInitialized(fct::DFGFactor; key::Symbol=:default)::Bool
484-
data = solverData(var, key)
485-
if data == nothing
486-
@error "Factor does not have solver data $(key)"
487-
return false
488-
else
489-
return solverData(fct, key).initialized
490-
end
479+
solverData(var, key) != nothing && return solverData(fct, key).initialized
480+
return false
491481
end
492482
function isInitialized(dfg::G, label::Symbol; key::Symbol=:default)::Bool where G <: AbstractDFG
493483
return isInitialized(getVariable(dfg, label), key=key)

test/interfaceTests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ end
301301
addVariable!(dotdfg, v2)
302302
addFactor!(dotdfg, [v1, v2], f1)
303303

304-
@test toDot(dotdfg) == "graph graphname {\n2 [\"label\"=\"b\",\"shape\"=\"box\",\"fillcolor\"=\"red\",\"color\"=\"red\"]\n2 -- 3\n3 [\"label\"=\"f1\",\"shape\"=\"ellipse\",\"fillcolor\"=\"blue\",\"color\"=\"blue\"]\n1 [\"label\"=\"a\",\"shape\"=\"box\",\"fillcolor\"=\"red\",\"color\"=\"red\"]\n1 -- 3\n}\n"
304+
@test toDot(dotdfg) == "graph graphname {\n2 [\"label\"=\"b\",\"shape\"=\"ellipse\",\"fillcolor\"=\"red\",\"color\"=\"red\"]\n2 -- 3\n3 [\"label\"=\"f1\",\"shape\"=\"box\",\"fillcolor\"=\"blue\",\"color\"=\"blue\"]\n1 [\"label\"=\"a\",\"shape\"=\"ellipse\",\"fillcolor\"=\"red\",\"color\"=\"red\"]\n1 -- 3\n}\n"
305305
@test toDotFile(dotdfg, "something.dot") == nothing
306306
Base.rm("something.dot")
307307

0 commit comments

Comments
 (0)