Smartcar Shield
Loading...
Searching...
No Matches
HeadingCar.cpp
Go to the documentation of this file.
1#include "HeadingCar.hpp"
2
4 : SimpleCar(control)
5 , mHeadingSensor(headingSensor)
6{
7}
8
10{
11 return mHeadingSensor.getHeading();
12}
13
15{
16 mHeadingSensor.update();
17}
Interface to generalize all classes that can provide a way to control a Car.
Definition Control.hpp:24
HeadingCar(Control &control, HeadingSensor &headingSensor)
Constructs a car equipped with a heading sensor.
Definition HeadingCar.cpp:3
virtual void update()
Updates the readings from the heading sensor.
int getHeading()
Returns the car's current heading in degrees [0, 360)
Definition HeadingCar.cpp:9
A heading sensor is an interface that can represent all sensors which can provide the vehicle's headi...
virtual int getHeading()=0
Returns the current heading of the vehicle.
virtual void update()=0
Updates the sensor's readings.
A class to programmatically represent a very basic vehicle with two motors.
Definition SimpleCar.hpp:11