Skip to content

Commit c7ed803

Browse files
committed
Updating README
1 parent 0b182a2 commit c7ed803

File tree

1 file changed

+52
-3
lines changed

1 file changed

+52
-3
lines changed

README.md

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,58 @@ DistributedFactorGraphs.jl provides a flexible factor graph API for use in the [
1515
Please see the [documentation](http://juliarobotics.github.io/DistributedFactorGraphs.jl/latest/) and the [unit tests](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/tree/master/test) for examples on using DistributedFactorGraphs.jl.
1616

1717
# Installation
18-
DistributedFactorGraphs.jl has not been registered yet, and should be installed by cloning this repository:
18+
DistributedFactorGraphs can be installed from Julia packages using:
19+
```
20+
add DistributedFactorGraphs
21+
```
22+
23+
# Usage
24+
DistributedFactorGraphs (DFG) currently supports two implementations:
25+
* An in-memory factor graph based on Graphs.jl
26+
* A Neo4j-based factor graph based on Neo4j.jl
27+
28+
The in-memory implementation is the default. The Neo4j driver can be enabled by importing Neo4j before DFG:
29+
30+
```
31+
# To enable the Neo4j driver, import Neo4j.jl first
32+
using Neo4j
33+
using DistributedFactorGraphs
34+
```
35+
36+
Both drivers support the same functions, so choose which you want to use when creating your initial DFG. For example:
37+
38+
```
39+
# In-memory DFG
40+
dfg = GraphsDFG{NoSolverParams}()
41+
addVariable!(dfg, DFGVariable(:a))
42+
addVariable!(dfg, DFGVariable(:b))
43+
addFactor!(dfg, [v1, v2], DFGFactor{Int, :Symbol}(:f1)) # Rather use a RoME-type factor here (e.g. Pose2Pose2) rather than an Int, this is just for demonstrative purposes.
44+
```
45+
46+
```
47+
# Neo4j-based DFG
48+
dfg = CloudGraphsDFG{NoSolverParams}("localhost", 7474, "neo4j", "test",
49+
"testUser", "testRobot", "testSession",
50+
nothing,
51+
nothing,
52+
IncrementalInference.decodePackedType)
53+
addVariable!(dfg, DFGVariable(:a))
54+
addVariable!(dfg, DFGVariable(:b))
55+
addFactor!(dfg, [v1, v2], DFGFactor{Int, :Symbol}(:f1)) # Rather use a RoME-type factor here (e.g. Pose2Pose2) rather than an Int, this is just for demonstrative purposes.
56+
```
57+
58+
Please see the documentation for more information on interacting with the factor graph.
1959

20-
```julia
21-
Pkg.clone("https://github.com/JuliaRobotics/DistributedFactorGraphs.jl.git")
60+
## Setting up a Quick Neo4j Database
61+
The simplest way to set up a test database is with Docker.
62+
63+
To pull the Neo4j image:
64+
```
65+
docker pull neo4j
2266
```
2367

68+
To run the image with user `neo4j` and password `test`:
69+
70+
```
71+
docker run --publish=7474:7474 --publish=7687:7687 --env NEO4J_AUTH=neo4j/test neo4j
72+
```

0 commit comments

Comments
 (0)