Diff: Command.h
- Revision:
- 1:e541c8ebe96b
- Parent:
- 0:57ef16865c0b
- Child:
- 2:58d7debaed1f
--- a/Command.h Sat Aug 15 12:52:19 2015 +0000 +++ b/Command.h Fri Aug 21 04:51:05 2015 +0000 @@ -1,38 +1,84 @@ #ifndef INCLUDED_COMMAND_H #define INCLUDED_COMMAND_H -#include "Steering.h" - class Command{ public: - Command( Steering::ActionType action, float moveDirection_rad, float moveDuty, float roll ) : - mActionType( action ), - mMoveDirection_rad( moveDirection_rad ), - mMoveDuty( moveDuty ), - mRollCoeff( roll ){ + enum ActionType{ + STOP = 0x00, + MOVE = 0x10, + ROLL = 0x20, + ABS_ROLL = 0x30, + WAIT_SERVO = 0xFF // 通信で送られて来ることはないデータ + }; + + enum AimTargetType{ + NONE = 0x0, + OWN_POLE = 0x4, + CENTER_POLE = 0x8, + ENEMYS_POLE = 0xC + }; + + enum ShotTargetID{ + OWN_POLE_ID, + CENTER_POLE_ID, + ENEMYS_POLE_ID + }; + + Command( ActionType action, float moveDirection_rad, float moveDuty, float roll, bool isShootabl, AimTargetType target ); + + void setActionType( ActionType action ){ + mActionType = action; + } + void setMoveDirection_rad( float moveDirection_rad ){ + mMoveDirection_rad = moveDirection_rad; + } + void setMoveDuty( float moveDuty ){ + mMoveDuty = moveDuty; + } + void setRollCoeff( float rollCoeff ){ + mRollCoeff = rollCoeff; + } + void setAimStateByTargetType( AimTargetType target ); + void setPositionOfShooting( float position ){ + mPositionOfShooting = position; + } + void setAngleOfShooting( float angle ){ + mAngleOfShooting = angle; } - Steering::ActionType getActionType(){ + ActionType getActionType(){ return mActionType; } - float getMoveDirection_rad(){ return mMoveDirection_rad; } - float getMoveDuty(){ return mMoveDuty; } - float getRollCoeff(){ return mRollCoeff; } + float getPositionOfShooting(){ + return mPositionOfShooting; + } + float getAngleOfShooting(){ + return mAngleOfShooting; + } + bool isShootable(){ + return mIsShootable; + } private: - Steering::ActionType mActionType; + static const float mPositionSetOfShooting[]; + static const float mAngleSetOfShooting[]; + + ActionType mActionType; float mMoveDirection_rad; float mMoveDuty; float mRollCoeff; + float mPositionOfShooting; + float mAngleOfShooting; + bool mIsShootable; }; #endif