File tree Expand file tree Collapse file tree 3 files changed +20
-9
lines changed Expand file tree Collapse file tree 3 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 1
1
name = " DistributedFactorGraphs"
2
2
uuid = " b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
3
- version = " 0.20.0 "
3
+ version = " 0.20.1 "
4
4
5
5
[deps ]
6
6
Base64 = " 2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Original file line number Diff line number Diff line change @@ -119,14 +119,25 @@ Should be extended if DFG variable is not returned by reference.
119
119
120
120
Also see: [`getBlobEntry`](@ref), [`addBlob`](@ref), [`mergeBlobEntries!`](@ref)
121
121
"""
122
- function addBlobEntry! (var:: AbstractDFGVariable , bde:: BlobEntry )
123
- haskey (var. dataDict, bde. label) && error (" blobEntry $(bde. label) already exists on variable $(getLabel (var)) " )
124
- var. dataDict[bde. label] = bde
125
- return bde
122
+ function addBlobEntry! (
123
+ var:: AbstractDFGVariable ,
124
+ 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
+ )
129
+ haskey (var. dataDict, entry. label) && error (" blobEntry $(entry. label) already exists on variable $(getLabel (var)) " )
130
+ var. dataDict[entry. label] = entry
131
+ return entry
126
132
end
127
133
128
- function addBlobEntry! (dfg:: AbstractDFG , label:: Symbol , bde:: BlobEntry )
129
- return addBlobEntry! (getVariable (dfg, label), bde)
134
+ function addBlobEntry! (
135
+ dfg:: AbstractDFG ,
136
+ vLbl:: Symbol ,
137
+ entry:: BlobEntry ;
138
+ kw...
139
+ )
140
+ return addBlobEntry! (getVariable (dfg, vLbl), entry; kw... )
130
141
end
131
142
132
143
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ function addData!(
119
119
checkhash && assertHash (entry, blob, hashfunction= hashfunction)
120
120
blobId = addBlob! (dfg, entry, blob) |> UUID
121
121
newEntry = BlobEntry (entry; id= blobId, blobId) # , size=length(blob))
122
- addBlobEntry! (dfg, label, newEntry)
122
+ addBlobEntry! (dfg, label, newEntry; blobSize = length (blob) )
123
123
end
124
124
125
125
function addData! (
@@ -134,7 +134,7 @@ function addData!(
134
134
checkhash && assertHash (entry, blob; hashfunction)
135
135
blobId = addBlob! (blobstore, entry, blob) |> UUID
136
136
newEntry = BlobEntry (entry; id= blobId, blobId) # , size=length(blob))
137
- addBlobEntry! (dfg, label, newEntry)
137
+ addBlobEntry! (dfg, label, newEntry; blobSize = length (blob) )
138
138
end
139
139
140
140
You can’t perform that action at this time.
0 commit comments