Alexander Lüthard
/
Micromouse
Alle Prinf's auskommentiert
Fork of Micromouse by
Diff: Motion.h
- Revision:
- 12:75d0291a9785
- Parent:
- 7:22392ed60534
- Child:
- 13:845e49f20426
--- a/Motion.h Mon Apr 30 18:27:23 2018 +0000 +++ b/Motion.h Wed May 02 14:58:48 2018 +0000 @@ -28,44 +28,54 @@ void stop(); void rotate180(); void control(); - void runTask(int task); + void runTask(int path[], int task, bool reverse); int finish(); + void accel(); private: - static const float LEFT_MID_VAL; - static const float RIGHT_MID_VAL; - static const float KP; - static const float KD; - static const int MOVE_DIST; - static const float MOVE_SPEED; + static const float LEFT_MID_VAL; + static const float RIGHT_MID_VAL; + static const float KP; + static const float KD; + static const int MOVE_DIST; + static const float MOVE_SPEED; + static const float ROTATE_SPEED; + static const float ACCEL_SCALE; - Controller& controller; - EncoderCounter& counterLeft; - EncoderCounter& counterRight; - IRSensor& irSensorL; - IRSensor& irSensorC; - IRSensor& irSensorR; - AnalogIn& lineSensor; - DigitalOut& enableMotorDriver; + Controller& controller; + EncoderCounter& counterLeft; + EncoderCounter& counterRight; + IRSensor& irSensorL; + IRSensor& irSensorC; + IRSensor& irSensorR; + AnalogIn& lineSensor; + DigitalOut& enableMotorDriver; - float distanceL; - float distanceC; - float distanceR; - int countsL; - int countsR; - int countsLOld; - int countsROld; - float speedLeft; - float speedRight; - float errorP; - float errorD; - float oldErrorP; - float totalError; - int waitStop; - int task; - int line; - float countsOld; + float distanceL; + float distanceC; + float distanceR; + int countsL; + int countsR; + int countsLOld; + int countsROld; + float speedLeft; + float speedRight; + float errorP; + float errorD; + float oldErrorP; + float totalError; + int waitStop; + int path[]; + int task; + bool reverse; + bool acceleration; + bool deceleration; + int line; + float countsOld; + float avgSpeed; + float avgCounts; + float actSpeed; }; #endif /* MOTION_H_ */ \ No newline at end of file