@@ -29,21 +29,40 @@ Create an in-memory GraphsDFG with the following parameters:
29
29
- V: Variable type
30
30
- F: Factor type
31
31
"""
32
- function GraphsDFG {T,V,F} (g:: FactorGraph{Int,V,F} = FactorGraph {Int,V,F} ();
33
- description:: String = " Graphs.jl implementation" ,
34
- userLabel:: String = " DefaultUser" ,
35
- robotLabel:: String = " DefaultRobot" ,
36
- sessionLabel:: String = " Session_$(string (uuid4 ())[1 : 6 ]) " ,
37
- userData:: Dict{Symbol, String} = Dict {Symbol, String} (),
38
- robotData:: Dict{Symbol, String} = Dict {Symbol, String} (),
39
- sessionData:: Dict{Symbol, String} = Dict {Symbol, String} (),
40
- solverParams:: T = T (),
41
- blobstores= Dict {Symbol, AbstractBlobStore} ()) where {T <: AbstractParams , V <: AbstractDFGVariable , F<: AbstractDFGFactor }
42
- # Validate the userLabel, robotLabel, and sessionLabel
43
- ! isValidLabel (userLabel) && error (" '$userLabel ' is not a valid User label" )
44
- ! isValidLabel (robotLabel) && error (" '$robotLabel ' is not a valid Robot label" )
45
- ! isValidLabel (sessionLabel) && error (" '$sessionLabel ' is not a valid Session label" )
46
- return GraphsDFG {T,V,F} (g, description, userLabel, robotLabel, sessionLabel, userData, robotData, sessionData, Symbol[], solverParams, blobstores)
32
+ function GraphsDFG {T,V,F} (
33
+ g:: FactorGraph{Int,V,F} = FactorGraph {Int,V,F} ();
34
+ description:: String = " Graphs.jl implementation" ,
35
+ userLabel:: String = " DefaultUser" ,
36
+ robotLabel:: String = " DefaultRobot" ,
37
+ sessionLabel:: String = " Session_$(string (uuid4 ())[1 : 6 ]) " ,
38
+ userData:: Dict{Symbol, String} = Dict {Symbol, String} (),
39
+ robotData:: Dict{Symbol, String} = Dict {Symbol, String} (),
40
+ sessionData:: Dict{Symbol, String} = Dict {Symbol, String} (),
41
+ solverParams:: T = T (),
42
+ blobstores= Dict {Symbol, AbstractBlobStore} (),
43
+ # deprecating
44
+ userId:: Union{Nothing, String} = nothing ,
45
+ robotId:: Union{Nothing, String} = nothing ,
46
+ sessionId:: Union{Nothing, String} = nothing ,
47
+ ) where {T <: AbstractParams , V <: AbstractDFGVariable , F<: AbstractDFGFactor }
48
+ # Validate the userLabel, robotLabel, and sessionLabel
49
+ if userId != = nothing
50
+ @error " Obsolete use of userId::String with GraphsDFG, use userLabel::String instead" maxlog= 10
51
+ userLabel = userId
52
+ end
53
+ if robotId != = nothing
54
+ @error " Obsolete use of robotId::String with GraphsDFG, use robotLabel::String instead" maxlog= 10
55
+ robotLabel = robotId
56
+ end
57
+ if sessionId != = nothing
58
+ @error " Obsolete use of sessionId::String with GraphsDFG, use sessionLabel::String instead" maxlog= 10
59
+ sessionLabel = sessionId
60
+ end
61
+
62
+ ! isValidLabel (userLabel) && error (" '$userLabel ' is not a valid User label" )
63
+ ! isValidLabel (robotLabel) && error (" '$robotLabel ' is not a valid Robot label" )
64
+ ! isValidLabel (sessionLabel) && error (" '$sessionLabel ' is not a valid Session label" )
65
+ return GraphsDFG {T,V,F} (g, description, userLabel, robotLabel, sessionLabel, userData, robotData, sessionData, Symbol[], solverParams, blobstores)
47
66
end
48
67
49
68
# GraphsDFG{T}(; kwargs...) where T <: AbstractParams = GraphsDFG{T,DFGVariable,DFGFactor}(;kwargs...)
0 commit comments