Servos and Controlled motor updates
This commit is contained in:
parent
0e11b0db5f
commit
6ce9d78b04
@ -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);
|
||||
|
||||
|
16
FeedbackServo.h
Normal file
16
FeedbackServo.h
Normal file
@ -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
|
11
Servo.h
11
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;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace RoboidContol
|
||||
} // namespace Passer
|
||||
using namespace Passer::RoboidContol;
|
Loading…
x
Reference in New Issue
Block a user