Skip to content

Commit dddf617

Browse files
committed
Updating docs for #169
1 parent 974b3d4 commit dddf617

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

src/FileDFG/services/FileDFG.jl

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11

22
"""
3-
@(SIGNATURES)
3+
$(SIGNATURES)
44
Save a DFG to a folder. Will create/overwrite folder if it exists.
5+
6+
# Example
7+
```julia
8+
using DistributedFactorGraphs, IncrementalInference
9+
# Create a DFG - can make one directly, e.g. GraphsDFG{NoSolverParams}() or use IIF:
10+
dfg = initfg()
11+
# ... Add stuff to graph using either IIF or DFG:
12+
v1 = addVariable!(dfg, :a, ContinuousScalar, labels = [:POSE], solvable=0)
13+
# Now save it:
14+
saveDFG(dfg, "/tmp/saveDFG")
15+
```
516
"""
617
function saveDFG(dfg::G, folder::String) where G <: AbstractDFG
718
variables = getVariables(dfg)
@@ -35,17 +46,20 @@ function saveDFG(dfg::G, folder::String) where G <: AbstractDFG
3546
end
3647

3748
"""
38-
@(SIGNATURES)
39-
Load a DFG from a saved folder. You will need to provide the IIFModule as the second
49+
$(SIGNATURES)
50+
Load a DFG from a saved folder. Always provide the IIF module as the second
4051
parameter.
4152
42-
Example:
53+
# Example
54+
```julia
4355
using DistributedFactorGraphs, IncrementalInference
4456
# Create a DFG - can make one directly, e.g. GraphsDFG{NoSolverParams}() or use IIF:
4557
dfg = initfg()
4658
# Load the graph
4759
loadDFG("/tmp/savedgraph", IncrementalInference, dfg)
48-
# Use it as normal.
60+
# Use the DFG as you do normally.
61+
ls(dfg)
62+
```
4963
"""
5064
function loadDFG(folder::String, iifModule, dfgLoadInto::G) where G <: AbstractDFG
5165
variables = DFGVariable[]

0 commit comments

Comments
 (0)