Smartcar Shield
Loading...
Searching...
No Matches
SmartCar.cpp
Go to the documentation of this file.
1#include "SmartCar.hpp"
2
4 Control& control,
5 HeadingSensor& headingSensor,
6 Odometer& odometer)
7 : SimpleCar::SimpleCar(control)
8 , DistanceCar::DistanceCar(runtime, control, odometer)
9 , HeadingCar::HeadingCar(control, headingSensor)
10{
11}
12
14 Control& control,
15 HeadingSensor& headingSensor,
16 Odometer& odometerleft,
17 Odometer& odometerRight)
18 : SimpleCar::SimpleCar(control)
19 , DistanceCar::DistanceCar(runtime, control, odometerleft, odometerRight)
20 , HeadingCar::HeadingCar(control, headingSensor)
21{
22}
23
Interface to generalize all classes that can provide a way to control a Car.
Definition Control.hpp:24
A class to programmatically represent a vehicle equipped with odometers.
virtual void update()
Adjusts the cruise control speed.
A class to programmatically represent a vehicle equipped with a heading sensor.
virtual void update()
Updates the readings from the heading sensor.
A heading sensor is an interface that can represent all sensors which can provide the vehicle's headi...
An interface to programmatically represent all odometers.
Definition Odometer.hpp:27
An interface to serve as a wrapper for the native runtime environment, greatly inspired by the Arduin...
Definition Runtime.hpp:36
A class to programmatically represent a very basic vehicle with two motors.
Definition SimpleCar.hpp:11
SmartCar(Runtime &runtime, Control &control, HeadingSensor &headingSensor, Odometer &odometer)
Constructs a car equipped with a heading sensor and an odometer.
Definition SmartCar.cpp:3
void update() override
Adjusts the speed when cruise control is enabled and calculates the current heading.
Definition SmartCar.cpp:24