Steering.h@4:912ac0c2c52a, 2015-10-15 (annotated)
- Committer:
- inst
- Date:
- Thu Oct 15 08:46:39 2015 +0000
- Revision:
- 4:912ac0c2c52a
- Parent:
- 2:8be8699c5afd
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
inst | 0:0bac1fed0273 | 1 | #ifndef INCLUDED_STEERING_H |
inst | 0:0bac1fed0273 | 2 | #define INCLUDED_STEERING_H |
inst | 0:0bac1fed0273 | 3 | |
inst | 2:8be8699c5afd | 4 | class Command; |
inst | 0:0bac1fed0273 | 5 | class I2CMotor; |
inst | 0:0bac1fed0273 | 6 | class I2CServo; |
inst | 2:8be8699c5afd | 7 | class SteeringTire; |
inst | 0:0bac1fed0273 | 8 | |
inst | 0:0bac1fed0273 | 9 | class Steering{ |
inst | 0:0bac1fed0273 | 10 | public: |
inst | 2:8be8699c5afd | 11 | enum ActionType{ |
inst | 2:8be8699c5afd | 12 | STOP = 0x00, // 0000 0000(2) |
inst | 2:8be8699c5afd | 13 | MOVE = 0x08, // 0000 1000(2) |
inst | 2:8be8699c5afd | 14 | ROLL = 0x10, // 0001 0000(2) |
inst | 2:8be8699c5afd | 15 | SHOOT = 0x18, // 0001 1000(2) |
inst | 2:8be8699c5afd | 16 | WAIT_SERVO = 0xFF // 通信で送られて来ることはないデータ |
inst | 2:8be8699c5afd | 17 | }; |
inst | 2:8be8699c5afd | 18 | |
inst | 2:8be8699c5afd | 19 | Steering( I2CMotor** t, I2CServo** s ); |
inst | 0:0bac1fed0273 | 20 | ~Steering(); |
inst | 0:0bac1fed0273 | 21 | |
inst | 0:0bac1fed0273 | 22 | void update( Command c ); |
inst | 0:0bac1fed0273 | 23 | |
inst | 2:8be8699c5afd | 24 | static const int mNumOfTire; |
inst | 2:8be8699c5afd | 25 | |
inst | 0:0bac1fed0273 | 26 | private: |
inst | 2:8be8699c5afd | 27 | void updateActionType( Command command ); |
inst | 0:0bac1fed0273 | 28 | void updateMove( Command command ); |
inst | 0:0bac1fed0273 | 29 | void updateRoll( Command command ); |
inst | 0:0bac1fed0273 | 30 | void updateStop( Command command ); |
inst | 0:0bac1fed0273 | 31 | void updateWaitServo( Command command ); |
inst | 0:0bac1fed0273 | 32 | |
inst | 2:8be8699c5afd | 33 | void setServoPositionByActionType( ActionType action, Command command ); |
inst | 1:4b719f80e9c4 | 34 | void setServoPositionWhenMove( Command command ); |
inst | 1:4b719f80e9c4 | 35 | void setServoPositionWhenRoll(); |
inst | 1:4b719f80e9c4 | 36 | void setServoPositionWhenStop(); |
inst | 0:0bac1fed0273 | 37 | |
inst | 0:0bac1fed0273 | 38 | static const float mStoppingMoveAngle; |
inst | 0:0bac1fed0273 | 39 | static const float mRollTirePosition[]; |
inst | 0:0bac1fed0273 | 40 | |
inst | 2:8be8699c5afd | 41 | SteeringTire* mTire; |
inst | 2:8be8699c5afd | 42 | I2CServo** mServo; |
inst | 0:0bac1fed0273 | 43 | |
inst | 2:8be8699c5afd | 44 | ActionType mActionType; |
inst | 2:8be8699c5afd | 45 | ActionType mNextActionType; |
inst | 2:8be8699c5afd | 46 | float mMoveDirection_rad; |
inst | 0:0bac1fed0273 | 47 | }; |
inst | 0:0bac1fed0273 | 48 | |
inst | 0:0bac1fed0273 | 49 | #endif |