From 8b2f9439ca8807539c4108c9e2956bea688bf75d Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Fri, 19 Jan 2024 14:13:37 +0100 Subject: [PATCH] Add GetTargetSpeed --- Motor.cpp | 2 ++ Motor.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Motor.cpp b/Motor.cpp index e45dc6e..3b5eb4f 100644 --- a/Motor.cpp +++ b/Motor.cpp @@ -10,4 +10,6 @@ void Motor::SetTargetSpeed(float targetSpeed) { this->currentTargetSpeed = targetSpeed; } +float Motor::GetTargetSpeed() { return (this->currentTargetSpeed); } + void Motor::Update(float currentTimeMs) {} \ No newline at end of file diff --git a/Motor.h b/Motor.h index 1655893..037962f 100644 --- a/Motor.h +++ b/Motor.h @@ -26,6 +26,11 @@ public: /// @brief Get the current target speed of the motor /// @return The speed between -1 (full backward), 0 (stop) and 1 (full /// forward) + virtual float GetTargetSpeed(); + + /// @brief Get the current actual speed of the motor + /// @return The speed between -1 (full backward), 0 (stop) and 1 (full + /// forward) virtual float GetActualSpeed(); virtual void Update(float currentTimeMs);