From bd17b739e202735badf5b68b30eea4ee295caaff Mon Sep 17 00:00:00 2001 From: Gabryel Reyes Date: Mon, 2 Sep 2024 15:47:57 +0200 Subject: [PATCH] Removed unnecessary method --- lib/APPRemoteControl/src/App.cpp | 5 ----- lib/APPRemoteControl/src/StartupState.cpp | 2 +- lib/APPRemoteControl/src/StartupState.h | 15 +-------------- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/lib/APPRemoteControl/src/App.cpp b/lib/APPRemoteControl/src/App.cpp index 823ec6f1..628193a3 100644 --- a/lib/APPRemoteControl/src/App.cpp +++ b/lib/APPRemoteControl/src/App.cpp @@ -200,8 +200,6 @@ void App::handleRemoteCommand(const Command& cmd) Odometry::getInstance().clearMileage(); Odometry::getInstance().setPosition(cmd.xPos, cmd.yPos); Odometry::getInstance().setOrientation(cmd.orientation); - - StartupState::getInstance().notifyInitialDataIsSet(); break; default: @@ -411,8 +409,5 @@ void App_turtleChannelCallback(const uint8_t* payload, const uint8_t payloadSize /* Angular speed is set on-top of the linear speed. Must be called after setLinearSpeed(). */ diffDrive.setAngularSpeed(angularSpeed); - - /* Turtle expects no initial data. Can be called without side-effects when no longer in StartupState. */ - StartupState::getInstance().notifyInitialDataIsSet(); } } \ No newline at end of file diff --git a/lib/APPRemoteControl/src/StartupState.cpp b/lib/APPRemoteControl/src/StartupState.cpp index dc1ad8c0..16dccfc0 100644 --- a/lib/APPRemoteControl/src/StartupState.cpp +++ b/lib/APPRemoteControl/src/StartupState.cpp @@ -96,7 +96,7 @@ void StartupState::process(StateMachine& sm) ErrorState::getInstance().setErrorMsg("MCAL=0"); sm.setState(&ErrorState::getInstance()); } - else if (true == m_initialDataSet) + else { sm.setState(&DrivingState::getInstance()); } diff --git a/lib/APPRemoteControl/src/StartupState.h b/lib/APPRemoteControl/src/StartupState.h index 29d3e00b..8722b895 100644 --- a/lib/APPRemoteControl/src/StartupState.h +++ b/lib/APPRemoteControl/src/StartupState.h @@ -89,14 +89,6 @@ class StartupState : public IState */ void exit() final; - /** - * Notify the state, that the initial data set was received. - */ - void notifyInitialDataIsSet() - { - m_initialDataSet = true; - } - protected: private: /** @@ -104,15 +96,10 @@ class StartupState : public IState */ static const uint32_t APP_NAME_DURATION = 2000U; - /** - * Flag to indicate, that the initial data was set. - */ - bool m_initialDataSet; - /** * Default constructor. */ - StartupState() : m_initialDataSet(false) + StartupState() { }