RoboidControl
Loading...
Searching...
No Matches
d:/PlatformIO/RoboidControl/ServoMotor.h
Go to the documentation of this file.
1#pragma once
2
3#include "ControlledMotor.h"
4
5namespace Passer {
6namespace RoboidContol {
7
8class ServoMotor : public Thing {
9public:
10 ServoMotor();
11
12 float minAngle = -90.0F;
13 float maxAngle = 90.0F;
14
17
18 virtual void SetTargetAngle(float angle);
19 virtual float GetTargetAngle();
20
21 virtual void SetMaximumVelocity(float maxVelocity);
22
23 virtual void SetTargetVelocity(float velocity);
24 virtual float GetTargetVelocity();
25
26 virtual void Update(float currentTimeMs);
27
28protected:
29 bool hasTargetAngle = false;
30 float targetAngle = 0.0F;
31
32 float maxVelocity = 0.0F;
33
34 float targetVelocity = 0.0F;
35 float limitedTargetAngle = 0.0F;
36
37 float lastUpdateTimeMs = 0.0F;
38
39 virtual void SetAngle(float angle) = 0;
40};
41
42} // namespace RoboidContol
43} // namespace Passer
44using namespace Passer::RoboidContol;
Definition ServoMotor.h:8
virtual float GetTargetAngle()
Definition ServoMotor.cpp:28
ControlMode controlMode
Definition ServoMotor.h:16
float maxVelocity
Definition ServoMotor.h:32
virtual float GetTargetVelocity()
Definition ServoMotor.cpp:43
float limitedTargetAngle
Definition ServoMotor.h:35
virtual void SetTargetVelocity(float velocity)
Definition ServoMotor.cpp:34
float minAngle
Definition ServoMotor.h:12
float lastUpdateTimeMs
Definition ServoMotor.h:37
virtual void SetMaximumVelocity(float maxVelocity)
Definition ServoMotor.cpp:30
virtual void SetTargetAngle(float angle)
Definition ServoMotor.cpp:12
float targetAngle
Definition ServoMotor.h:30
float maxAngle
Definition ServoMotor.h:13
virtual void Update(float currentTimeMs)
Definition ServoMotor.cpp:45
virtual void SetAngle(float angle)=0
ServoMotor()
Definition ServoMotor.cpp:5
bool hasTargetAngle
Definition ServoMotor.h:29
float targetVelocity
Definition ServoMotor.h:34
ControlMode
Definition ServoMotor.h:15
@ Velocity
Definition ServoMotor.h:15
@ Position
Definition ServoMotor.h:15
Definition AbsoluteEncoder.h:6
Definition AbsoluteEncoder.h:5