-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exceed Covariance Norm #830
base: master
Are you sure you want to change the base?
Conversation
…e field to trigger reset, added ptest case and am waiting to receive values to write the state field to trigger the reset
.github/workflows/hootl.yml
Outdated
@@ -56,6 +56,7 @@ jobs: | |||
!(python -m ptest runsim -c ptest/configs/hootl_speedup.json -t FailingEmptyCase -ni) | |||
!(python -m ptest runsim -c ptest/configs/hootl_speedup.json -t FailingEmptySimCase -ni) | |||
python -m ptest runsim -c ptest/configs/hootl.json -t AttitudeNoSunVectorsInitializationCase -ni | |||
python -m ptest runsim -c ptest/configs/hootl.json -t AttitudePersistanceExceededCase - ni |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove space -ni
@@ -217,7 +221,7 @@ void AttitudeEstimator::_execute() | |||
gnc::attitude_estimator_reset( | |||
_state, time_s, {0.0f, 0.0f, 0.0f, 1.0f}); | |||
} | |||
else if (adcs_ssa_valid) | |||
else if ((adcs_ssa_valid) || (exceed_persistance)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the logic we want? a comment explaining the logic/reasoning would be helpful here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a closer look at the code I realized I need to account for ssa valid vs invalid. In terms of what this does, I wanted to write something that would trigger attitude estimator reset if value is exceeded, but was unsure as to which reset it would be "gnc::attitude_estimator_reset(
_state, time_s, {0.0f, 0.0f, 0.0f, 1.0f});" or "gnc::attitude_estimator_reset(
_state, time_s, orbit_pos, b_body, adcs_ssa);"
@@ -0,0 +1,855 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think we need this file
…baseline with safety factor
@@ -43,6 +44,7 @@ AttitudeEstimator::AttitudeEstimator(StateFieldRegistry ®istry) | |||
attitude_estimator_reset_cmd_f("attitude_estimator.reset_cmd", Serializer<bool>()), | |||
attitude_estimator_mag_flag_f("attitude_estimator.mag_flag", Serializer<bool>(), 1), | |||
attitude_estimator_ignore_sun_vectors_f("attitude_estimator.ignore_sun_vectors", Serializer<bool>(), 1), | |||
attitude_estimator_reset_persistance_reached("attitude_estimator.reset_persistance_reached", Serializer<bool>(), 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why an eeprom save field value of zero here?
/* The Current Frobenius Norm */ | ||
|
||
float fro_norm= lin::fro(lin::nans<lin::Vector3d>()); | ||
|
||
/* Make sure to set the attitude_estimator_reset_persistance_reached to false check this, this is the logic | ||
that triggers the state field to allow for a reset of attitude_estimator. Once you exceed baseline frobenius norm | ||
* 1000 (for the safety factor), trigger the persistance state field, accounting for SSA valid and invalid. */ | ||
|
||
if (fro_norm > 3.86e-7 * 1000 && !adcs_ssa_valid) { | ||
attitude_estimator_reset_persistance_reached.set(true); | ||
} | ||
|
||
else if (fro_norm > 8.35e-10 * 1000 && adcs_ssa_valid) { | ||
attitude_estimator_reset_persistance_reached.set(true); | ||
} | ||
|
||
auto const exceed_persistance = attitude_estimator_reset_persistance_reached.get(); | ||
|
||
/* One if statement for no ssa covariance and one if statement for ssa valid covariance */ | ||
|
||
if (!adcs_ssa_valid && exceed_persistance) { | ||
gnc::attitude_estimator_reset(_state, time_s, {0.0f, 0.0f, 0.0f, 1.0f}); | ||
} | ||
else if (adcs_ssa_valid && exceed_persistance) { | ||
gnc::attitude_estimator_reset(_state, time_s, orbit_pos, b_body, adcs_ssa); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* first commit :) * not working init flows * fixed error * small change * add adcs wheel1 faults * . * . * . Co-authored-by: Angela Loh <[email protected]>
…r-for-autonomous-navigation/FlightSoftware into exceed_covariance_norm
…e field to trigger reset, added ptest case and am waiting to receive values to write the state field to trigger the reset
…baseline with safety factor
We added persistence logic, created a writeable state field for the safety factor, and modified our ptest case to trigger the gnc::attitude_estimator_reset. The pictures above show the print statements we used to verify that a reset had occurred, and we tested by setting the safety factor extremely low to guarantee the triggering of exceed_persistance. |
We should close this PR as we unfortunately didn't have time to add this to the final FSW package. |
Modified Attitude_estimator ptest case and supporting files for a scenario that has been constructed (nothing written inside) for exceeding covariance norm. Added logic in attitude_estimator suite of files to trigger a reset when state field attitude_estimator_reset_persistance_reached becomes true (which triggers exceed_persistence), which could first be tested by manually triggering it in the ptest case but then adding the logic within attitude_estimator to trigger upon reaching some covariance.