-
Notifications
You must be signed in to change notification settings - Fork 2
address issue #147 (standard PPE) #148
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,9 +77,22 @@ mutable struct PackedVariableNodeData | |
x15::Bool ) = new(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15) | ||
end | ||
|
||
struct VariableEstimate | ||
|
||
abstract type AbstractVariableEstimate end | ||
""" | ||
$TYPEDEF | ||
|
||
Data container to store Parameteric Point Estimate (PPE) from a variety of types. | ||
|
||
Notes | ||
- `ppeType` is something like `:max/:mean/:modefit` etc. | ||
- `solveKey` is from super-solve concept, starting with `:default`, | ||
- `estimate` is the actual numerical estimate value, | ||
- Additional information such as how the data is represented (ie softtype) is stored alongside this data container in the `DFGVariableSummary` container. | ||
""" | ||
struct VariableEstimate <: AbstractVariableEstimate | ||
solverKey::Symbol | ||
type::Symbol | ||
ppeType::Symbol | ||
estimate::Vector{Float64} | ||
lastUpdatedTimestamp::DateTime | ||
VariableEstimate(solverKey::Symbol, type::Symbol, estimate::Vector{Float64}, lastUpdatedTimestamp::DateTime=now()) = new(solverKey, type, estimate, lastUpdatedTimestamp) | ||
|
@@ -93,7 +106,7 @@ mutable struct DFGVariable <: AbstractDFGVariable | |
label::Symbol | ||
timestamp::DateTime | ||
tags::Vector{Symbol} | ||
estimateDict::Dict{Symbol, Dict{Symbol, VariableEstimate}} | ||
estimateDict::Dict{Symbol, Dict{Symbol, <: AbstractVariableEstimate}} | ||
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. EDIT know we have been going back and forth on this --
estimateDict::Dict{Symbol, Dict{Symbol, Float64}}(
:default => Dict{Symbol, Vector{Float64}}(
:max => [1;2;3],
:mean => [3;2;1],
:modefit1 => [2;2;2],
:modefit1_weight => [4;],
...
:lastupdated => [2019;10;13;22;20;00.000]
)) Better solutionCan use anonymous static types which avoids the boiler plate. See Option 2 here and further: 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. easier to link discussions from Issue, so repeated here #147 (comment) |
||
solverDataDict::Dict{Symbol, VariableNodeData} | ||
smallData::Dict{String, String} | ||
bigData::Any | ||
|
@@ -110,6 +123,14 @@ timestamp(v::DFGVariable) = v.timestamp | |
tags(v::DFGVariable) = v.tags | ||
estimates(v::DFGVariable) = v.estimateDict | ||
estimate(v::DFGVariable, key::Symbol=:default) = haskey(v.estimateDict, key) ? v.estimateDict[key] : nothing | ||
|
||
""" | ||
$SIGNATURES | ||
|
||
Retrieve the soft type name symbol for a DFGVariable or DFGVariableSummary. ie :Point2, Pose2, etc. | ||
""" | ||
softtype(v::DFGVariable)::Symbol = Symbol(typeof(getSofttype(v))) | ||
|
||
""" | ||
$SIGNATURES | ||
|
||
|
@@ -145,12 +166,14 @@ mutable struct DFGVariableSummary <: AbstractDFGVariable | |
label::Symbol | ||
timestamp::DateTime | ||
tags::Vector{Symbol} | ||
estimateDict::Dict{Symbol, Dict{Symbol, VariableEstimate}} | ||
estimateDict::Dict{Symbol, Dict{Symbol, <:AbstractVariableEstimate}} | ||
softtypename::Symbol | ||
_internalId::Int64 | ||
end | ||
label(v::DFGVariableSummary) = v.label | ||
timestamp(v::DFGVariableSummary) = v.timestamp | ||
tags(v::DFGVariableSummary) = v.tags | ||
estimates(v::DFGVariableSummary) = v.estimateDict | ||
estimate(v::DFGVariableSummary, key::Symbol=:default) = haskey(v.estimateDict, key) ? v.estimateDict[key] : nothing | ||
softtype(v::DFGVariableSummary)::Symbol = v.softtypename | ||
internalId(v::DFGVariableSummary) = v._internalId |
Uh oh!
There was an error while loading. Please reload this page.