Skip to content
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

solveCliq! tripped up by tree :upMsg error #1168

Closed
dehann opened this issue Feb 16, 2021 · 1 comment · Fixed by #1169
Closed

solveCliq! tripped up by tree :upMsg error #1168

dehann opened this issue Feb 16, 2021 · 1 comment · Fixed by #1169

Comments

@dehann
Copy link
Member

dehann commented Feb 16, 2021

N=100
fg = initfg()

addVariable!(fg, :x0, ContinuousEuclid{2}, N=N)
addFactor!(fg, [:x0], Prior(MvNormal([100.0;0], [1;1.0])), graphinit=false)

addVariable!(fg, :x1, ContinuousEuclid{2}, N=N)
addFactor!(fg, [:x1], Prior(MvNormal([0.0;100.0], [1;1.0])), graphinit=false)

addVariable!(fg, :l1, ContinuousEuclid{2}, N=N)
addFactor!(fg, [:x0;:l1], EuclidDistance(Normal(100.0, 1.0)), graphinit=false)
addFactor!(fg, [:x1;:l1], EuclidDistance(Normal(100.0, 1.0)), graphinit=false)

## 

eo = [:x1; :x0; :l1]
tree = buildTreeReset!(fg, eo)

stuff = solveCliq!(fg, tree, :x1)

Produces error:

ERROR: KeyError: key :upMsg not found
Stacktrace:
  [1] getindex
    @ ./dict.jl:482 [inlined]
  [2] get_prop
    @ ~/.julia/packages/MetaGraphs/SUjFO/src/MetaGraphs.jl:256 [inlined]
  [3] getMsgUpChannel
    @ ~/.julia/dev/IncrementalInference/src/TreeMessageAccessors.jl:63 [inlined]
  [4] putBeliefMessageUp!(tree::MetaBayesTree, edge::LightGraphs.SimpleGraphs.SimpleEdge{Int64}, beliefMsg::LikelihoodMessage{IncrementalInference.NonparametricMessage})
    @ IncrementalInference ~/.julia/dev/IncrementalInference/src/TreeMessageAccessors.jl:72
  [5] postUpSolve_StateMachine(csmc::CliqStateMachineContainer{BayesTreeNodeData, LightDFG{SolverParams, DFGVariable, DFGFactor}, LightDFG{SolverParams, DFGVariable, DFGFactor}, MetaBayesTree})
    @ IncrementalInference ~/.julia/dev/IncrementalInference/src/CliqueStateMachine.jl:437
  [6] (::StateMachine{CliqStateMachineContainer})(userdata::CliqStateMachineContainer{BayesTreeNodeData, LightDFG{SolverParams, DFGVariable, DFGFactor}, LightDFG{SolverParams, DFGVariable, DFGFactor}, MetaBayesTree}, timeout::Nothing; pollinterval::Float64, breakafter::Function, verbose::Bool, verbosefid::Base.TTY, verboseXtra::IncrementalInference.CliqStatus, iterlimit::Int64, injectDelayBefore::Nothing, recordhistory::Bool, housekeeping_cb::IncrementalInference.var"#379#381"{IncrementalInference.TreeClique})
    @ FunctionalStateMachine ~/.julia/packages/FunctionalStateMachine/2JZFG/src/StateMachine.jl:82
  [7] initStartCliqStateMachine!(dfg::LightDFG{SolverParams, DFGVariable, DFGFactor}, tree::MetaBayesTree, cliq::IncrementalInference.TreeClique, timeout::Nothing; oldcliqdata::BayesTreeNodeData, verbose::Bool, verbosefid::Base.TTY, drawtree::Bool, show::Bool, incremental::Bool, limititers::Int64, upsolve::Bool, downsolve::Bool, recordhistory::Bool, delay::Bool, logger::Base.CoreLogging.SimpleLogger, solve_progressbar::Nothing, algorithm::Symbol)
    @ IncrementalInference ~/.julia/dev/IncrementalInference/src/CliqueStateMachine.jl:63
  [8] tryCliqStateMachineSolve!(dfg::LightDFG{SolverParams, DFGVariable, DFGFactor}, treel::MetaBayesTree, cliqKey::Int64, timeout::Nothing; oldtree::MetaBayesTree, verbose::Bool, verbosefid::Base.TTY, drawtree::Bool, limititers::Int64, downsolve::Bool, incremental::Bool, delaycliqs::Vector{Symbol}, recordcliqs::Vector{Symbol}, solve_progressbar::Nothing, algorithm::Symbol)
    @ IncrementalInference ~/.julia/dev/IncrementalInference/src/SolverAPI.jl:110
  [9] solveCliq!(dfgl::LightDFG{SolverParams, DFGVariable, DFGFactor}, tree::MetaBayesTree, cliqid::Symbol; verbose::Bool, recordcliq::Bool, async::Bool)
    @ IncrementalInference ~/.julia/dev/IncrementalInference/src/SolverAPI.jl:450
 [10] solveCliq!(dfgl::LightDFG{SolverParams, DFGVariable, DFGFactor}, tree::MetaBayesTree, cliqid::Symbol)
    @ IncrementalInference ~/.julia/dev/IncrementalInference/src/SolverAPI.jl:437
 [11] top-level scope
    @ REPL[6]:1

Screenshot from 2021-02-16 18-54-25

@dehann
Copy link
Member Author

dehann commented Feb 17, 2021

Hi @Affie , would you perhaps be able check quick if this is an easy fix please? Might take me a bit longer to trace how the messages work on the new tree.

I just added solveCliq! to the tests (actually part of follow on to #1051, in #1167) here:
5b9e314#diff-914efbf7c305811775c8fd16ce0c861641210a576ae8d7de5933b1dcdd7f4ba2R101

@dehann dehann modified the milestones: v0.21.2, v0.21.3 Feb 17, 2021
@Affie Affie linked a pull request Feb 18, 2021 that will close this issue
@Affie Affie closed this as completed Feb 18, 2021
@Affie Affie modified the milestones: v0.21.3, v0.21.2 Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants