Skip to content

Commit 0faaf95

Browse files
authored
Merge pull request #824 from JuliaRobotics/master
v0.17.1-rc1
2 parents 9d7e873 + e651723 commit 0faaf95

File tree

5 files changed

+37
-6
lines changed

5 files changed

+37
-6
lines changed

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.17.0"
3+
version = "0.17.1"
44

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

src/DataBlobs/services/AbstractDataEntries.jl

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ end
125125

126126
"""
127127
$(SIGNATURES)
128-
listDataEntries
128+
List the data entries associated with a particular variable.
129129
"""
130130
function listDataEntries(var::AbstractDFGVariable)
131131
collect(keys(var.dataDict))
@@ -135,3 +135,33 @@ function listDataEntries(dfg::AbstractDFG, label::Symbol)
135135
# !isVariable(dfg, label) && return nothing
136136
listDataEntries(getVariable(dfg, label))
137137
end
138+
139+
"""
140+
$SIGNATURES
141+
List a collection of data entries per variable that match a particular `pattern::Regex`.
142+
143+
Notes
144+
- Optional sort function argument, default is unsorted.
145+
- Likely use of `sortDFG` for basic Symbol sorting.
146+
147+
Example
148+
```julia
149+
listDataEntrySequence(fg, :x0, r"IMG_CENTER", sortDFG)
150+
15-element Vector{Symbol}:
151+
:IMG_CENTER_21676
152+
:IMG_CENTER_21677
153+
:IMG_CENTER_21678
154+
:IMG_CENTER_21679
155+
...
156+
```
157+
"""
158+
function listDataEntrySequence( dfg::AbstractDFG,
159+
lb::Symbol,
160+
pattern::Regex,
161+
_sort::Function=(x)->x)
162+
#
163+
ents_ = listDataEntries(dfg, lb)
164+
entReg = map(l->match(pattern, string(l)), ents_)
165+
entMsk = entReg .!== nothing
166+
ents_[findall(entMsk)] |> _sort
167+
end

src/Deprecated.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ const fetchData = getDataEntryBlob
8383
## softtype deprections
8484
function Base.getproperty(x::InferenceVariable, f::Symbol)
8585
if f==:dims
86-
Base.depwarn("Softtype $(typeof(x)), field dims is deprecated, extend and use `getDimension` instead",:getproperty)
86+
Base.depwarn("varType $(typeof(x)), field dims is deprecated, extend and use `getDimension` instead",:getproperty)
8787
elseif f==:manifolds
88-
Base.depwarn("Softtype $(typeof(x)), field manifolds is deprecated, extend and use `getManifolds` instead",:getproperty)
88+
Base.depwarn("varType $(typeof(x)), field manifolds is deprecated, extend and use `getManifold` instead",:getproperty)
8989
else
9090
if !(@isdefined softtypeFieldsWarnOnce)
91-
Base.depwarn("Softtype $(typeof(x)), will be required to be a singleton type in the future and can no longer have fields. *.$f called. Further warnings are suppressed",:getproperty)
91+
Base.depwarn("varType $(typeof(x)), will be required to be a singleton type in the future and can no longer have fields. *.$f called. Further warnings are suppressed",:getproperty)
9292
global softtypeFieldsWarnOnce = true
9393
end
9494
end

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ export copyGraph!, deepcopyGraph, deepcopyGraph!, buildSubgraph, mergeGraph!
192192
# Big Data
193193
##------------------------------------------------------------------------------
194194
export addDataEntry!, getDataEntry, updateDataEntry!, deleteDataEntry!, getDataEntries, listDataEntries, hasDataEntry, hasDataEntry
195+
export listDataEntrySequence
195196
# convenience wrappers
196197
export addDataEntry!
197198
# aliases

src/LightDFG/services/LightDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ Example
374374
using IncrementalInference
375375
376376
# canonical example graph as example
377-
fg = generateCanonicalFG_Kaess()
377+
fg = generateGraph_Kaess()
378378
379379
@show path = findShortestPathDijkstra(fg, :x1, :x3)
380380
@show isVariable.(fg, path)

0 commit comments

Comments
 (0)