Skip to content

Commit 1dd9930

Browse files
committed
Make SymbolDFG runnable; Tests - I'll take 29/61 as a win
1 parent e0a372c commit 1dd9930

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

src/DistributedFactorGraphs.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ include("FileDFG/FileDFG.jl")
4747
# Include the LightGraphs.jl (MetaGraphs.jl) API.
4848
include("LightGraphsDFG/LightGraphsDFG.jl")
4949

50+
include("SymbolDFG/SymbolDFG.jl")
51+
@reexport using .SymbolDFGs
52+
53+
5054
export saveDFG, loadDFG
5155

5256
function __init__()

src/SymbolDFG/SymbolDFG.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ module SymbolDFGs
33
using LightGraphs
44
using DocStringExtensions
55

6+
# import DFG functions to exstend
7+
import ...DistributedFactorGraphs: setSolverParams,
8+
getInnerGraph,
9+
getFactor,
10+
setDescription,
11+
getLabelDict,
12+
addVariable!,
13+
getVariable,
14+
getAddHistory,
15+
addFactor!,
16+
getSolverParams,
17+
exists,
18+
getDescription
19+
620
include("SymbolFactorGraphs/SymbolFactorGraphs.jl")
721
using .SymbolFactorGraphs
822

src/SymbolDFG/entities/SymbolDFG.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import ...DistributedFactorGraphs: AbstractDFG, DFGNode, AbstractParams, NoSolverParams
2+
import ...DistributedFactorGraphs: AbstractDFG, DFGNode, AbstractParams, NoSolverParams, DFGVariable, DFGFactor
33

44

55
mutable struct SymbolDFG{T <: AbstractParams, V <: DFGNode, F <:DFGNode} <: AbstractDFG
@@ -27,6 +27,8 @@ function SymbolDFG{T,V,F}(g::SymbolFactorGraph{V,F}=SymbolFactorGraph{V,F}();
2727
SymbolDFG{T,V,F}(g, description, userId, robotId, sessionId, Symbol[], params)
2828
end
2929

30+
SymbolDFG{T}(g::SymbolFactorGraph{DFGVariable,DFGFactor}=SymbolFactorGraph{DFGVariable,DFGFactor}(); kwargs...) where T <: AbstractParams = SymbolDFG{T,DFGVariable,DFGFactor}(g, kwargs...)
31+
3032
Base.propertynames(x::SymbolDFG, private::Bool=false) =
3133
(:g, :description, :userId, :robotId, :sessionId, :nodeCounter, :labelDict, :addHistory, :solverParams)
3234
# (private ? fieldnames(typeof(x)) : ())...)

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using DataFrames
33
using DistributedFactorGraphs
44

55
# Test each interface
6-
apis = [GraphsDFG, LightGraphsDFG]
6+
apis = [GraphsDFG, LightGraphsDFG, SymbolDFG]
77
# apis = [graphsDFG, cgDFG]
88
for api in apis
99
@testset "Testing Driver: $(api)" begin

0 commit comments

Comments
 (0)