JuliaRobotics / IncrementalInference.jl

Clique recycling non-Gaussian (multi-modal) factor graph solver; also see Caesar.jl.
MIT License
72 stars 21 forks source link

define new tree based down init sequence and test #344

Open dehann opened 5 years ago

dehann commented 5 years ago

Parent clique:

Based on lower down information (priors) only x38 can initialize from below. All 4 other sibling cliques must cross initialize through the parent -- i.e. downward init.

By checking the number of intersections of separators between the siblings we find as follows:

as a triangular matrix:

* 2 2 1 1
* * 0 0 0
* * * 0 0
* * * * 1
* * * * *

Summing triangular matrix along columns gives (AA):

0 2 2 1 2

Summing symmetric version of matrix along columns gives (BB):

6 2 2 2 2

By summing the triangular matrix along rows we find (CC):

6
0
0
1
0

This (CC) implies special significance on cliques x38 and x12, while x30 and x50 are more 'independent'. Next we look at the best achievable status of each of the sibling cliques and find:

Therefore x38 will be used for upward information that can be distributed to the siblings and that clique can therefore pass and CSM may proceed to the next stage of x38's solution.

The special case of clique x12 must now be considered. By eliminating x38 as upsolved the triangular matrix reduces to:

* * * * *
* * 0 0 0
* * * 0 0
* * * * 1
* * * * *

Summing along the triangular columns reveal (DD):

0 0 0 0 1

This also Indicates a special interaction between cliques x12 and x6 (row 4, column 5 is non-zero). Knowning that both :needdownmsg information, we must first determine what the interaction between these two cliques should be. Using CC and by looking at the opposite eliminated (x12) triangular matrix, we find:

* 2 2 * 1
* * 0 * 0
* * * * 0
* * * * *
* * * * *

Summing along the triangular columns reveal (EE):

0 2 2 0 1

Both cliques x12 and x6 are equally weighted with one shared variable in their separators -- variable x9 in this case (which doesn't appear in clique x38's separator). This process identifies that one clique may likely have to be initialized before the other and then provide additional downward initialization information for the last remaining branch. The task now is to determine if clique x12 or x6 should be initialized first?

The triangular column sum with x12 rows and columns eliminated shows that clique x6 can also be initialized, after which a second piece of downward initialization information will become available for use in clique x12's branch.

To determine okay for downinit on x12, we repeat the process by eliminating any further solved siblings from the triangular matrix:

Recap:

When x12 returns upon downinit info availability status update via parent x34, EE is updated with all but x12 as upsolved. This implies no further down info will be available (since x6 has now been upsolved), and x12 can now proceed to retrieve down init messages and attempt upsolve. If the tree is correct, the upsolve should succeed.

Future:

dehann commented 5 years ago

affects

dehann commented 5 years ago

Screenshot from 2019-07-08 18-23-08

dehann commented 5 years ago
dehann commented 5 years ago

Hi @tonioteran , cc'ing in case you were interested in the work on how we solve the autoinit problem on the tree. I'm busy implementing this new fix as improvement over slightly hacky previous version. Variable initialization can be tricky...

dehann commented 5 years ago

implementation is getting a bit nasty, but getting to the final debugging stages now: https://github.com/JuliaRobotics/IncrementalInference.jl/blob/abb857f8e7098d5af9bc6e666fcf899b75f55304/src/CliqStateMachineUtils.jl#L316

dehann commented 5 years ago

was introduced in v0.7.3 but need more -- the inferdim dim work #353

dehann commented 4 years ago

xref #910 and #754