Skip to content

Commit e19587c

Browse files
authored
Merge pull request #638 from JuliaRobotics/master
v0.10.1-rc1
2 parents 6a5a9ab + e30c7ed commit e19587c

File tree

6 files changed

+68
-36
lines changed

6 files changed

+68
-36
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ branches:
2222
- master
2323
- develop
2424
- /^release.*$/
25+
- /^v\d+\.\d+(\.\d+)?([-+]\S*)?$/
2526

2627
jobs:
2728
include:
2829
- julia: 1.4
2930
env:
3031
- IIF_TEST=true
31-
if: NOT branch =~ ^release.*$
32+
if: NOT branch =~ /(^v\d+\.\d+(\.\d+)?([-+]\S*)?$)|(^release.*$)/
3233
- arch: arm64
3334
env: SKIP_CGDFG_TESTS=true
3435
before_script:

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DistributedFactorGraphs"
22
uuid = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
3-
version = "0.10.0"
3+
version = "0.10.1"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

README.md

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

3-
Release v0.8 | Release v0.9 | Dev | Coverage | DFG Docs | Caesar Docs |
3+
Release v0.9 | Release v0.10 | Dev | Coverage | DFG Docs | Caesar Docs |
44
---------|---------|-----|----------|------|------------
5-
[![Build Status](https://api.travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.8)](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl) | [![Build Status](https://api.travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.9)](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl) | [![Build Status](https://api.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) | [![docs](https://img.shields.io/badge/docs-latest-blue.svg)](http://juliarobotics.github.io/DistributedFactorGraphs.jl/latest/) | [![docs](https://img.shields.io/badge/docs-latest-blue.svg)](http://juliarobotics.github.io/Caesar.jl/latest/)
5+
[![Build Status](https://api.travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.9)](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl) | [![Build Status](https://api.travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.10)](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl) | [![Build Status](https://api.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) | [![docs](https://img.shields.io/badge/docs-latest-blue.svg)](http://juliarobotics.github.io/DistributedFactorGraphs.jl/latest/) | [![docs](https://img.shields.io/badge/docs-latest-blue.svg)](http://juliarobotics.github.io/Caesar.jl/latest/)
66

77
DistributedFactorGraphs.jl provides a flexible factor graph API for use in the [Caesar.jl](https://github.com/JuliaRobotics/Caesar.jl) ecosystem. The package supplies:
88
* A standardized API for interacting with factor graphs
@@ -24,17 +24,22 @@ add DistributedFactorGraphs
2424

2525
The in-memory implementation is the default, using LightGraphs.jl.
2626

27+
It is recommended to use `IncrementalInference` to create factor graphs as they will be solvable.
2728
```julia
2829
using DistributedFactorGraphs
30+
using IncrementalInference
2931
```
3032

3133
Both drivers support the same functions, so choose which you want to use when creating your initial DFG. For example:
3234

3335
```julia
3436
# In-memory DFG
35-
dfg = LightDFG{NoSolverParams}()
36-
addVariable!(dfg, DFGVariable(:a))
37-
addVariable!(dfg, DFGVariable(:b))
38-
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.
37+
# Initialize the default in-memory factor graph with default solver parameters.
38+
dfg = initfg()
39+
# add 2 ContinuousScalar variable types to the new factor graph
40+
addVariable!(dfg, :a, ContinuousScalar)
41+
addVariable!(dfg, :b, ContinuousScalar)
42+
# add a LinearConditional factor
43+
addFactor!(dfg, [:a, :b], LinearConditional(Normal(10.0,1.0)))
3944
```
4045

src/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -418,24 +418,25 @@ function listFactors(dfg::CloudGraphsDFG, regexFilter::Union{Nothing, Regex}=not
418418
end
419419

420420
function isConnected(dfg::CloudGraphsDFG)::Bool
421-
# If the total number of nodes == total number of distinct connected nodes, then it is fully connected
422-
# Total nodes
423-
varIds = listVariables(dfg)
424-
factIds = listFactors(dfg)
425-
length(varIds) + length(factIds) == 0 && return false
426-
427-
# Total distinct connected nodes - thank you Neo4j for 0..* awesomeness!!
428-
# TODO: Deprecated matching technique and it's technically an expensive call - optimize.
429-
query = """
430-
match (n:$(dfg.userId):$(dfg.robotId):$(dfg.sessionId):$(varIds[1]))-[FACTORGRAPH*]-(node:$(dfg.userId):$(dfg.robotId):$(dfg.sessionId))
431-
WHERE (n:VARIABLE OR n:FACTOR OR node:VARIABLE OR node:FACTOR) and not (node:SESSION or n:SESSION) and not (n:PPE) and not (node:PPE)
432-
WITH collect(n)+collect(node) as nodelist
433-
unwind nodelist as nodes
434-
return count(distinct nodes)"""
435-
@debug "[Query] $query"
436-
result = _queryNeo4j(dfg.neo4jInstance, query)
437-
# Neo4j.jl data structure sometimes feels brittle... like below
438-
return result.results[1]["data"][1]["row"][1] == length(varIds) + length(factIds)
421+
# # If the total number of nodes == total number of distinct connected nodes, then it is fully connected
422+
# # Total nodes
423+
# varIds = listVariables(dfg)
424+
# factIds = listFactors(dfg)
425+
# length(varIds) + length(factIds) == 0 && return false
426+
427+
# # Total distinct connected nodes - thank you Neo4j for 0..* awesomeness!!
428+
# # TODO: Deprecated matching technique and it's technically an expensive call - optimize.
429+
# query = """
430+
# match (n:$(dfg.userId):$(dfg.robotId):$(dfg.sessionId):$(varIds[1]))-[FACTORGRAPH*]-(node:$(dfg.userId):$(dfg.robotId):$(dfg.sessionId))
431+
# WHERE (n:VARIABLE OR n:FACTOR OR node:VARIABLE OR node:FACTOR) and not (node:SESSION or n:SESSION) and not (n:PPE) and not (node:PPE)
432+
# WITH collect(n)+collect(node) as nodelist
433+
# unwind nodelist as nodes
434+
# return count(distinct nodes)"""
435+
# @debug "[Query] $query"
436+
# result = _queryNeo4j(dfg.neo4jInstance, query)
437+
# # Neo4j.jl data structure sometimes feels brittle... like below
438+
# return result.results[1]["data"][1]["row"][1] == length(varIds) + length(factIds)
439+
return isConnected(SkeletonDFG(dfg))
439440
end
440441

441442
function getNeighbors(dfg::CloudGraphsDFG, node::T; solvable::Int=0)::Vector{Symbol} where T <: DFGNode
@@ -943,3 +944,28 @@ function emptyTags!(dfg::CloudGraphsDFG, sym::Symbol)
943944
return getTags(getNode(dfg, sym))
944945

945946
end
947+
948+
949+
##==============================================================================
950+
## Skeleton DFG Constructor
951+
##==============================================================================
952+
# TODO tags
953+
function _getSkeletonFactors(dfg::CloudGraphsDFG)
954+
neo4jInstance = dfg.neo4jInstance
955+
query = "match (node:$(join(_getLabelsForType(dfg, DFGFactor),':'))) return distinct(node.label),node._variableOrderSymbols"
956+
result = _queryNeo4j(neo4jInstance, query)
957+
facs = map(node -> SkeletonDFGFactor(Symbol(node["row"][1]),Symbol.(node["row"][2])), result.results[1]["data"])
958+
return facs
959+
end
960+
# TODO tags
961+
function _getSkeletonVariables(dfg::CloudGraphsDFG)
962+
return SkeletonDFGVariable.(ls(dfg))
963+
end
964+
965+
export SkeletonDFG
966+
function SkeletonDFG(cfg::CloudGraphsDFG)
967+
sfg = LightDFG{NoSolverParams, SkeletonDFGVariable, SkeletonDFGFactor}()
968+
addVariable!.(sfg, _getSkeletonVariables(cfg))
969+
addFactor!.(sfg, _getSkeletonFactors(cfg))
970+
return sfg
971+
end

src/DataBlobs/services/DataEntryBlob.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,34 +46,38 @@ function listDataBlobs end
4646
##==============================================================================
4747

4848
"""
49-
$(SIGNATURES)
5049
Get the data entry and blob for the specified blobstore or dfg retured as a tuple.
5150
Related
5251
[`getDataEntry`](@ref)
52+
53+
$(METHODLIST)
5354
"""
5455
function getData end
5556

5657
"""
57-
$(SIGNATURES)
5858
Add a data Entry and Blob to a distributed factor graph or BlobStore.
5959
Related
6060
[`addDataEntry!`](@ref)
61+
62+
$(METHODLIST)
6163
"""
6264
function addData! end
6365

6466
"""
65-
$(SIGNATURES)
6667
Update a data entry or blob to the blob store or dfg.
6768
Related
6869
[`updateDataEntry!`](@ref)
70+
71+
$(METHODLIST)
6972
"""
7073
function updateData! end
7174

7275
"""
73-
$(SIGNATURES)
7476
Delete a data entry and blob from the blob store or dfg.
7577
Related
7678
[`deleteDataEntry!`](@ref)
79+
80+
$(METHODLIST)
7781
"""
7882
function deleteData! end
7983

test/interfaceTests.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,8 @@ end
170170
end
171171

172172
@testset "Connectivity Test" begin
173-
if testDFGAPI != CloudGraphsDFG
174-
rand(5)
175-
ConnectivityTest(testDFGAPI)
176-
else
177-
@warn "CloudGraphsDFG is currently failing with the connectivity test."
178-
end
173+
rand(5)
174+
ConnectivityTest(testDFGAPI)
179175
end
180176

181177

0 commit comments

Comments
 (0)