Smartcar Shield
Loading...
Searching...
No Matches
Control.hpp
Go to the documentation of this file.
1
5#pragma once
6
7namespace smartcarlib
8{
9namespace constants
10{
11namespace control
12{
13const int kMinControlAngle = -90;
14const int kIdleControlAngle = 0;
15const int kMaxControlAngle = 90;
16const int kMinControlSpeed = -100;
17const int kIdleControlSpeed = 0;
18const int kMaxControlSpeed = 100;
19} // namespace control
20} // namespace constants
21} // namespace smartcarlib
22
24{
25public:
26 virtual ~Control() = default;
27
37 virtual void setAngle(int angle) = 0;
38
49 virtual void setSpeed(int speed) = 0;
50
62 virtual void overrideMotorSpeed(int firstMotorSpeed, int secondMotorSpeed) = 0;
63};
Interface to generalize all classes that can provide a way to control a Car.
Definition Control.hpp:24
virtual void overrideMotorSpeed(int firstMotorSpeed, int secondMotorSpeed)=0
Set the motor speed individually as a percentage of the motors` total power.
virtual void setSpeed(int speed)=0
Sets the driving speed as percentage of the total motor speed where the sign represents the direction...
virtual void setAngle(int angle)=0
Sets the driving angle in degrees [-90, 90].
virtual ~Control()=default