-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
variable solver data concept #231
Closed
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
fe10a1a
variable solver data consept
Affie 653242f
update on array
Affie 068a2fe
Field docs
Affie 7a4b3c0
drop buildSubFG_SPECIAL
dehann e73e71d
Merge pull request #248 from JuliaRobotics/main/4Q19/consolidateSubfg
GearsAD 0a43a5d
save and load to gzip as default
dehann 2577077
allow loadDFG file w wo extension
dehann f5733fd
oops, wrong variable
dehann 37f091b
better fuzzy search for tar
dehann 0a0f924
fix bugs
dehann 740c675
allow file names with .
dehann 53da464
Create CompatHelper.yml
dehann 0b9fc6f
Merge pull request #253 from JuliaRobotics/feat/1Q20/tarsavedfg
dehann 456a35a
add getVariablePPE and deprecated
dehann 1cc1f2d
Merge pull request #254 from JuliaRobotics/maint/1Q20/ppedepr
dehann 62ce777
fix fatal compilation errors
dehann 6a7c1bd
Merge pull request #255 from JuliaRobotics/maint/1Q20/fixcomplbreaks
dehann 221989c
dont change directory for save tar
dehann 5ad243d
Merge pull request #256 from JuliaRobotics/maint/1Q20/tarfromafar
dehann d7d26ed
Merge branch 'master' into feature/4Q19/variabelSolverData
Affie 1d4b52d
Merge branch '4Q19/poc/v0_6' into feature/4Q19/variabelSolverData
Affie 1187929
remove merge marker
Affie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: CompatHelper | ||
|
||
on: | ||
schedule: | ||
- cron: '00 00 * * *' | ||
|
||
jobs: | ||
CompatHelper: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
julia-version: [1.2.0] | ||
julia-arch: [x86] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: ${{ matrix.julia-version }} | ||
- name: Pkg.add("CompatHelper") | ||
run: julia -e 'using Pkg; Pkg.add("CompatHelper")' | ||
- name: CompatHelper.main() | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: julia -e 'using CompatHelper; CompatHelper.main()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
include("DFGVariable/PackedVariableNodeData.jl") | ||
include("DFGVariable/PointParametricEst.jl") | ||
include("DFGVariable/VariableNodeData.jl") | ||
|
@@ -55,3 +54,129 @@ DFGVariable(label::Symbol, softtype::T; | |
solvable::Int=1, | ||
_internalId::Int64=0) where {T <: InferenceVariable} = | ||
DFGVariable{T}(label, now(), tags, estimateDict, solverDataDict, smallData, bigData, solvable, DFGNodeParams(solvable, _internalId)) | ||
|
||
""" | ||
$SIGNATURES | ||
DFGVariable constructors. | ||
""" | ||
function DFGVariable(label::Symbol, _internalId::Int64 = 0) #where {T <:InferenceVariable} | ||
st = stacktrace() | ||
@warn "DFGVariable(label::Symbol, _internalId::Int64 = 0) is deprecated please use DFGVariable(label::Symbol, softtype::T, _internalId::Int64 = 0) where T <: InferenceVariable. Enable DEBUG logging for the stack trace." | ||
@debug st | ||
T = InferenceVariable | ||
DFGVariable(label, now(), Symbol[], | ||
Dict{Symbol, MeanMaxPPE}(), | ||
Dict{Symbol, VariableNodeData{T}}(:default => VariableNodeData()), | ||
Dict{String, String}(), | ||
Dict{Symbol,AbstractBigDataEntry}(), 0, _internalId) | ||
end | ||
DFGVariable(label::Symbol, softtype::T, _internalId::Int64 = 0) where {T <: InferenceVariable} = | ||
DFGVariable(label, now(), Symbol[], | ||
Dict{Symbol, MeanMaxPPE}(), | ||
Dict{Symbol, VariableNodeData{T}}(:default => VariableNodeData{T}()), | ||
Dict{String, String}(), | ||
Dict{Symbol,AbstractBigDataEntry}(), 0, _internalId) | ||
|
||
""" | ||
$(SIGNATURES) | ||
Structure for first-class citizens of a DFGVariable. | ||
""" | ||
mutable struct DFGVariableSummary <: AbstractDFGVariable | ||
label::Symbol | ||
timestamp::DateTime | ||
tags::Vector{Symbol} | ||
estimateDict::Dict{Symbol, <:AbstractPointParametricEst} | ||
softtypename::Symbol | ||
_internalId::Int64 | ||
end | ||
|
||
|
||
# SKELETON DFG | ||
""" | ||
$(TYPEDEF) | ||
Skeleton variable with essentials. | ||
""" | ||
struct SkeletonDFGVariable <: AbstractDFGVariable | ||
label::Symbol | ||
tags::Vector{Symbol} | ||
end | ||
|
||
SkeletonDFGVariable(label::Symbol) = SkeletonDFGVariable(label, Symbol[]) | ||
|
||
|
||
# Accessors | ||
|
||
const VariableDataLevel0 = Union{DFGVariable, DFGVariableSummary, SkeletonDFGVariable} | ||
const VariableDataLevel1 = Union{DFGVariable, DFGVariableSummary} | ||
const VariableDataLevel2 = Union{DFGVariable} | ||
|
||
|
||
""" | ||
$SIGNATURES | ||
|
||
Return the estimates for a variable. | ||
""" | ||
getEstimates(v::VariableDataLevel1) = v.estimateDict | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This too has been deprecated, see master branch. |
||
|
||
""" | ||
$SIGNATURES | ||
|
||
Return the estimates for a variable. | ||
|
||
DEPRECATED, estimates -> getEstimates | ||
""" | ||
function estimates(v::VariableDataLevel1) | ||
@warn "Deprecated estimates, use getEstimates instead." | ||
getEstimates(v) | ||
end | ||
|
||
""" | ||
$SIGNATURES | ||
|
||
Return a keyed estimate (default is :default) for a variable. | ||
""" | ||
getEstimate(v::VariableDataLevel1, key::Symbol=:default) = haskey(v.estimateDict, key) ? v.estimateDict[key] : nothing | ||
|
||
""" | ||
$SIGNATURES | ||
|
||
Return a keyed estimate (default is :default) for a variable. | ||
""" | ||
function estimate(v::VariableDataLevel1, key::Symbol=:default) | ||
@warn "DEPRECATED estimate, use getEstimate instead." | ||
getEstimate(v, key) | ||
end | ||
|
||
|
||
""" | ||
$SIGNATURES | ||
|
||
Get the parametric point estimate (PPE) for a variable in the factor graph. | ||
|
||
Notes | ||
- Defaults on keywords `solveKey` and `method` | ||
|
||
Related | ||
|
||
getMeanPPE, getMaxPPE, getKDEMean, getKDEFit | ||
""" | ||
function getVariablePPE(vari::DFGVariable; solveKey::Symbol=:default, method::Function=getSuggestedPPE) | ||
getEstimates(vari)[solveKey] |> getSuggestedPPE | ||
end | ||
|
||
getVariablePPE(dfg::AbstractDFG, vsym::Symbol; solveKey::Symbol=:default, method::Function=getSuggestedPPE) = getVariablePPE(getVariable(dfg,vsym), solveKey=solveKey, method=method) | ||
|
||
""" | ||
$(SIGNATURES) | ||
|
||
Variable nodes softtype information holding a variety of meta data associated with the type of variable stored in that node of the factor graph. | ||
|
||
Related | ||
|
||
getVariableType | ||
""" | ||
function getSofttype(vnd::VariableNodeData) | ||
return vnd.softtype | ||
end | ||
function getSofttype(v::DFGVariable; solveKey::Symbol=:default) | ||
return getSofttype(solverData(v, solveKey)) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest v0.5.3 now has this as
ppeDict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see here:
DistributedFactorGraphs.jl/src/entities/DFGVariable.jl
Line 186 in bea5266
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will likely fall out naturally when merging all this to master, just ask to keep an eye on it when we do please.