Skip to content

Commit 7db4907

Browse files
authored
Merge pull request #708 from JuliaRobotics/master
Release v0.11.1
2 parents 169f629 + 3ffc29a commit 7db4907

File tree

11 files changed

+28
-25
lines changed

11 files changed

+28
-25
lines changed

src/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,9 @@ function _unpackPPE(dfg::G, packedPPE::Dict{String, Any})::AbstractPointParametr
535535
packedPPE["lastUpdatedTimestamp"] = packedPPE["lastUpdatedTimestamp"][1:end-1]
536536
end
537537

538-
!haskey(packedPPE, "_type") && error("Cannot find type key '$TYPEKEY' in packed PPE data")
538+
!haskey(packedPPE, "_type") && error("Cannot find type key '_type' in packed PPE data")
539539
type = pop!(packedPPE, "_type")
540-
(type == nothing || type == "") && error("Cannot deserialize PPE, type key is empty")
540+
(type === nothing || type == "") && error("Cannot deserialize PPE, type key is empty")
541541
ppe = Unmarshal.unmarshal(
542542
DistributedFactorGraphs.getTypeFromSerializationModule(dfg, Symbol(type)),
543543
packedPPE)
@@ -555,6 +555,9 @@ end
555555

556556
function _generateAdditionalProperties(variableType::ST, ppe::P)::Dict{String, String} where {P <: AbstractPointParametricEst, ST <: InferenceVariable}
557557
addProps = Dict{String, String}()
558+
# Save in the type for PPEs
559+
addProps["_type"]="\"$(typeof(ppe))\""
560+
558561
# Try get the projectCartesian function for this variableType
559562
projectCartesianFunc = nothing
560563
if isdefined(Main, :projectCartesian)

