locusrobotics / fuse

The fuse stack provides a general architecture for performing sensor fusion live on a robot. Some possible applications include state estimation, localization, mapping, and calibration.
Other
729 stars 123 forks source link

Print graph & transaction on optimization failure #321

Closed efernandez closed 1 year ago

efernandez commented 1 year ago

Context

I got into an issue where the optimization failed. I've not been able to find the root cause. If it happens again, the graph and transaction at the time of failure would be extremely useful.

Motivation

Note that when the optimization fails we shutdown the node, so even if we notify the fuse publishers, there's no guarantee they have time to actually publish the graph and transaction. Even in that case, I usually throttle the graph publication because it has a significant overhead. I can re-create the graphs later, using the transactions, but that's a bit tedious. If we get the graph and transaction printed right away in the FATAL log message, I hope we can easily figure out the root cause, which I believe it's related to the transaction callback logic and a corner case with the transactions timestamps that we're stilling failing to handle properly.