Pathfinding nach rechts funktioniert noch nicht...der rest schon

Dependencies:   mbed

Fork of MicroMouse_MASTER_THREE by PES2_R2D2.0

Committer:
ruesipat
Date:
Wed May 16 16:41:44 2018 +0000
Revision:
9:ab19796bf14a
Parent:
5:b8b1a979b0d5
;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ruesipat 0:a9fe4ef404bf 1 #ifndef CONTROLLER_H_
ruesipat 0:a9fe4ef404bf 2 #define CONTROLLER_H_
ruesipat 0:a9fe4ef404bf 3 #include <cstdlib>
ruesipat 0:a9fe4ef404bf 4 #include <mbed.h>
ruesipat 0:a9fe4ef404bf 5 #include "EncoderCounter.h"
ruesipat 0:a9fe4ef404bf 6 #include "LowpassFilter.h"
ruesipat 0:a9fe4ef404bf 7
ruesipat 0:a9fe4ef404bf 8 class Controller
ruesipat 0:a9fe4ef404bf 9 {
ruesipat 0:a9fe4ef404bf 10
ruesipat 0:a9fe4ef404bf 11 public:
ruesipat 0:a9fe4ef404bf 12
ruesipat 0:a9fe4ef404bf 13 Controller(PwmOut& pwmLeft, PwmOut& pwmRight,
ruesipat 0:a9fe4ef404bf 14 EncoderCounter& counterLeft, EncoderCounter& counterRight);
ruesipat 0:a9fe4ef404bf 15
ruesipat 0:a9fe4ef404bf 16 virtual ~Controller();
ruesipat 0:a9fe4ef404bf 17 void setDesiredSpeedLeft(float desiredSpeedLeft);
ruesipat 0:a9fe4ef404bf 18 void setDesiredSpeedRight(float desiredSpeedRight);
ruesipat 1:d9e840c48b1e 19 float getSpeedLeft();
ruesipat 1:d9e840c48b1e 20 float getSpeedRight();
ruesipat 1:d9e840c48b1e 21 float getIntegralLeft();
ruesipat 1:d9e840c48b1e 22 float getIntegralRight();
ruesipat 1:d9e840c48b1e 23 float getProportionalLeft();
ruesipat 1:d9e840c48b1e 24 float getProportionalRight();
ruesipat 5:b8b1a979b0d5 25 void reset();
ruesipat 0:a9fe4ef404bf 26
ruesipat 0:a9fe4ef404bf 27 private:
ruesipat 0:a9fe4ef404bf 28
ruesipat 0:a9fe4ef404bf 29 static const float PERIOD;
ruesipat 0:a9fe4ef404bf 30 static const float COUNTS_PER_TURN;
ruesipat 0:a9fe4ef404bf 31 static const float LOWPASS_FILTER_FREQUENCY;
ruesipat 0:a9fe4ef404bf 32 static const float KN;
ruesipat 0:a9fe4ef404bf 33 static const float KP;
ruesipat 1:d9e840c48b1e 34 static const float KI;
ruesipat 1:d9e840c48b1e 35 static const float I_MAX;
ruesipat 0:a9fe4ef404bf 36 static const float MAX_VOLTAGE;
ruesipat 0:a9fe4ef404bf 37 static const float MIN_DUTY_CYCLE;
ruesipat 0:a9fe4ef404bf 38 static const float MAX_DUTY_CYCLE;
ruesipat 0:a9fe4ef404bf 39
ruesipat 0:a9fe4ef404bf 40 PwmOut& pwmLeft;
ruesipat 0:a9fe4ef404bf 41 PwmOut& pwmRight;
ruesipat 0:a9fe4ef404bf 42 EncoderCounter& counterLeft;
ruesipat 0:a9fe4ef404bf 43 EncoderCounter& counterRight;
ruesipat 0:a9fe4ef404bf 44 short previousValueCounterLeft;
ruesipat 0:a9fe4ef404bf 45 short previousValueCounterRight;
ruesipat 0:a9fe4ef404bf 46 LowpassFilter speedLeftFilter;
ruesipat 0:a9fe4ef404bf 47 LowpassFilter speedRightFilter;
ruesipat 0:a9fe4ef404bf 48 float desiredSpeedLeft;
ruesipat 0:a9fe4ef404bf 49 float desiredSpeedRight;
ruesipat 0:a9fe4ef404bf 50 float actualSpeedLeft;
ruesipat 0:a9fe4ef404bf 51 float actualSpeedRight;
ruesipat 1:d9e840c48b1e 52 float iSumLeft;
ruesipat 1:d9e840c48b1e 53 float iSumRight;
ruesipat 0:a9fe4ef404bf 54 Ticker ticker;
ruesipat 1:d9e840c48b1e 55
ruesipat 0:a9fe4ef404bf 56 void run();
ruesipat 0:a9fe4ef404bf 57
ruesipat 0:a9fe4ef404bf 58 };
ruesipat 0:a9fe4ef404bf 59
ruesipat 0:a9fe4ef404bf 60 #endif /* CONTROLLER_H_ */
ruesipat 0:a9fe4ef404bf 61
ruesipat 0:a9fe4ef404bf 62
ruesipat 0:a9fe4ef404bf 63
ruesipat 0:a9fe4ef404bf 64
ruesipat 0:a9fe4ef404bf 65