src/CloudGraphsDFG/services/CommonFunctions.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ function _structToNeo4jProps(inst::Union{User, Robot, Session, PVND, N, APPE, AB
204204
write(io, "$cypherNodeName.$k= $v,")
205205
end
206206
# Write in the version and node type
207-
write(io, "$cypherNodeName._version=\"$(_getDFGVersion())\",")
208-
write(io, "$cypherNodeName._type=\"$(typeof(inst))\"")
207+
write(io, "$cypherNodeName._version=\"$(_getDFGVersion())\"")
209208
# Ref String(): "When possible, the memory of v will be used without copying when the String object is created.
210-
# This is guaranteed to be the case for byte vectors returned by take!" # Apparent replacement for takebuf_string()
209+
# This is guaranteed to be the case for byte vectors returned by take!"
210+
# Apparent replacement for takebuf_string()
211211
return String(take!(io))
212212
end
213213

test/CGStructureTests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ v1 = addVariable!(dfg, :a, ContinuousScalar, tags = [:POSE])
5959
v2 = addVariable!(dfg, :b, ContinuousScalar, tags = [:POSE])
6060
v3 = addVariable!(dfg, :c, ContinuousScalar, tags = [:LANDMARK])
6161
addFactor!(dfg, [:a], Prior(Normal(0,1)))
62-
f1 = addFactor!(dfg, [:a; :b], LinearConditional(Normal(50.0,2.0)) )
63-
f2 = addFactor!(dfg, [:b; :c], LinearConditional(Normal(50.0,2.0)) )
62+
f1 = addFactor!(dfg, [:a; :b], LinearRelative(Normal(50.0,2.0)) )
63+
f2 = addFactor!(dfg, [:b; :c], LinearRelative(Normal(50.0,2.0)) )
6464

6565
sessions = lsSessions(dfg)
6666
@test map(s -> s.id, sessions) == [session.id]

test/data/0_11_0.tar.gz

1.52 KB
Binary file not shown.
File renamed without changes.

test/fileDFGTests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ using Test
3737
updateVariable!.(dfg, verts)
3838

3939

40-
facts = map(n -> addFactor!(dfg, [verts[n], verts[n+1]], LinearConditional(Normal(50.0,2.0))), 1:(numNodes-1))
40+
facts = map(n -> addFactor!(dfg, [verts[n], verts[n+1]], LinearRelative(Normal(50.0,2.0))), 1:(numNodes-1))
4141
map(f -> setSolvable!(f, Int(round(rand()))), facts)
4242
map(f -> f.solverData.eliminated = rand() > 0.5, facts)
4343
map(f -> f.solverData.potentialused = rand() > 0.5, facts)
4444
updateFactor!.(dfg, facts)
4545

4646
#test multihypo
47-
addFactor!(dfg, [:x1, :x2, :x3], LinearConditional(Normal(50.0,2.0)), multihypo = [1, 0.3, 0.7])
47+
addFactor!(dfg, [:x1, :x2, :x3], LinearRelative(Normal(50.0,2.0)), multihypo = [1, 0.3, 0.7])
4848

4949
# Save and load the graph to test.
5050
saveDFG(filename, dfg)
@@ -85,7 +85,7 @@ end
8585

8686
@testset "FileDFG Regression Tests" begin
8787
@info "If any of these tests fail, we have breaking changes"
88-
for file in readdir(joinpath(@__DIR__, "data"))
88+
for file in filter(f -> endswith(f, ".tar.gz"), readdir(joinpath(@__DIR__, "data")))
8989
loadFile = joinpath(@__DIR__, "data", file)
9090
global dfg
9191
dfgCopy = DistributedFactorGraphs._getDuplicatedEmptyDFG(dfg)

test/iifCompareTests.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ using Test
1515
@test compareFactor(f1,f1)
1616

1717
v2 = addVariable!(fg, :x1, ContinuousScalar)
18-
f2 = addFactor!(fg, [:x0;:x1], LinearConditional(Normal(2.0, 0.1)))
18+
f2 = addFactor!(fg, [:x0;:x1], LinearRelative(Normal(2.0, 0.1)))
1919

2020
fg2 = deepcopy(fg)
2121

@@ -56,7 +56,7 @@ using Test
5656
# fg2 has been solved, so it should fail on the estimate dictionary
5757
@test !compareSimilarVariables(fg, fg2, skipsamples=true, skip=Symbol[:initialized;:inferdim])
5858

59-
tree = wipeBuildNewTree!(fg2)
59+
tree = resetBuildTree!(fg2)
6060

6161
@test compareSimilarFactors(fg, fg2, skipsamples=true, skipcompute=true)
6262

@@ -77,13 +77,13 @@ end
7777
addFactor!(fg, [:x0;], Prior(Normal()))
7878

7979
addVariable!(fg, :x1, ContinuousScalar)
80-
addFactor!(fg, [:x0;:x1], LinearConditional(Normal(2.0, 0.1)))
80+
addFactor!(fg, [:x0;:x1], LinearRelative(Normal(2.0, 0.1)))
8181

8282
addVariable!(fg, :x2, ContinuousScalar)
83-
addFactor!(fg, [:x1;:x2], LinearConditional(Normal(4.0, 0.1)))
83+
addFactor!(fg, [:x1;:x2], LinearRelative(Normal(4.0, 0.1)))
8484

8585
addVariable!(fg, :l1, ContinuousScalar)
86-
addFactor!(fg, [:x1;:l1], LinearConditional(Rayleigh()))
86+
addFactor!(fg, [:x1;:l1], LinearRelative(Rayleigh()))
8787

8888
sfg = buildSubgraph(LightDFG, fg, [:x0;:x1])
8989

test/iifInterfaceTests.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ end
1212
# Use IIF to add the variables and factors
1313
v1 = addVariable!(dfg, :a, ContinuousScalar, tags = [:POSE], solvable=0)
1414
v2 = addVariable!(dfg, :b, ContinuousScalar, tags = [:LANDMARK], solvable=1)
15-
f1 = addFactor!(dfg, [:a; :b], LinearConditional(Normal(50.0,2.0)), solvable=0)
15+
f1 = addFactor!(dfg, [:a; :b], LinearRelative(Normal(50.0,2.0)), solvable=0)
1616

1717
@show dfg
1818
@show f1
@@ -50,8 +50,8 @@ end
5050
v1 = deepcopy(addVariable!(iiffg, :a, ContinuousScalar))
5151
v2 = deepcopy(addVariable!(iiffg, :b, ContinuousScalar))
5252
v3 = deepcopy(addVariable!(iiffg, :c, ContinuousScalar))
53-
f1 = deepcopy(addFactor!(iiffg, [:a; :b], LinearConditional(Normal(50.0,2.0)) ))
54-
f2 = deepcopy(addFactor!(iiffg, [:b; :c], LinearConditional(Normal(10.0,1.0)) ))
53+
f1 = deepcopy(addFactor!(iiffg, [:a; :b], LinearRelative(Normal(50.0,2.0)) ))
54+
f2 = deepcopy(addFactor!(iiffg, [:b; :c], LinearRelative(Normal(10.0,1.0)) ))
5555

5656
# Add it to the new graph.
5757
@test addVariable!(dfg2, v1) == v1
@@ -141,9 +141,9 @@ end
141141
#FIXME don't know what it is supposed to do
142142
@test_broken lsfTypes(dfg)
143143

144-
@test ls(dfg, LinearConditional) == [:abf1]
145-
@test lsf(dfg, LinearConditional) == [:abf1]
146-
@test lsfWho(dfg, :LinearConditional) == [:abf1]
144+
@test ls(dfg, LinearRelative) == [:abf1]
145+
@test lsf(dfg, LinearRelative) == [:abf1]
146+
@test lsfWho(dfg, :LinearRelative) == [:abf1]
147147

148148
@test getVariableType(v1) isa ContinuousScalar
149149
@test getVariableType(dfg,:a) isa ContinuousScalar
@@ -397,7 +397,7 @@ updateVariable!(dfg, verts[7])
397397
updateVariable!(dfg, verts[8])
398398

399399
facts = map(n ->
400-
addFactor!(dfg, [verts[n], verts[n+1]], LinearConditional(Normal(50.0,2.0)),solvable=0), 1:(numNodes-1))
400+
addFactor!(dfg, [verts[n], verts[n+1]], LinearRelative(Normal(50.0,2.0)),solvable=0), 1:(numNodes-1))
401401

402402
@testset "Getting Neighbors" begin
403403
global dfg,verts

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ using Pkg
77
using Dates
88
using TimeZones
99
using SHA
10+
using UUIDs
1011

1112
## To run the IIF tests, you need a local Neo4j with user/pass neo4j:test
1213
# To run a Docker image

test/solveTest.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ v1 = addVariable!(dfg, :a, ContinuousScalar, tags = [:POSE])
44
addFactor!(dfg, [:a], Prior(Normal(0,1)))
55
v2 = addVariable!(dfg, :b, ContinuousScalar, tags = [:POSE])
66
v3 = addVariable!(dfg, :c, ContinuousScalar, tags = [:LANDMARK])
7-
f1 = addFactor!(dfg, [:a; :b], LinearConditional(Normal(50.0,2.0)) )
8-
f2 = addFactor!(dfg, [:b; :c], LinearConditional(Normal(50.0,2.0)) )
7+
f1 = addFactor!(dfg, [:a; :b], LinearRelative(Normal(50.0,2.0)) )
8+
f2 = addFactor!(dfg, [:b; :c], LinearRelative(Normal(50.0,2.0)) )
99

1010
# Solve it
1111
tree, smtasks = solveTree!(dfg)

test/testBlocks.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using DistributedFactorGraphs
22
using Test
33
using Dates
4-
using UUIDs
54

65
import Base: convert
76

0 commit comments

Comments
 (0)