diff --git a/scripts/logdecoder/General/logdecoder.cpp b/scripts/logdecoder/General/logdecoder.cpp index 73451409ca657ab5d9168ba86829dfd049c4cba4..5067a223b56c3a4bb8a9df9cf3a7a196994f1076 100644 --- a/scripts/logdecoder/General/logdecoder.cpp +++ b/scripts/logdecoder/General/logdecoder.cpp @@ -23,6 +23,7 @@ #include <Groundstation/Automated/Actuators/ActuatorsData.h> #include <Groundstation/Automated/PinHandler/PinData.h> #include <Groundstation/Automated/SMA/SMAData.h> +#include <Groundstation/LyraGS/Radio/RadioData.h> #include <Main/PinHandler/PinData.h> #include <Main/Sensors/SensorsData.h> #include <Main/StateMachines/ABKController/ABKControllerData.h> @@ -44,6 +45,7 @@ #include <RIGv2/StateMachines/GroundModeManager/GroundModeManagerData.h> #include <RIGv2/StateMachines/TARS1/TARS1Data.h> #include <algorithms/MEA/MEAData.h> +#include <algorithms/Propagator/PropagatorData.h> #include <logger/Deserializer.h> #include <logger/LogTypes.h> #include <tscpp/stream.h> @@ -121,8 +123,14 @@ void registerTypes(Deserializer& ds) // Groundstation (ARP) ds.registerType<Antennas::StepperXData>(); ds.registerType<Antennas::StepperYData>(); + ds.registerType<VN300Data>(); + ds.registerType<NASState>(); + ds.registerType<PropagatorState>(); + ds.registerType<AntennaAnglesLog>(); + ds.registerType<GPSData>(); ds.registerType<Antennas::SMAStatus>(); ds.registerType<Antennas::PinChangeData>(); + ds.registerType<LyraGS::MainRadioLog>(); } void showUsage(const string& cmdName) diff --git a/src/Groundstation/Automated/SMA/SMA.cpp b/src/Groundstation/Automated/SMA/SMA.cpp index 48bcba68d7a7cfada77c21b56e8101a9e612cd22..7ae4e1da99c375e38c16d9c56137f0664dd1405e 100644 --- a/src/Groundstation/Automated/SMA/SMA.cpp +++ b/src/Groundstation/Automated/SMA/SMA.cpp @@ -238,7 +238,6 @@ void SMA::update() AntennaAngles target = follower.getTargetAngles(); Boardcore::Logger::getInstance().log( Boardcore::AntennaAnglesLog(target, predicted.nPropagations)); - Boardcore::Logger::getInstance().log(predicted.getNasState()); // actuate the steppers auto steppers = getModule<Actuators>(); @@ -304,7 +303,6 @@ void SMA::update() AntennaAngles target = follower.getTargetAngles(); Boardcore::Logger::getInstance().log( Boardcore::AntennaAnglesLog(target, predicted.nPropagations)); - Boardcore::Logger::getInstance().log(predicted.getNasState()); // actuate the steppers steppers->setSpeed(StepperList::STEPPER_X, follow.horizontalSpeed); diff --git a/src/Groundstation/LyraGS/BoardStatus.h b/src/Groundstation/LyraGS/BoardStatus.h index 4c12388bc2ebb9d1cfab4ea3c1962786a8b204f0..b778f205006a9a7dffd023532f20cf43dc7b22a2 100644 --- a/src/Groundstation/LyraGS/BoardStatus.h +++ b/src/Groundstation/LyraGS/BoardStatus.h @@ -32,6 +32,7 @@ #include <Groundstation/Common/Radio/RadioBase.h> #include <Groundstation/LyraGS/Ports/Ethernet.h> #include <Groundstation/LyraGS/Radio/Radio.h> +#include <Groundstation/LyraGS/Radio/RadioData.h> #include <common/MavlinkLyra.h> #include <drivers/timer/TimestampTimer.h> #include <utils/DependencyManager/DependencyManager.h> @@ -43,36 +44,6 @@ class RadioMain; class RadioPayload; class EthernetGS; -/** - * @brief Logging struct for the main radio informations - * - */ -struct MainRadioLog -{ - uint64_t timestamp = 0; - uint16_t main_packet_tx_error_count = 0; - uint32_t main_tx_bitrate = 0; - uint16_t main_packet_rx_success_count = 0; - uint16_t main_packet_rx_drop_count = 0; - uint32_t main_rx_bitrate = 0; - float main_rx_rssi = 0; - - static std::string header() - { - return "timestamp,main_packet_tx_error_count,main_tx_bitrate,main_" - "packet_rx_success_count,main_packet_rx_drop_count,main_rx_" - "bitrate,main_rx_rssi\n"; - } - - void print(std::ostream& os) const - { - os << timestamp << "," << main_packet_tx_error_count << "," - << main_tx_bitrate << "," << main_tx_bitrate << "," - << main_packet_rx_success_count << "," << main_packet_rx_drop_count - << "," << main_rx_bitrate << "," << main_rx_rssi << "\n"; - } -}; - /** * @brief Utility to calculate the bitrate */ diff --git a/src/Groundstation/LyraGS/Radio/RadioData.h b/src/Groundstation/LyraGS/Radio/RadioData.h new file mode 100644 index 0000000000000000000000000000000000000000..5edb3ce4b88e6c0e72b235222a9d0aec2e1bfd47 --- /dev/null +++ b/src/Groundstation/LyraGS/Radio/RadioData.h @@ -0,0 +1,62 @@ +/* Copyright (c) 2024 Skyward Experimental Rocketry + * Author: Nicolò Caruso + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include <stdint.h> + +#include <iostream> +#include <string> + +/** + * @brief Logging struct for the main radio informations + * + */ + +namespace LyraGS +{ +struct MainRadioLog +{ + uint64_t timestamp = 0; + uint16_t main_packet_tx_error_count = 0; + uint32_t main_tx_bitrate = 0; + uint16_t main_packet_rx_success_count = 0; + uint16_t main_packet_rx_drop_count = 0; + uint32_t main_rx_bitrate = 0; + float main_rx_rssi = 0; + + static std::string header() + { + return "timestamp,main_packet_tx_error_count,main_tx_bitrate,main_" + "packet_rx_success_count,main_packet_rx_drop_count,main_rx_" + "bitrate,main_rx_rssi\n"; + } + + void print(std::ostream& os) const + { + os << timestamp << "," << main_packet_tx_error_count << "," + << main_tx_bitrate << "," << main_tx_bitrate << "," + << main_packet_rx_success_count << "," << main_packet_rx_drop_count + << "," << main_rx_bitrate << "," << main_rx_rssi << "\n"; + } +}; +} // namespace LyraGS