diff --git a/ControlledMotor.h b/ControlledMotor.h index 3c3d1e9..a522b7b 100644 --- a/ControlledMotor.h +++ b/ControlledMotor.h @@ -27,11 +27,11 @@ public: /// @brief Set the target speed for the motor controller /// @param speed the target in revolutions per second. - void SetTargetSpeed(float speed); + virtual void SetTargetSpeed(float speed); /// @brief Get the actual speed from the encoder /// @return The speed in revolutions per second - float GetActualSpeed(); + virtual float GetActualSpeed(); bool Drive(float distance); diff --git a/FeedbackServo.h b/FeedbackServo.h new file mode 100644 index 0000000..6d2085e --- /dev/null +++ b/FeedbackServo.h @@ -0,0 +1,16 @@ +#pragma once + +#include "Servo.h" + +namespace Passer { +namespace RoboidContol { + +class FeedbackServo : public Servo { +public: + FeedbackServo(); + + virtual float GetActualAngle() = 0; +}; + +} // namespace RoboidContol +} // namespace Passer \ No newline at end of file diff --git a/Servo.h b/Servo.h index 27f9bca..27cd9e3 100644 --- a/Servo.h +++ b/Servo.h @@ -2,9 +2,16 @@ #include "ControlledMotor.h" -class Servo : public ControlledMotor { +namespace Passer { +namespace RoboidContol { + +class Servo : public Thing { public: Servo(); virtual void SetTargetAngle(float angle) = 0; -}; \ No newline at end of file +}; + +} // namespace RoboidContol +} // namespace Passer +using namespace Passer::RoboidContol; \ No newline at end of file