Diff: Steering.h
- Revision:
- 0:0bac1fed0273
- Child:
- 1:4b719f80e9c4
diff -r 000000000000 -r 0bac1fed0273 Steering.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Steering.h Sat Aug 15 13:31:39 2015 +0000 @@ -0,0 +1,43 @@ +#ifndef INCLUDED_STEERING_H +#define INCLUDED_STEERING_H + +#include "Command.h" + +class XBee; +class I2CMotor; +class I2CServo; + +class Steering{ +public: + Steering( I2CMotor** t, I2CServo** s, XBee* xbee ); + ~Steering(); + + void update( Command c ); + +private: + 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 ); + + static const int mNumOfTire; + static const float mAllowableError; + static const float mStoppingMoveAngle; + static const float mRollTirePosition[]; + + float mOffsetHeadingAngle; + + float mMoveDirection_rad; + + I2CMotor** mTire; + I2CServo** mServo; + XBee* mXBee; + + Command::ActionType mActionType; + Command::ActionType mNextActionType; +}; + +#endif