From d0cad1dfbb987975c6f048cd52ee2ab42e8756f5 Mon Sep 17 00:00:00 2001 From: jbrhm Date: Mon, 25 Nov 2024 10:18:35 -0500 Subject: [PATCH] removing non-necessary things --- perception/key_detector/key_detector.cpp | 12 --------- perception/key_detector/key_detector.fsm.cpp | 9 ------- perception/key_detector/key_detector.hpp | 25 ------------------- .../key_detector/key_detector.processing.cpp | 0 perception/key_detector/main.cpp | 15 ----------- perception/key_detector/pch.hpp | 20 --------------- perception/key_detector/states/State1.cpp | 15 ----------- perception/key_detector/states/State1.hpp | 14 ----------- perception/key_detector/states/State2.cpp | 15 ----------- perception/key_detector/states/State2.hpp | 14 ----------- 10 files changed, 139 deletions(-) delete mode 100644 perception/key_detector/key_detector.cpp delete mode 100644 perception/key_detector/key_detector.fsm.cpp delete mode 100644 perception/key_detector/key_detector.hpp delete mode 100644 perception/key_detector/key_detector.processing.cpp delete mode 100644 perception/key_detector/main.cpp delete mode 100644 perception/key_detector/pch.hpp delete mode 100644 perception/key_detector/states/State1.cpp delete mode 100644 perception/key_detector/states/State1.hpp delete mode 100644 perception/key_detector/states/State2.cpp delete mode 100644 perception/key_detector/states/State2.hpp diff --git a/perception/key_detector/key_detector.cpp b/perception/key_detector/key_detector.cpp deleted file mode 100644 index c9e0366e..00000000 --- a/perception/key_detector/key_detector.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "key_detector.hpp" - -namespace mrover{ - KeyDetector::KeyDetector() : rclcpp::Node(NODE_NAME), mFSMTimer{create_wall_timer(std::chrono::milliseconds(1000), [&](){updateFSM();})}, mStateMachine{"Key Detector FSM", new State1(2)}, mStatePublisher{this, mStateMachine, "key_detector_fsm_structure", 10, "key_detector_fsm_state", 10}{ - RCLCPP_INFO_STREAM(get_logger(), "Creating KeyDetector Node..."); - - mStateMachine.enableTransitions(); - mStateMachine.enableTransitions(); - } - - KeyDetector::~KeyDetector() = default; -} diff --git a/perception/key_detector/key_detector.fsm.cpp b/perception/key_detector/key_detector.fsm.cpp deleted file mode 100644 index 63f6f080..00000000 --- a/perception/key_detector/key_detector.fsm.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "key_detector.hpp" - -namespace mrover{ - void KeyDetector::updateFSM(){ - RCLCPP_INFO_STREAM(get_logger(), "FSM Callback..."); - - mStateMachine.update(); - } -} diff --git a/perception/key_detector/key_detector.hpp b/perception/key_detector/key_detector.hpp deleted file mode 100644 index 3f6af3c9..00000000 --- a/perception/key_detector/key_detector.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include "pch.hpp" - -namespace mrover { - - class KeyDetector : public rclcpp::Node{ - private: - static constexpr char const* NODE_NAME = "key_detector"; - - rclcpp::TimerBase::SharedPtr mFSMTimer; - - StateMachine mStateMachine; - - StatePublisher mStatePublisher; - - void updateFSM(); - - public: - KeyDetector(); - - ~KeyDetector() override; - }; - -} // namespace mrover diff --git a/perception/key_detector/key_detector.processing.cpp b/perception/key_detector/key_detector.processing.cpp deleted file mode 100644 index e69de29b..00000000 diff --git a/perception/key_detector/main.cpp b/perception/key_detector/main.cpp deleted file mode 100644 index f1e705a4..00000000 --- a/perception/key_detector/main.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "key_detector.hpp" - -auto main(int argc, char** argv) -> int { - rclcpp::init(argc, argv); - - // DO NOT REMOVE OR ELSE REF COUNT WILL GO TO ZERO - auto keyDetector = std::make_shared(); - - rclcpp::executors::SingleThreadedExecutor executor; - executor.add_node(keyDetector); - executor.spin(); - - rclcpp::shutdown(); - return EXIT_SUCCESS; -} diff --git a/perception/key_detector/pch.hpp b/perception/key_detector/pch.hpp deleted file mode 100644 index e147124b..00000000 --- a/perception/key_detector/pch.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -// Ros Client Library -#include -#include -#include -#include - -// STL -#include -#include - -// MRover Libs -#include -#include -#include - -// States -#include "states/State1.hpp" -#include "states/State2.hpp" diff --git a/perception/key_detector/states/State1.cpp b/perception/key_detector/states/State1.cpp deleted file mode 100644 index adb5b645..00000000 --- a/perception/key_detector/states/State1.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "State1.hpp" - -namespace mrover { - State1::State1(int _numLoops) : numLoops{_numLoops}{} - - auto State1::onLoop() -> State*{ - if(numLoops >= 5){ - return new State2(); - } - auto logger = rclcpp::get_logger("State1"); - RCLCPP_INFO_STREAM(logger, "In State1 " << numLoops << "\n"); - ++numLoops; - return this; - } -} diff --git a/perception/key_detector/states/State1.hpp b/perception/key_detector/states/State1.hpp deleted file mode 100644 index 0012504e..00000000 --- a/perception/key_detector/states/State1.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "../pch.hpp" - -namespace mrover{ - class State1 : public State { - private: - std::int64_t numLoops; - public: - explicit State1(int _numLoops); - - auto onLoop() -> State* override; - }; -} diff --git a/perception/key_detector/states/State2.cpp b/perception/key_detector/states/State2.cpp deleted file mode 100644 index 84b0bc48..00000000 --- a/perception/key_detector/states/State2.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "State2.hpp" - -namespace mrover { - State2::State2() : numLoops{0}{} - - auto State2::onLoop() -> State*{ - if(numLoops >= 5){ - return StateMachine::make_state(2); - } - auto logger = rclcpp::get_logger("State2"); - RCLCPP_INFO_STREAM(logger, "In State2 " << numLoops << "\n"); - ++numLoops; - return this; - } -} diff --git a/perception/key_detector/states/State2.hpp b/perception/key_detector/states/State2.hpp deleted file mode 100644 index 59305a88..00000000 --- a/perception/key_detector/states/State2.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "../pch.hpp" - -namespace mrover { - class State2 : public State { - private: - std::int64_t numLoops; - public: - explicit State2(); - - auto onLoop() -> State* override; - }; -}