From fd572290bfb9ffc0bb8e6e4048bd084498723a86 Mon Sep 17 00:00:00 2001 From: Student Date: Tue, 3 Dec 2024 20:52:50 -0800 Subject: [PATCH] callum removed extra HAL folders, developed elevator functions --- src/main/cpp/HAL/Elevator.cpp | 2 +- src/main/cpp/InputManager/ElevatorManager.cpp | 12 ++++++++++++ src/main/cpp/subsystems/ElevatorHAL.cpp | 13 ------------- src/main/include/HAL/Elevator.h | 4 ++++ src/main/include/InputManager/ElevatorManager.h | 2 ++ src/main/include/subsystems/ElevatorHAL.h | 13 ------------- 6 files changed, 19 insertions(+), 27 deletions(-) delete mode 100644 src/main/cpp/subsystems/ElevatorHAL.cpp delete mode 100644 src/main/include/subsystems/ElevatorHAL.h diff --git a/src/main/cpp/HAL/Elevator.cpp b/src/main/cpp/HAL/Elevator.cpp index 3c648a5..9a486c7 100644 --- a/src/main/cpp/HAL/Elevator.cpp +++ b/src/main/cpp/HAL/Elevator.cpp @@ -69,7 +69,7 @@ void Elevator::ProfiledMoveToHeight(int shelfNumber) double Elevator::GetHeight() { - // TODO - read motors for height + // get data from motors std::cout << "elevator height measured as 0.0 inches" << std::endl; return 0.0f; } diff --git a/src/main/cpp/InputManager/ElevatorManager.cpp b/src/main/cpp/InputManager/ElevatorManager.cpp index e69de29..8f1b6c5 100644 --- a/src/main/cpp/InputManager/ElevatorManager.cpp +++ b/src/main/cpp/InputManager/ElevatorManager.cpp @@ -0,0 +1,12 @@ +#include "HAL/Elevator.h" +#include "InputManager/ElevatorManager.h" +#include +#include + + +void HandleInput(RobotControlData& control_data) { + //todo +}; +void Reset(){ + m_elevator.ProfiledMoveToHeight(0); +}; \ No newline at end of file diff --git a/src/main/cpp/subsystems/ElevatorHAL.cpp b/src/main/cpp/subsystems/ElevatorHAL.cpp deleted file mode 100644 index 32a1086..0000000 --- a/src/main/cpp/subsystems/ElevatorHAL.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "subsystems/ElevatorHAL.h" - -double GetElevatorHeight() { - //todo -}; - -void MoveElevatorBy(double distance, double speed) { - //todo -}; - -void MoveElevatorTo(double height) { - //todo -}; \ No newline at end of file diff --git a/src/main/include/HAL/Elevator.h b/src/main/include/HAL/Elevator.h index c21af94..b104cac 100644 --- a/src/main/include/HAL/Elevator.h +++ b/src/main/include/HAL/Elevator.h @@ -1,6 +1,10 @@ #pragma once #include +#include +#include + + rev::CANSparkMax m_elevatorMotor{9, rev::CANSparkMax::MotorType::kBrushless}; class Elevator { diff --git a/src/main/include/InputManager/ElevatorManager.h b/src/main/include/InputManager/ElevatorManager.h index 9a2a7a4..65e752c 100644 --- a/src/main/include/InputManager/ElevatorManager.h +++ b/src/main/include/InputManager/ElevatorManager.h @@ -3,6 +3,8 @@ #include "HAL/Elevator.h" #include "RobotControlData.h" +Elevator m_elevator = Elevator(); + class ElevatorManager { public: diff --git a/src/main/include/subsystems/ElevatorHAL.h b/src/main/include/subsystems/ElevatorHAL.h deleted file mode 100644 index ced62af..0000000 --- a/src/main/include/subsystems/ElevatorHAL.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -class ElevatorHAL -{ -public: - - double GetElevatorHeight(); - void MoveElevatorBy(double distance, double speed); - void MoveElevatorTo(double height); -private: - double elevatorHeight; - -};