Skip to content

Commit 514e3ce

Browse files
committed
Merge branch 'master' of https://github.com/JuliaRobotics/DistributedFactorGraphs.jl into 4Q19/feature/needsahome
2 parents 8ff0c97 + 30de896 commit 514e3ce

File tree

5 files changed

+30
-31
lines changed

5 files changed

+30
-31
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2121
[compat]
2222
Colors = "0.8, 0.9, 0.10, 0.11"
2323
Distributions = "0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 1"
24-
DocStringExtensions = "0.8, 0.9, 0.10, 1"
24+
DocStringExtensions = "0.7, 0.8, 0.9, 0.10, 1"
2525
GraphPlot = "0.3.1, 0.4"
2626
Graphs = "0.10.2, 0.11, 1"
2727
JSON2 = "0.3.1"

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# DistributedFactorGraphs.jl
22

3-
[![Build Status](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=master)](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl)
4-
[![Codecov Status](https://codecov.io/gh/JuliaRobotics/DistributedFactorGraphs.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaRobotics/DistributedFactorGraphs.jl)
5-
[![Coverage Status](https://img.shields.io/coveralls/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://coveralls.io/r/JuliaRobotics/DistributedFactorGraphs.jl?branch=master)
6-
[![docs](https://img.shields.io/badge/docs-latest-blue.svg)](http://juliarobotics.github.io/DistributedFactorGraphs.jl/latest/)
3+
Release | Dev | Coverage | Docs
4+
---------|-----|----------|------
5+
[![Build Status](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.5)](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl) | [![Build Status](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=master)](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl) | [![Codecov Status](https://codecov.io/gh/JuliaRobotics/DistributedFactorGraphs.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaRobotics/DistributedFactorGraphs.jl) [![Coverage Status](https://img.shields.io/coveralls/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://coveralls.io/r/JuliaRobotics/DistributedFactorGraphs.jl?branch=master) | [![docs](https://img.shields.io/badge/docs-latest-blue.svg)](http://juliarobotics.github.io/DistributedFactorGraphs.jl/latest/)
76

87
DistributedFactorGraphs.jl provides a flexible factor graph API for use in the [Caesar.jl](https://github.com/JuliaRobotics/Caesar.jl) ecosystem. The package supplies:
98
* A standardized API for interacting with factor graphs

test/CGStructureTests.jl

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
dfg = CloudGraphsDFG{NoSolverParams}("localhost", 7474, "neo4j", "test",
1+
dfg = CloudGraphsDFG{SolverParams}("localhost", 7474, "neo4j", "test",
22
"testUser", "testRobot", "testSession",
33
nothing,
44
nothing,
55
IncrementalInference.decodePackedType,
66
IncrementalInference.rebuildFactorMetadata!,
7-
solverParams=NoSolverParams())
7+
solverParams=SolverParams())
88

99
# Nuke the user
1010
clearUser!!(dfg)
@@ -61,37 +61,15 @@ setSessionData(dfg, session.data)
6161
v1 = addVariable!(dfg, :a, ContinuousScalar, labels = [:POSE])
6262
v2 = addVariable!(dfg, :b, ContinuousScalar, labels = [:POSE])
6363
v3 = addVariable!(dfg, :c, ContinuousScalar, labels = [:LANDMARK])
64+
addFactor!(dfg, [:a], Prior(Normal(0,1)))
6465
f1 = addFactor!(dfg, [:a; :b], LinearConditional(Normal(50.0,2.0)) )
6566
f2 = addFactor!(dfg, [:b; :c], LinearConditional(Normal(50.0,2.0)) )
6667

6768
sessions = lsSessions(dfg)
6869
@test map(s -> s.id, sessions) == [session.id]
6970

70-
# Pull and solve this graph
7171
dfgLocal = GraphsDFG{SolverParams}(params=SolverParams())
7272
DistributedFactorGraphs.getSubgraph(dfg, union(ls(dfg), lsf(dfg)), true, dfgLocal)
73-
7473
# Confirm that with sentinels we still have the same graph (doesn't pull in the sentinels)
7574
@test symdiff(ls(dfgLocal), ls(dfg)) == []
7675
@test symdiff(lsf(dfgLocal), lsf(dfg)) == []
77-
78-
# Solve it
79-
tree, smtasks = solveTree!(dfgLocal)
80-
81-
82-
# Make sure we can copy and solve normal orphaned sessions.
83-
dfgOrphaned = deepcopy(dfg)
84-
dfgOrphaned.sessionId = "doesntexist"
85-
# Don't create a session
86-
# Add some nodes.
87-
v1 = addVariable!(dfgOrphaned, :a, ContinuousScalar, labels = [:POSE])
88-
v2 = addVariable!(dfgOrphaned, :b, ContinuousScalar, labels = [:POSE])
89-
v3 = addVariable!(dfgOrphaned, :c, ContinuousScalar, labels = [:LANDMARK])
90-
f1 = addFactor!(dfgOrphaned, [:a; :b], LinearConditional(Normal(50.0,2.0)) )
91-
f2 = addFactor!(dfgOrphaned, [:b; :c], LinearConditional(Normal(50.0,2.0)) )
92-
# Solve it
93-
dfgLocal = GraphsDFG{SolverParams}(params=SolverParams())
94-
DistributedFactorGraphs.getSubgraph(dfgOrphaned, union(ls(dfgOrphaned), lsf(dfgOrphaned)), true, dfgLocal)
95-
tree, smtasks = solveTree!(dfgLocal)
96-
97-
# If this passes without errors and we solve the graph, then all good.

test/runtests.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ end
6161

6262
if get(ENV, "IIF_TEST", "") == "true"
6363

64-
Pkg.add("IncrementalInference")
6564
# Switch to our upstream test branch.
6665
Pkg.add(PackageSpec(name="IncrementalInference", rev="upstream/dfg_integration_test"))
6766
@info "------------------------------------------------------------------------"
@@ -100,6 +99,19 @@ if get(ENV, "IIF_TEST", "") == "true"
10099
# Run the CGStructure tests
101100
include("CGStructureTests.jl")
102101
end
102+
103+
# Simple graph solving test
104+
@testset "Simple graph solving test" begin
105+
# This is just to validate we're not going to blow up downstream.
106+
apis = [
107+
GraphsDFG{SolverParams}(params=SolverParams()),
108+
LightDFG{SolverParams}(params=SolverParams())]
109+
for api in apis
110+
@info "Running simple solver test: $(typeof(api))"
111+
global dfg = deepcopy(api)
112+
include("solveTest.jl")
113+
end
114+
end
103115
else
104116
@warn "Skipping IncrementalInference driver tests"
105117
end

test/solveTest.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Add some nodes.
2+
v1 = addVariable!(dfg, :a, ContinuousScalar, labels = [:POSE])
3+
addFactor!(dfg, [:a], Prior(Normal(0,1)))
4+
v2 = addVariable!(dfg, :b, ContinuousScalar, labels = [:POSE])
5+
v3 = addVariable!(dfg, :c, ContinuousScalar, labels = [:LANDMARK])
6+
f1 = addFactor!(dfg, [:a; :b], LinearConditional(Normal(50.0,2.0)) )
7+
f2 = addFactor!(dfg, [:b; :c], LinearConditional(Normal(50.0,2.0)) )
8+
9+
# Solve it
10+
tree, smtasks = solveTree!(dfg)

0 commit comments

Comments
 (0)