Smartcar Shield
|
#include <HeadingCar.hpp>
Public Member Functions | |
HeadingCar (Control &control, HeadingSensor &headingSensor) | |
Constructs a car equipped with a heading sensor. More... | |
int | getHeading () |
Returns the car's current heading in degrees [0, 360) More... | |
virtual void | update () |
Updates the readings from the heading sensor. More... | |
Public Member Functions inherited from SimpleCar | |
SimpleCar (Control &control) | |
Constructs a simple car. More... | |
void | setSpeed (float speed) override |
Sets the car's driving speed as a percentage of the motors total speed where the sign indicates direction. More... | |
void | setAngle (int angle) override |
Set the car's driving angle. More... | |
void | overrideMotorSpeed (int firstMotorSpeed, int secondMotorSpeed) override |
Set the motor speed individually as a percentage of the motors` total power. More... | |
Public Member Functions inherited from Car | |
virtual | ~Car ()=default |
A class to programmatically represent a vehicle equipped with a heading sensor
Definition at line 10 of file HeadingCar.hpp.
HeadingCar::HeadingCar | ( | Control & | control, |
HeadingSensor & | headingSensor | ||
) |
Constructs a car equipped with a heading sensor.
control | The car's control |
headingSensor | The heading sensor |
Example:
Definition at line 3 of file HeadingCar.cpp.
int HeadingCar::getHeading | ( | ) |
Returns the car's current heading in degrees [0, 360)
Example:
Definition at line 9 of file HeadingCar.cpp.
|
virtual |
Updates the readings from the heading sensor.
You must have this being executed as often as possible to get accurate heading readings.
Example:
Reimplemented in SmartCar.
Definition at line 14 of file HeadingCar.cpp.