#pragma once #include "ControlCore/Thing.h" #include namespace Passer { using namespace Control; namespace RoboidControl { /// @brief A Motor is a Thing which can move parts of the Roboid /// @note Currently only rotational motors are supported class Motor : public Thing { public: /// @brief Default constructor for the Motor Motor(); /// @brief Motor turning direction enum class Direction { Clockwise = 1, CounterClockwise = -1 }; /// @brief The forward turning direction of the motor Direction direction = Direction::Clockwise; /// @brief Set the target motor speed /// @param speed The speed between -1 (full backward), 0 (stop) and 1 (full /// forward) virtual void SetTargetSpeed(float speed); /// @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(unsigned long currentTimeMs); float currentTargetSpeed = 0; protected: }; } // namespace RoboidControl } // namespace Passer using namespace Passer::RoboidControl;