Fix Attitude Estimator Sun Vector Representation #289
Merged
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.
Fix Attitude Estimator Sun Vector Representation
Fixes #229.
Summary of changes
The attitude estimator was having difficulty in processing sun vectors when the expected measurement was nearly aligned with the body z axis. Given the filter used a spherical angle sun vector representation, some of the generated sigma points would have
phi
values nearly 180 degrees apart from one another (if a sigma point rotation tipped the expected sun vector measurement over top of the z axis). This caused the filter to have severe stability issues.To remedy this, an extra transformation bringing the sun vector to the x axis is applied to all measurements. This ensures our noise representation is spherical coordinates doesn't exhibit large nonlinearities.
Testing
Plots were generated using the following command (note PRs through #288 are required for testing):
Before the update:
After the update: