Han Yan
/
ms2b
not running
Diff: AccCar.h
- Revision:
- 0:3b4906b8a747
- Child:
- 2:16b3bd337db2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AccCar.h Tue Dec 10 22:29:09 2019 +0000 @@ -0,0 +1,40 @@ +#ifndef _ACC_CAR_H_ +#define _ACC_CAR_H_ + +#include "mbed.h" +#include "Car.h" +#include "Road.h" +#include "Communication.h" + +class Road; +class Car; + +class AccCar { +public: +// Inherited from class Car + int position; + int speed; + int flag; + + AccCar(int id, Road* road, int flag, char* t1, char* t2); + void set_forward_car(AccCar* car); + void update(); + void reset(int speed); + void stop(); + +public: + int id; + int target_speed; + AccCar* forward_car; + + Road* road; + Thread* thread; + Communication *comm; + + char* topic_position; + char* topic_control; + +protected: + int cycle; +}; +#endif \ No newline at end of file