diff --git a/src/boards/Groundstation/Automated/SMController/SMController.cpp b/src/boards/Groundstation/Automated/SMController/SMController.cpp index be192bb19db78372c75ce95e2df97f3ac70a9e56..8de5dec2620daf80093d9759b3d76ff4c4b76032 100644 --- a/src/boards/Groundstation/Automated/SMController/SMController.cpp +++ b/src/boards/Groundstation/Automated/SMController/SMController.cpp @@ -174,6 +174,24 @@ void SMController::update() } break; } + // in active state, update the follower and propagator inner states + case SMControllerState::ACTIVE: + case SMControllerState::ACTIVE_NF: + { + // retrieve the last NAS Rocket state + Hub* hub = + static_cast<Hub*>(ModuleManager::getInstance().get<HubBase>()); + NASState nasState = hub->getRocketNasState(); + + // update the propagator with the NAS state + // and retrieve the propagated state + propagator.setRocketNasState(nasState); + PropagatorState predicted = propagator.getState(); + + // update the follower with the propagated state + follower.setLastRocketNasState(predicted.getNasState()); + break; + } } }