From 18d1235c1351d34a152d1302979ab016f64be38c Mon Sep 17 00:00:00 2001 From: Fabrizio Monti <fabrizio.monti@skywarder.eu> Date: Wed, 23 Apr 2025 13:52:16 +0200 Subject: [PATCH] [ENGINE] Changed nomenclature (from motor to engine) inside src/Engine folder and within the log decoder. --- CMakeLists.txt | 6 +-- cmake/dependencies.cmake | 12 +++--- scripts/logdecoder/General/logdecoder.cpp | 14 +++---- scripts/logdecoder/Motor/logdecoder.cpp | 6 +-- src/Engine/Actuators/Actuators.cpp | 6 +-- src/Engine/Actuators/Actuators.h | 8 ++-- src/Engine/Actuators/ActuatorsData.h | 4 +- src/Engine/BoardScheduler.h | 6 +-- src/Engine/Buses.h | 4 +- src/Engine/CanHandler/CanHandler.cpp | 8 ++-- src/Engine/CanHandler/CanHandler.h | 10 ++--- src/Engine/Configs/ActuatorsConfig.h | 4 +- src/Engine/Configs/CanHandlerConfig.h | 4 +- src/Engine/Configs/HILSimulationConfig.h | 4 +- src/Engine/Configs/SchedulerConfig.h | 4 +- src/Engine/Configs/SensorsConfig.h | 4 +- src/Engine/HIL/HIL.cpp | 44 ++++++++++---------- src/Engine/HIL/HIL.h | 32 +++++++------- src/Engine/HIL/HILData.h | 12 +++--- src/Engine/PersistentVars/PersistentVars.cpp | 4 +- src/Engine/PersistentVars/PersistentVars.h | 4 +- src/Engine/Sensors/HILSensors.h | 14 +++---- src/Engine/Sensors/KuliteThermocouple.h | 6 +-- src/Engine/Sensors/Sensors.cpp | 8 ++-- src/Engine/Sensors/Sensors.h | 10 ++--- src/Engine/Sensors/SensorsData.h | 4 +- src/Engine/engine-entry.cpp | 22 +++++----- 27 files changed, 132 insertions(+), 132 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34f5723f2..3eb32d9e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,9 +64,9 @@ target_include_directories(payload-entry-euroc PRIVATE ${OBSW_INCLUDE_DIRS}) target_compile_definitions(payload-entry-euroc PRIVATE EUROC) sbs_target(payload-entry-euroc stm32f767zi_lyra_biscotto) -add_executable(motor-entry src/Motor/motor-entry.cpp ${MOTOR_SOURCES}) -target_include_directories(motor-entry PRIVATE ${OBSW_INCLUDE_DIRS}) -sbs_target(motor-entry stm32f767zi_orion_engine) +add_executable(engine-entry src/Engine/engine-entry.cpp ${ENGINE_SOURCES}) +target_include_directories(engine-entry PRIVATE ${OBSW_INCLUDE_DIRS}) +sbs_target(engine-entry stm32f767zi_orion_engine) add_executable(rig-v2-entry src/RIGv2/rig-v2-entry.cpp ${RIG_V2_COMPUTER}) target_include_directories(rig-v2-entry PRIVATE ${OBSW_INCLUDE_DIRS}) diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 31286e428..e03e2ad7f 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -49,12 +49,12 @@ set(GROUNDSTATION_COMMON src/Groundstation/Common/HubBase.cpp ) -set(MOTOR_SOURCES - src/Motor/PersistentVars/PersistentVars.cpp - src/Motor/HIL/HIL.cpp - src/Motor/Actuators/Actuators.cpp - src/Motor/Sensors/Sensors.cpp - src/Motor/CanHandler/CanHandler.cpp +set(ENGINE_SOURCES + src/Engine/PersistentVars/PersistentVars.cpp + src/Engine/HIL/HIL.cpp + src/Engine/Actuators/Actuators.cpp + src/Engine/Sensors/Sensors.cpp + src/Engine/CanHandler/CanHandler.cpp ) set(RIG_V2_COMPUTER diff --git a/scripts/logdecoder/General/logdecoder.cpp b/scripts/logdecoder/General/logdecoder.cpp index a2cb68047..3e9e5cf83 100644 --- a/scripts/logdecoder/General/logdecoder.cpp +++ b/scripts/logdecoder/General/logdecoder.cpp @@ -30,8 +30,8 @@ #include <Main/StateMachines/FlightModeManager/FlightModeManagerData.h> #include <Main/StateMachines/MEAController/MEAControllerData.h> #include <Main/StateMachines/NASController/NASControllerData.h> -#include <Motor/Actuators/ActuatorsData.h> -#include <Motor/Sensors/SensorsData.h> +#include <Engine/Actuators/ActuatorsData.h> +#include <Engine/Sensors/SensorsData.h> #include <Payload/PinHandler/PinData.h> #include <Payload/Sensors/SensorData.h> #include <Payload/StateMachines/FlightModeManager/FlightModeManagerData.h> @@ -90,11 +90,11 @@ void registerTypes(Deserializer& ds) ds.registerType<Main::CalibrationData>(); // Engine - ds.registerType<Motor::OxTopTankPressureData>(); - ds.registerType<Motor::OxBottomTankPressureData>(); - ds.registerType<Motor::N2TankPressureData>(); - ds.registerType<Motor::CCPressureData>(); - ds.registerType<Motor::ActuatorsData>(); + ds.registerType<Engine::OxTopTankPressureData>(); + ds.registerType<Engine::OxBottomTankPressureData>(); + ds.registerType<Engine::N2TankPressureData>(); + ds.registerType<Engine::CCPressureData>(); + ds.registerType<Engine::ActuatorsData>(); // Payload ds.registerType<Payload::FlightModeManagerStatus>(); diff --git a/scripts/logdecoder/Motor/logdecoder.cpp b/scripts/logdecoder/Motor/logdecoder.cpp index 709f6c5d2..451f27d63 100644 --- a/scripts/logdecoder/Motor/logdecoder.cpp +++ b/scripts/logdecoder/Motor/logdecoder.cpp @@ -20,8 +20,8 @@ * THE SOFTWARE. */ -#include <Motor/Actuators/ActuatorsData.h> -#include <Motor/Sensors/SensorsData.h> +#include <Engine/Actuators/ActuatorsData.h> +#include <Engine/Sensors/SensorsData.h> #include <logger/Deserializer.h> #include <logger/LogTypes.h> #include <tscpp/stream.h> @@ -43,7 +43,7 @@ using namespace tscpp; using namespace Boardcore; -using namespace Motor; +using namespace Engine; void registerTypes(Deserializer& ds) { diff --git a/src/Engine/Actuators/Actuators.cpp b/src/Engine/Actuators/Actuators.cpp index 70878c249..446cbffa3 100644 --- a/src/Engine/Actuators/Actuators.cpp +++ b/src/Engine/Actuators/Actuators.cpp @@ -22,13 +22,13 @@ #include "Actuators.h" -#include <Motor/Actuators/ActuatorsData.h> -#include <Motor/Configs/ActuatorsConfig.h> +#include <Engine/Actuators/ActuatorsData.h> +#include <Engine/Configs/ActuatorsConfig.h> #include <interfaces-impl/hwmapping.h> using namespace miosix; using namespace Boardcore; -using namespace Motor; +using namespace Engine; void Actuators::ServoInfo::openServoWithTime(uint32_t time) { diff --git a/src/Engine/Actuators/Actuators.h b/src/Engine/Actuators/Actuators.h index 2cfad5c92..177854541 100644 --- a/src/Engine/Actuators/Actuators.h +++ b/src/Engine/Actuators/Actuators.h @@ -22,13 +22,13 @@ #pragma once -#include <Motor/BoardScheduler.h> -#include <Motor/CanHandler/CanHandler.h> +#include <Engine/BoardScheduler.h> +#include <Engine/CanHandler/CanHandler.h> #include <actuators/Servo/Servo.h> #include <common/MavlinkOrion.h> #include <utils/DependencyManager/DependencyManager.h> -namespace Motor +namespace Engine { class Actuators @@ -79,4 +79,4 @@ private: std::array<ServoInfo, 4> infos; }; -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/Actuators/ActuatorsData.h b/src/Engine/Actuators/ActuatorsData.h index a623c9a32..99f5db798 100644 --- a/src/Engine/Actuators/ActuatorsData.h +++ b/src/Engine/Actuators/ActuatorsData.h @@ -25,7 +25,7 @@ #include <cstdint> #include <ostream> -namespace Motor +namespace Engine { struct ActuatorsData { @@ -53,4 +53,4 @@ struct ActuatorsData } }; -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/BoardScheduler.h b/src/Engine/BoardScheduler.h index 503908b53..fb8dadab1 100644 --- a/src/Engine/BoardScheduler.h +++ b/src/Engine/BoardScheduler.h @@ -22,11 +22,11 @@ #pragma once -#include <Motor/Configs/SchedulerConfig.h> +#include <Engine/Configs/SchedulerConfig.h> #include <scheduler/TaskScheduler.h> #include <utils/DependencyManager/DependencyManager.h> -namespace Motor +namespace Engine { class BoardScheduler : public Boardcore::Injectable @@ -69,4 +69,4 @@ private: Boardcore::TaskScheduler actuators; }; -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/Buses.h b/src/Engine/Buses.h index 62a25fde5..3efddfc12 100644 --- a/src/Engine/Buses.h +++ b/src/Engine/Buses.h @@ -26,7 +26,7 @@ #include <drivers/usart/USART.h> #include <utils/DependencyManager/DependencyManager.h> -namespace Motor +namespace Engine { class Buses : public Boardcore::Injectable @@ -50,4 +50,4 @@ private: Boardcore::USART usart4{UART4, 256000, 1024}; }; -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/CanHandler/CanHandler.cpp b/src/Engine/CanHandler/CanHandler.cpp index 8a26ffb3d..110479751 100644 --- a/src/Engine/CanHandler/CanHandler.cpp +++ b/src/Engine/CanHandler/CanHandler.cpp @@ -22,14 +22,14 @@ #include "CanHandler.h" -#include <Motor/Actuators/Actuators.h> -#include <Motor/Configs/CanHandlerConfig.h> -#include <Motor/Configs/SchedulerConfig.h> +#include <Engine/Actuators/Actuators.h> +#include <Engine/Configs/CanHandlerConfig.h> +#include <Engine/Configs/SchedulerConfig.h> #include <common/CanConfig.h> #include <drivers/timer/TimestampTimer.h> #include <events/EventData.h> -using namespace Motor; +using namespace Engine; using namespace Boardcore; using namespace Canbus; using namespace Common; diff --git a/src/Engine/CanHandler/CanHandler.h b/src/Engine/CanHandler/CanHandler.h index c29da6fd3..464cc9b75 100644 --- a/src/Engine/CanHandler/CanHandler.h +++ b/src/Engine/CanHandler/CanHandler.h @@ -22,16 +22,16 @@ #pragma once -#include <Motor/BoardScheduler.h> -#include <Motor/PersistentVars/PersistentVars.h> -#include <Motor/Sensors/Sensors.h> +#include <Engine/BoardScheduler.h> +#include <Engine/PersistentVars/PersistentVars.h> +#include <Engine/Sensors/Sensors.h> #include <common/CanConfig.h> #include <drivers/canbus/CanProtocol/CanProtocol.h> #include <utils/DependencyManager/DependencyManager.h> #include <atomic> -namespace Motor +namespace Engine { class Actuators; @@ -67,4 +67,4 @@ private: Boardcore::Canbus::CanProtocol protocol; }; -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/Configs/ActuatorsConfig.h b/src/Engine/Configs/ActuatorsConfig.h index 820b74693..108e4ad0e 100644 --- a/src/Engine/Configs/ActuatorsConfig.h +++ b/src/Engine/Configs/ActuatorsConfig.h @@ -25,7 +25,7 @@ #include <interfaces-impl/hwmapping.h> #include <units/Frequency.h> -namespace Motor +namespace Engine { namespace Config @@ -64,4 +64,4 @@ constexpr bool N2_QUENCHING_FLIPPED = true; } // namespace Servos } // namespace Config -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/Configs/CanHandlerConfig.h b/src/Engine/Configs/CanHandlerConfig.h index dca3dbc19..b9ce955aa 100644 --- a/src/Engine/Configs/CanHandlerConfig.h +++ b/src/Engine/Configs/CanHandlerConfig.h @@ -26,7 +26,7 @@ #include <chrono> -namespace Motor +namespace Engine { namespace Config @@ -50,4 +50,4 @@ constexpr Hertz TEMPERATURE_PERIOD = 10_hz; } // namespace Config -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/Configs/HILSimulationConfig.h b/src/Engine/Configs/HILSimulationConfig.h index 254974618..2fb42e781 100644 --- a/src/Engine/Configs/HILSimulationConfig.h +++ b/src/Engine/Configs/HILSimulationConfig.h @@ -31,7 +31,7 @@ /* linter off */ using namespace Boardcore::Units::Frequency; -namespace Motor +namespace Engine { namespace Config { @@ -51,4 +51,4 @@ static_assert(N_DATA_BARO_CHAMBER * SIMULATION_RATE >= Sensors::ADS131M08::RATE, } // namespace HIL } // namespace Config -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/Configs/SchedulerConfig.h b/src/Engine/Configs/SchedulerConfig.h index ec35d17a4..2bc58620b 100644 --- a/src/Engine/Configs/SchedulerConfig.h +++ b/src/Engine/Configs/SchedulerConfig.h @@ -24,7 +24,7 @@ #include <miosix.h> -namespace Motor +namespace Engine { namespace Config @@ -43,4 +43,4 @@ static const miosix::Priority CAN_PRIORITY = miosix::PRIORITY_MAX - 1; } // namespace Config -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/Configs/SensorsConfig.h b/src/Engine/Configs/SensorsConfig.h index 5f5451d07..fe21e84b3 100644 --- a/src/Engine/Configs/SensorsConfig.h +++ b/src/Engine/Configs/SensorsConfig.h @@ -29,7 +29,7 @@ #include <sensors/LSM6DSRX/LSM6DSRX.h> #include <units/Units.h> -namespace Motor +namespace Engine { namespace Config @@ -188,4 +188,4 @@ constexpr bool ENABLED = true; } // namespace Config -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/HIL/HIL.cpp b/src/Engine/HIL/HIL.cpp index 233886465..3583f2e81 100644 --- a/src/Engine/HIL/HIL.cpp +++ b/src/Engine/HIL/HIL.cpp @@ -22,24 +22,24 @@ #include "HIL.h" -#include <Motor/Actuators/Actuators.h> -#include <Motor/Buses.h> -#include <Motor/Configs/HILSimulationConfig.h> +#include <Engine/Actuators/Actuators.h> +#include <Engine/Buses.h> +#include <Engine/Configs/HILSimulationConfig.h> #include <common/Events.h> #include <events/EventBroker.h> #include <hil/HIL.h> #include "HILData.h" -namespace Motor +namespace Engine { -MotorHILPhasesManager::MotorHILPhasesManager( +EngineHILPhasesManager::EngineHILPhasesManager( std::function<Boardcore::TimedTrajectoryPoint()> getCurrentPosition) - : Boardcore::HILPhasesManager<MotorFlightPhases, SimulatorData, + : Boardcore::HILPhasesManager<EngineFlightPhases, SimulatorData, ActuatorData>(getCurrentPosition) { - flagsFlightPhases = {{MotorFlightPhases::SIMULATION_STARTED, false}}; + flagsFlightPhases = {{EngineFlightPhases::SIMULATION_STARTED, false}}; prev_flagsFlightPhases = flagsFlightPhases; @@ -59,9 +59,9 @@ MotorHILPhasesManager::MotorHILPhasesManager( eventBroker.subscribe(this, Common::TOPIC_ALT); } -void MotorHILPhasesManager::processFlagsImpl( +void EngineHILPhasesManager::processFlagsImpl( const SimulatorData& simulatorData, - std::vector<MotorFlightPhases>& changed_flags) + std::vector<EngineFlightPhases>& changed_flags) { if (simulatorData.signal == static_cast<float>(HILSignal::SIMULATION_STARTED)) @@ -77,24 +77,24 @@ void MotorHILPhasesManager::processFlagsImpl( } // set true when the first packet from the simulator arrives - if (isSetTrue(MotorFlightPhases::SIMULATION_STARTED)) + if (isSetTrue(EngineFlightPhases::SIMULATION_STARTED)) { t_start = Boardcore::TimestampTimer::getTimestamp(); printf("[HIL] ------- SIMULATION STARTED ! ------- \n"); - changed_flags.push_back(MotorFlightPhases::SIMULATION_STARTED); + changed_flags.push_back(EngineFlightPhases::SIMULATION_STARTED); } } -void MotorHILPhasesManager::printOutcomes() +void EngineHILPhasesManager::printOutcomes() { printf("OUTCOMES: (times dt from liftoff)\n\n"); printf("Simulation time: %.3f [sec]\n\n", (double)(t_stop - t_start) / 1000000.0f); } -void MotorHILPhasesManager::handleEventImpl( - const Boardcore::Event& e, std::vector<MotorFlightPhases>& changed_flags) +void EngineHILPhasesManager::handleEventImpl( + const Boardcore::Event& e, std::vector<EngineFlightPhases>& changed_flags) { switch (e) { @@ -103,18 +103,18 @@ void MotorHILPhasesManager::handleEventImpl( } } -MotorHIL::MotorHIL() - : Boardcore::HIL<MotorFlightPhases, SimulatorData, ActuatorData>( +EngineHIL::EngineHIL() + : Boardcore::HIL<EngineFlightPhases, SimulatorData, ActuatorData>( nullptr, nullptr, [this]() { return updateActuatorData(); }, 1000 / Config::HIL::SIMULATION_RATE.value()) { } -bool MotorHIL::start() +bool EngineHIL::start() { auto& hilUsart = getModule<Buses>()->getHILUart(); - hilPhasesManager = new MotorHILPhasesManager( + hilPhasesManager = new EngineHILPhasesManager( [&]() { Boardcore::TimedTrajectoryPoint timedTrajectoryPoint; @@ -122,13 +122,13 @@ bool MotorHIL::start() return timedTrajectoryPoint; }); - hilTransceiver = new MotorHILTransceiver(hilUsart, hilPhasesManager); + hilTransceiver = new EngineHILTransceiver(hilUsart, hilPhasesManager); - return Boardcore::HIL<MotorFlightPhases, SimulatorData, + return Boardcore::HIL<EngineFlightPhases, SimulatorData, ActuatorData>::start(); } -ActuatorData MotorHIL::updateActuatorData() +ActuatorData EngineHIL::updateActuatorData() { auto actuators = getModule<Actuators>(); @@ -143,4 +143,4 @@ ActuatorData MotorHIL::updateActuatorData() return ActuatorData{actuatorsStateHIL}; } -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/HIL/HIL.h b/src/Engine/HIL/HIL.h index 67569f4d6..1d274d89e 100644 --- a/src/Engine/HIL/HIL.h +++ b/src/Engine/HIL/HIL.h @@ -22,57 +22,57 @@ #pragma once -#include <Motor/Actuators/Actuators.h> -#include <Motor/Buses.h> -#include <Motor/Configs/HILSimulationConfig.h> +#include <Engine/Actuators/Actuators.h> +#include <Engine/Buses.h> +#include <Engine/Configs/HILSimulationConfig.h> #include <common/Events.h> #include <events/EventBroker.h> #include <hil/HIL.h> #include "HILData.h" -namespace Motor +namespace Engine { -class MotorHILTransceiver - : public Boardcore::HILTransceiver<MotorFlightPhases, SimulatorData, +class EngineHILTransceiver + : public Boardcore::HILTransceiver<EngineFlightPhases, SimulatorData, ActuatorData> { - using Boardcore::HILTransceiver<MotorFlightPhases, SimulatorData, + using Boardcore::HILTransceiver<EngineFlightPhases, SimulatorData, ActuatorData>::HILTransceiver; }; -class MotorHILPhasesManager - : public Boardcore::HILPhasesManager<MotorFlightPhases, SimulatorData, +class EngineHILPhasesManager + : public Boardcore::HILPhasesManager<EngineFlightPhases, SimulatorData, ActuatorData> { public: - explicit MotorHILPhasesManager( + explicit EngineHILPhasesManager( std::function<Boardcore::TimedTrajectoryPoint()> getCurrentPosition); void processFlagsImpl( const SimulatorData& simulatorData, - std::vector<MotorFlightPhases>& changed_flags) override; + std::vector<EngineFlightPhases>& changed_flags) override; void printOutcomes(); private: void handleEventImpl( const Boardcore::Event& e, - std::vector<MotorFlightPhases>& changed_flags) override; + std::vector<EngineFlightPhases>& changed_flags) override; }; -class MotorHIL - : public Boardcore::HIL<MotorFlightPhases, SimulatorData, ActuatorData>, +class EngineHIL + : public Boardcore::HIL<EngineFlightPhases, SimulatorData, ActuatorData>, public Boardcore::InjectableWithDeps<Buses, Actuators> { public: - MotorHIL(); + EngineHIL(); bool start() override; private: ActuatorData updateActuatorData(); }; -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/HIL/HILData.h b/src/Engine/HIL/HILData.h index 2728875d1..133b0e0a1 100644 --- a/src/Engine/HIL/HILData.h +++ b/src/Engine/HIL/HILData.h @@ -22,14 +22,14 @@ #pragma once -#include <Motor/Configs/HILSimulationConfig.h> +#include <Engine/Configs/HILSimulationConfig.h> #include <sensors/HILSimulatorData.h> -namespace Motor +namespace Engine { // Sensors Data -using MotorHILChamberBarometerData = +using EngineHILChamberBarometerData = Boardcore::BarometerSimulatorData<Config::HIL::N_DATA_BARO_CHAMBER>; enum class HILSignal : int @@ -39,7 +39,7 @@ enum class HILSignal : int SIMULATION_FORCE_LAUNCH = 3 }; -enum class MotorFlightPhases +enum class EngineFlightPhases { SIMULATION_STARTED }; @@ -88,7 +88,7 @@ struct ActuatorsStateHIL */ struct SimulatorData { - MotorHILChamberBarometerData pressureChamber; + EngineHILChamberBarometerData pressureChamber; float signal; }; @@ -109,4 +109,4 @@ struct ActuatorData void print() { actuatorsState.print(); } }; -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/PersistentVars/PersistentVars.cpp b/src/Engine/PersistentVars/PersistentVars.cpp index 4864e564d..bc0b2bf48 100644 --- a/src/Engine/PersistentVars/PersistentVars.cpp +++ b/src/Engine/PersistentVars/PersistentVars.cpp @@ -29,7 +29,7 @@ using namespace miosix; static bool PRESERVE hilMode = false; -namespace Motor +namespace Engine { namespace PersistentVars @@ -45,4 +45,4 @@ bool getHilMode() { return hilMode; } } // namespace PersistentVars -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/PersistentVars/PersistentVars.h b/src/Engine/PersistentVars/PersistentVars.h index ab9c60318..676ec3724 100644 --- a/src/Engine/PersistentVars/PersistentVars.h +++ b/src/Engine/PersistentVars/PersistentVars.h @@ -22,7 +22,7 @@ #pragma once -namespace Motor +namespace Engine { namespace PersistentVars @@ -34,4 +34,4 @@ bool getHilMode(); } // namespace PersistentVars -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/Sensors/HILSensors.h b/src/Engine/Sensors/HILSensors.h index 8e46a0ef1..493764114 100644 --- a/src/Engine/Sensors/HILSensors.h +++ b/src/Engine/Sensors/HILSensors.h @@ -21,7 +21,7 @@ */ #pragma once -#include <Motor/HIL/HIL.h> +#include <Engine/HIL/HIL.h> #include <common/CanConfig.h> #include <common/ReferenceConfig.h> #include <drivers/timer/TimestampTimer.h> @@ -30,12 +30,12 @@ #include "Sensors.h" -namespace Motor +namespace Engine { class HILSensors : public Boardcore::InjectableWithDeps<Boardcore::InjectableBase<Sensors>, - MotorHIL> + EngineHIL> { public: explicit HILSensors(bool enableHw) : Super{}, enableHw{enableHw} {} @@ -56,10 +56,10 @@ private: int getSampleCounter(int nData) { auto ts = miosix::getTime(); - auto tsSensorData = getModule<MotorHIL>()->getTimestampSimulatorData(); + auto tsSensorData = getModule<EngineHIL>()->getTimestampSimulatorData(); long long simulationPeriod = static_cast<long long>( - getModule<MotorHIL>()->getSimulationPeriod()) * + getModule<EngineHIL>()->getSimulationPeriod()) * 1e6; assert(ts >= tsSensorData && @@ -88,7 +88,7 @@ private: { Boardcore::PressureData data; - auto* sensorData = getModule<MotorHIL>()->getSensorData(); + auto* sensorData = getModule<EngineHIL>()->getSensorData(); int iCC = getSampleCounter(sensorData->pressureChamber.NDATA); @@ -101,4 +101,4 @@ private: bool enableHw; }; -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/Sensors/KuliteThermocouple.h b/src/Engine/Sensors/KuliteThermocouple.h index 99f241b0c..acdc04c2c 100644 --- a/src/Engine/Sensors/KuliteThermocouple.h +++ b/src/Engine/Sensors/KuliteThermocouple.h @@ -22,12 +22,12 @@ #pragma once -#include <Motor/Sensors/SensorsData.h> +#include <Engine/Sensors/SensorsData.h> #include <sensors/Sensor.h> #include <functional> -namespace Motor +namespace Engine { class KuliteThermocouple : public Boardcore::Sensor<Boardcore::TemperatureData> @@ -61,4 +61,4 @@ private: const float offset; }; -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/Sensors/Sensors.cpp b/src/Engine/Sensors/Sensors.cpp index 95916ba97..657c256fd 100644 --- a/src/Engine/Sensors/Sensors.cpp +++ b/src/Engine/Sensors/Sensors.cpp @@ -22,12 +22,12 @@ #include "Sensors.h" -#include <Motor/Buses.h> -#include <Motor/Configs/SensorsConfig.h> -#include <Motor/Sensors/SensorsData.h> +#include <Engine/Buses.h> +#include <Engine/Configs/SensorsConfig.h> +#include <Engine/Sensors/SensorsData.h> #include <interfaces-impl/hwmapping.h> -using namespace Motor; +using namespace Engine; using namespace Boardcore; using namespace miosix; diff --git a/src/Engine/Sensors/Sensors.h b/src/Engine/Sensors/Sensors.h index 810fbfc22..7294874e8 100644 --- a/src/Engine/Sensors/Sensors.h +++ b/src/Engine/Sensors/Sensors.h @@ -22,9 +22,9 @@ #pragma once -#include <Motor/BoardScheduler.h> -#include <Motor/Buses.h> -#include <Motor/Sensors/KuliteThermocouple.h> +#include <Engine/BoardScheduler.h> +#include <Engine/Buses.h> +#include <Engine/Sensors/KuliteThermocouple.h> #include <drivers/adc/InternalADC.h> #include <scheduler/TaskScheduler.h> #include <sensors/ADS131M08/ADS131M08.h> @@ -39,7 +39,7 @@ #include <memory> #include <vector> -namespace Motor +namespace Engine { class Sensors : public Boardcore::InjectableWithDeps<Buses, BoardScheduler> @@ -135,4 +135,4 @@ private: Boardcore::PrintLogger logger = Boardcore::Logging::getLogger("sensors"); }; -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/Sensors/SensorsData.h b/src/Engine/Sensors/SensorsData.h index 168cf941c..16772d834 100644 --- a/src/Engine/Sensors/SensorsData.h +++ b/src/Engine/Sensors/SensorsData.h @@ -23,7 +23,7 @@ #pragma once #include <sensors/SensorData.h> -namespace Motor +namespace Engine { struct OxTopTankPressureData : Boardcore::PressureData @@ -66,4 +66,4 @@ struct CCPressureData : Boardcore::PressureData CCPressureData() {} }; -} // namespace Motor +} // namespace Engine diff --git a/src/Engine/engine-entry.cpp b/src/Engine/engine-entry.cpp index 24888615f..84530f1eb 100644 --- a/src/Engine/engine-entry.cpp +++ b/src/Engine/engine-entry.cpp @@ -20,14 +20,14 @@ * THE SOFTWARE. */ -#include <Motor/Actuators/Actuators.h> -#include <Motor/BoardScheduler.h> -#include <Motor/Buses.h> -#include <Motor/CanHandler/CanHandler.h> -#include <Motor/HIL/HIL.h> -#include <Motor/PersistentVars/PersistentVars.h> -#include <Motor/Sensors/HILSensors.h> -#include <Motor/Sensors/Sensors.h> +#include <Engine/Actuators/Actuators.h> +#include <Engine/BoardScheduler.h> +#include <Engine/Buses.h> +#include <Engine/CanHandler/CanHandler.h> +#include <Engine/HIL/HIL.h> +#include <Engine/PersistentVars/PersistentVars.h> +#include <Engine/Sensors/HILSensors.h> +#include <Engine/Sensors/Sensors.h> #include <diagnostic/CpuMeter/CpuMeter.h> #include <diagnostic/PrintLogger.h> #include <interfaces-impl/hwmapping.h> @@ -38,7 +38,7 @@ #include <iostream> using namespace Boardcore; -using namespace Motor; +using namespace Engine; using namespace miosix; int main() @@ -61,10 +61,10 @@ int main() Logger& sdLogger = Logger::getInstance(); // HIL - MotorHIL* hil = nullptr; + EngineHIL* hil = nullptr; if (PersistentVars::getHilMode()) { - hil = new MotorHIL(); + hil = new EngineHIL(); initResult = initResult && manager.insert(hil); } -- GitLab