Diff: Steering.h
- Revision:
- 2:8be8699c5afd
- Parent:
- 1:4b719f80e9c4
diff -r 4b719f80e9c4 -r 8be8699c5afd Steering.h --- a/Steering.h Fri Aug 21 04:52:10 2015 +0000 +++ b/Steering.h Wed Oct 14 03:55:16 2015 +0000 @@ -1,46 +1,49 @@ #ifndef INCLUDED_STEERING_H #define INCLUDED_STEERING_H -#include "Command.h" - -class XBee; +class Command; class I2CMotor; class I2CServo; +class SteeringTire; class Steering{ public: - Steering( I2CMotor** t, I2CServo** s, XBee* xbee ); + enum ActionType{ + STOP = 0x00, // 0000 0000(2) + MOVE = 0x08, // 0000 1000(2) + ROLL = 0x10, // 0001 0000(2) + SHOOT = 0x18, // 0001 1000(2) + WAIT_SERVO = 0xFF // 通信で送られて来ることはないデータ + }; + + Steering( I2CMotor** t, I2CServo** s ); ~Steering(); void update( Command c ); + static const int mNumOfTire; + private: + void updateActionType( Command command ); void updateMove( Command command ); - void updateAbsRoll( Command command ); void updateRoll( Command command ); void updateStop( Command command ); void updateWaitServo( Command command ); - void setServoPositionByActionType( Command::ActionType action, Command command ); + void setServoPositionByActionType( ActionType action, Command command ); void setServoPositionWhenMove( Command command ); void setServoPositionWhenRoll(); void setServoPositionWhenStop(); - static const int mNumOfTire; - static const float mAllowableError; static const float mStoppingMoveAngle; static const float mRollTirePosition[]; - float mOffsetHeadingAngle; - - float mMoveDirection_rad; + SteeringTire* mTire; + I2CServo** mServo; - I2CMotor** mTire; - I2CServo** mServo; - XBee* mXBee; - - Command::ActionType mActionType; - Command::ActionType mNextActionType; + ActionType mActionType; + ActionType mNextActionType; + float mMoveDirection_rad; }; #endif