Smartcar Shield
SmartCar.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include "../distance/DistanceCar.hpp"
9 #include "../heading/HeadingCar.hpp"
10 
11 class SmartCar : public DistanceCar, public HeadingCar
12 {
13 public:
39  SmartCar(Runtime& runtime, Control& control, HeadingSensor& headingSensor, Odometer& odometer);
40 
70  SmartCar(Runtime& runtime,
71  Control& control,
72  HeadingSensor& headingSensor,
73  Odometer& odometerLeft,
74  Odometer& odometerRight);
75 
90  void update() override;
91 
92  /* Use the overriden functions from DistanceCar */
95 };
96 
DistanceCar
Definition: DistanceCar.hpp:27
SmartCar::SmartCar
SmartCar(Runtime &runtime, Control &control, HeadingSensor &headingSensor, Odometer &odometer)
Constructs a car equipped with a heading sensor and an odometer.
Definition: SmartCar.cpp:3
HeadingCar
Definition: HeadingCar.hpp:10
Odometer
Definition: Odometer.hpp:26
SmartCar
Definition: SmartCar.hpp:11
SmartCar::update
void update() override
Adjusts the speed when cruise control is enabled and calculates the current heading.
Definition: SmartCar.cpp:24
Runtime
Definition: Runtime.hpp:35
Control
Definition: Control.hpp:23
HeadingSensor
Definition: HeadingSensor.hpp:8
DistanceCar::overrideMotorSpeed
void overrideMotorSpeed(int firstMotorSpeed, int secondMotorSpeed) override
Sets the motor speed individually as a percentage of the motors` total power unless cruise control is...
Definition: DistanceCar.cpp:210
DistanceCar::setSpeed
void setSpeed(float speed) override
Sets the car's speed in meters per second if cruise control is enabled otherwise as a percentage of t...
Definition: DistanceCar.cpp:42