Proposed UpperTriangularCovariance message #138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In most of our messages right now we transport covariance matrices as 36 64bit numbers.
This reduces it to only 21 as well as reducing the floating point representation to 32bits.
This makes it take up only 29% as much space on the wire and in memory.
The precision of the floating point values is unlikely to be important as the value is designed to capture the magnitude of the uncertainty so the 32bit representation should be fine.
And the covariance matrices are symmetric so the other half of the matrix is redundant.
With some helper methods to convert to and from full matricies in common linear math libraries it should not effect workflows.
And by standardizing this common checks can also be performed in a standardized way instead of the current ad-hoc method in each implementation.
This has been inspired by the URT covariance matrix implementation used in the vehicle_odometry.msg recently adopted by PX4: https://github.com/PX4/Firmware/pull/9895/files#diff-0f57b02da78e5e981838d756f46d7462R56
This is intended to be used mostly as a submessage for an evolution of #87