Skip to content

Commit

Permalink
Allows PSim to run without sun vectors (#350)
Browse files Browse the repository at this point in the history
* Fixed fc model to work without sun vector

* Formatting
  • Loading branch information
govindchari authored Sep 27, 2021
1 parent a481711 commit 13824df
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/psim/fc/attitude_estimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ void AttitudeEstimator::step() {
}
// Attempt to reset the current estimate if it isn't valid.
else {
if (lin::all(lin::isfinite(t)) && lin::all(lin::isfinite(r)) &&
lin::all(lin::isfinite(b)) && lin::all(lin::isfinite(s)))
if (!lin::all(lin::isfinite(s))) {
gnc::attitude_estimator_reset(
_attitude_state, t, {0.0f, 0.0f, 0.0f, 1.0f});
} else if (lin::all(lin::isfinite(t)) && lin::all(lin::isfinite(r)) &&
lin::all(lin::isfinite(b)))
gnc::attitude_estimator_reset(_attitude_state, t, r, b, s);
}

Expand Down

0 comments on commit 13824df

Please sign in to comment.