robot

Dependencies:   FastPWM3 mbed

Committer:
bwang
Date:
Wed Jan 25 22:19:55 2017 +0000
Revision:
56:c681001dfa46
Parent:
50:f508c7860342
Child:
73:d44bc3a46942
added (ineffective) LimitingThrottleMapper, updated throttle ranges to get 100% instead of 85%

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bwang 42:030e0ec4eac5 1 #ifndef __THROTTLE_MAPPER_H
bwang 42:030e0ec4eac5 2 #define __THROTTLE_MAPPER_H
bwang 42:030e0ec4eac5 3
bwang 42:030e0ec4eac5 4 class ThrottleMapper {
bwang 42:030e0ec4eac5 5 public:
bwang 42:030e0ec4eac5 6 virtual float map(float throttle, float w) = 0;
bwang 42:030e0ec4eac5 7 };
bwang 42:030e0ec4eac5 8
bwang 42:030e0ec4eac5 9 class NullThrottleMapper : public ThrottleMapper {
bwang 42:030e0ec4eac5 10 public:
bwang 42:030e0ec4eac5 11 virtual float map(float throttle, float w) {return throttle;}
bwang 42:030e0ec4eac5 12 };
bwang 42:030e0ec4eac5 13
bwang 50:f508c7860342 14 class DrivingThrottleMapper : public ThrottleMapper {
bwang 42:030e0ec4eac5 15 public:
bwang 42:030e0ec4eac5 16 virtual float map(float throttle, float w);
bwang 42:030e0ec4eac5 17 private:
bwang 42:030e0ec4eac5 18 float getMaxTqpctPlus(float w);
bwang 42:030e0ec4eac5 19 float getMaxTqpctMinus(float w);
bwang 42:030e0ec4eac5 20 float getZeroTqThrottle(float w);
bwang 42:030e0ec4eac5 21 };
bwang 50:f508c7860342 22
bwang 56:c681001dfa46 23 class LimitingThrottleMapper : public ThrottleMapper {
bwang 56:c681001dfa46 24 public:
bwang 56:c681001dfa46 25 LimitingThrottleMapper(float wmax);
bwang 56:c681001dfa46 26 virtual float map(float throttle, float w);
bwang 56:c681001dfa46 27 private:
bwang 56:c681001dfa46 28 float __wmax, __wlim;
bwang 56:c681001dfa46 29 };
bwang 56:c681001dfa46 30
bwang 42:030e0ec4eac5 31 #endif