diff --git a/skyward-boardcore b/skyward-boardcore index a9d67d2c6c604c11313c18943dc6df66f8cdacbf..f7b675932bd970091683306fdb1bc66622c13b2c 160000 --- a/skyward-boardcore +++ b/skyward-boardcore @@ -1 +1 @@ -Subproject commit a9d67d2c6c604c11313c18943dc6df66f8cdacbf +Subproject commit f7b675932bd970091683306fdb1bc66622c13b2c diff --git a/src/boards/Groundstation/Automated/BoardStatus.cpp b/src/boards/Groundstation/Automated/BoardStatus.cpp index de837b3a7b005f84b31b61c7abe21c2c9343bedc..beb13b1bc9656c8d4f47b4f72e38b936da5bb608 100644 --- a/src/boards/Groundstation/Automated/BoardStatus.cpp +++ b/src/boards/Groundstation/Automated/BoardStatus.cpp @@ -64,19 +64,21 @@ void BoardStatus::run() while (!shouldStop()) { miosix::Thread::sleep(Groundstation::RADIO_STATUS_PERIOD); + ModuleManager &modules = ModuleManager::getInstance(); - auto vn300 = - ModuleManager::getInstance().get<Sensors>()->getVN300LastSample(); + auto vn300 = modules.get<Sensors>()->getVN300LastSample(); - Actuators *actuators = ModuleManager::getInstance().get<Actuators>(); - AntennaAngles targetAngles = - ModuleManager::getInstance().get<SMController>()->getTargetAngles(); + Actuators *actuators = modules.get<Actuators>(); + SMController *sm = modules.get<SMController>(); + + AntennaAngles targetAngles = sm->getTargetAngles(); mavlink_arp_tm_t tm = {0}; - tm.timestamp = TimestampTimer::getTimestamp(); /*< [us] Timestamp*/ - tm.yaw = vn300.yaw; /*< [deg] Current Yaw*/ - tm.pitch = vn300.pitch; /*< [deg] Current Pitch*/ - tm.roll = vn300.roll; /*< [deg] Current Roll*/ + tm.timestamp = TimestampTimer::getTimestamp(); /*< [us] Timestamp*/ + tm.state = static_cast<uint8_t>(sm->getStatus().state); /*< State*/ + tm.yaw = vn300.yaw; /*< [deg] Current Yaw*/ + tm.pitch = vn300.pitch; /*< [deg] Current Pitch*/ + tm.roll = vn300.roll; /*< [deg] Current Roll*/ tm.target_yaw = targetAngles.yaw; /*< [deg] Target Yaw*/ tm.target_pitch = targetAngles.pitch; /*< [deg] Target Pitch*/ tm.stepperX_pos = actuators->getCurrentDegPosition( diff --git a/src/boards/Groundstation/Automated/SMController/SMController.h b/src/boards/Groundstation/Automated/SMController/SMController.h index bddb7ff85f0b5ccaca9bd8374f79139ee491bae4..8236f5a5de871756d01d700dfb98dffed5163e16 100644 --- a/src/boards/Groundstation/Automated/SMController/SMController.h +++ b/src/boards/Groundstation/Automated/SMController/SMController.h @@ -106,6 +106,11 @@ public: return follower.getTargetAngles(); } + /** + * @brief Getter for the current state of the FSM + */ + SMControllerStatus getStatus() { return status; } + private: /** * @brief Logs the current state of the FSM