diff --git a/CMakeLists.txt b/CMakeLists.txt index 1902a11e287e5a8d2e1ebe2c2e0f5b8eae44a0c1..f624ae63af374cc09840df2d24f51668144e41c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,13 +98,6 @@ add_executable(nokia-groundstation-entry target_include_directories(nokia-groundstation-entry PRIVATE ${OBSW_INCLUDE_DIRS}) sbs_target(nokia-groundstation-entry stm32f429zi_nokia) -add_executable(test-actuators - src/Groundstation/Automated/test-actuators.cpp - ${LYRA_GS} ${GROUNDSTATION_COMMON} -) -target_include_directories(test-actuators PRIVATE ${OBSW_INCLUDE_DIRS}) -sbs_target(test-actuators stm32f767zi_lyra_gs) - add_executable(lyra-gs-entry src/Groundstation/LyraGS/lyra-gs-entry.cpp ${LYRA_GS} ${GROUNDSTATION_COMMON} diff --git a/src/Groundstation/Automated/Hub.cpp b/src/Groundstation/Automated/Hub.cpp index c1917662ef24774d8bd9e4005c2eec162e0117d5..523568364cb10c1b4058794a0ceb4c4bd1f7acc6 100644 --- a/src/Groundstation/Automated/Hub.cpp +++ b/src/Groundstation/Automated/Hub.cpp @@ -357,7 +357,11 @@ bool Hub::getLastRocketNasState(Boardcore::NASState& nasState) return rocketNasSet; } -bool Hub::hasNewNasState() { return hasNewNasSet; } +bool Hub::hasNewNasState() +{ + Lock<FastMutex> lock(nasStateMutex); + return hasNewNasSet; +} void Hub::setRocketNasState(const NASState& newRocketNasState) { @@ -371,4 +375,5 @@ void Hub::setRocketOrigin(const GPSData& newRocketCoordinates) { Lock<FastMutex> lock(coordinatesMutex); lastRocketCoordinates = newRocketCoordinates; + originReceived = true; } diff --git a/src/Groundstation/Automated/SMA/SMA.cpp b/src/Groundstation/Automated/SMA/SMA.cpp index cbf1c546101a1ab253b978cfa1f6497c29f7300a..3470e27dbf793b0fad558fb8187b41d5324ab666 100644 --- a/src/Groundstation/Automated/SMA/SMA.cpp +++ b/src/Groundstation/Automated/SMA/SMA.cpp @@ -94,7 +94,8 @@ void SMA::setRocketNASOrigin(const Boardcore::GPSData& rocketCoordinates) ActuationStatus SMA::moveStepperDeg(StepperList stepperId, float angle) { - if (!testState(&SMA::state_test) && !testState(&SMA::state_test_nf)) + if (!testState(&SMA::state_test) && !testState(&SMA::state_test_nf) && + !testState(&SMA::state_calibrate)) { LOG_ERR(logger, "Stepper can only be manually moved in the TEST state"); return ActuationStatus::NOT_TEST; @@ -199,6 +200,7 @@ void SMA::update() } break; } + // TODO: See if semantically what we want // in fix_rocket state, wait for the GPS fix of the rocket case SMAState::FIX_ROCKET: case SMAState::FIX_ROCKET_NF: @@ -223,8 +225,8 @@ void SMA::update() // retrieve the last NAS Rocket state NASState nasState; + // In case there is a new NAS packet if (hub->hasNewNasState() && hub->getLastRocketNasState(nasState)) - // update the propagator with the NAS state // and retrieve the propagated state propagator.setRocketNasState(nasState);