Implement new TrackState EDM used in KF
This MR adds a new track state EDM called MultiTrajectory
. It acts as a track state collection, which internally stores all track state components in arrays. Each track state is then an index tuple, pointing to the components in the backing storage.
Each track state has a previous index. Iterating back from a track state over these previous indices until you reach the beginning of the trajectory gives you a consistent set of track state. In the case of the regular KF, this is always a simple sequence, but it can be used to have forking trajectories, that can then be traced back individually.
Additionally, the index structure allows reusing storage between track state. If you have a track state with one set of predicted parameters, for instance, it will allow you to clone a track state, only resetting some components, and reusing shared ones (this bit isn't actually implemented yet).
Measurements are stored in an overallocated way, meaning there is always storage for the maximum measurement dimension.
MultiTrajectory
can be queried for a track state representation at given index. This will return a TrackStateProxy
. Track state proxies have getters for all components, and where possible, will return mutable (or immutable in case of a const proxy) references (sometimes implemented as Eigen map types). This means you can write things like
auto trackstate = trajectory.getTrackState(4);
trackstate.filtered() = (A * B + C).inverse()
and the result will end up in the backing storage of MultiTrajectory
. Methods for the calibrated measurement are implemented as both returning the actual overallocated backing storage matrix, as well as an effective matrix. The latter are in fact dynamic views into the static matrices, and thus should be avoided in any kind of context where performance is relevant.
The new EDM is used in the updated gain matrix updator and smoother. Here, the measurement visitor (see !598 (merged)), to dispatch a statically sized calculation based on the runtime measurement value that is stored in the trajectory.
This MR requires !598 (merged) and !596 (merged) to be merged first (i.e. includes their changes)
Closes #564 (closed) Closes #550 (closed)