@@ -77,13 +77,16 @@ Get data entry
77
77
Also see: [`addBlobEntry`](@ref), [`getBlob`](@ref), [`listBlobEntries`](@ref)
78
78
"""
79
79
function getBlobEntry (var:: AbstractDFGVariable , key:: Symbol )
80
- ! hasBlobEntry (var, key) && error (" No dataEntry label $(key) found in variable $(getLabel (var)) " )
80
+ if ! hasBlobEntry (var, key)
81
+ throw (KeyError (" No dataEntry label $(key) found in variable $(getLabel (var)) . Available keys: $(keys (var. dataDict)) " ))
82
+ end
81
83
return var. dataDict[key]
82
84
end
83
85
84
86
function getBlobEntry (var:: AbstractDFGVariable , blobId:: UUID )
85
87
for (k,v) in var. dataDict
86
- if v. id == blobId
88
+ # FIXME stop using v.id since that has been repurposed for unique BlobEntry indexing
89
+ if v. originId == blobId || v. blobId == blobId || v. id == blobId
87
90
return v
88
91
end
89
92
end
@@ -117,15 +120,15 @@ getBlobEntry(dfg::AbstractDFG, label::Symbol, key::Union{Symbol, UUID, <:Abstrac
117
120
Add Data Entry to a DFG variable
118
121
Should be extended if DFG variable is not returned by reference.
119
122
120
- Also see: [`getBlobEntry`](@ref), [`addBlob`](@ref), [`mergeBlobEntries!`](@ref)
123
+ Also see: [`getBlobEntry`](@ref), [`addBlob! `](@ref), [`mergeBlobEntries!`](@ref)
121
124
"""
122
125
function addBlobEntry! (
123
126
var:: AbstractDFGVariable ,
124
127
entry:: BlobEntry ;
125
- # see https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues/985
126
- blobId:: UUID = isnothing (entry. blobId) ? entry. id : entry. blobId ,
127
- blobSize:: Int = hasfield (DistributedFactorGraphs. BlobEntry, :size ) ? entry. size : - 1 ,
128
+ blobId:: UUID = (isnothing (entry. blobId) ? entry. id : entry. blobId),
129
+ blobSize:: Int = (hasfield (BlobEntry, :size ) ? entry. size : - 1 )
128
130
)
131
+ # see https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues/985
129
132
haskey (var. dataDict, entry. label) && error (" blobEntry $(entry. label) already exists on variable $(getLabel (var)) " )
130
133
var. dataDict[entry. label] = entry
131
134
return entry
0 commit comments