Dependents:   OBROT_ALL

Committer:
inst
Date:
Fri Aug 21 04:51:05 2015 +0000
Revision:
1:e541c8ebe96b
Parent:
0:57ef16865c0b
Child:
2:58d7debaed1f
y evol

Who changed what in which revision?

UserRevisionLine numberNew contents of line
inst 0:57ef16865c0b 1 #ifndef INCLUDED_COMMAND_H
inst 0:57ef16865c0b 2 #define INCLUDED_COMMAND_H
inst 0:57ef16865c0b 3
inst 0:57ef16865c0b 4 class Command{
inst 0:57ef16865c0b 5 public:
inst 1:e541c8ebe96b 6 enum ActionType{
inst 1:e541c8ebe96b 7 STOP = 0x00,
inst 1:e541c8ebe96b 8 MOVE = 0x10,
inst 1:e541c8ebe96b 9 ROLL = 0x20,
inst 1:e541c8ebe96b 10 ABS_ROLL = 0x30,
inst 1:e541c8ebe96b 11 WAIT_SERVO = 0xFF // 通信で送られて来ることはないデータ
inst 1:e541c8ebe96b 12 };
inst 1:e541c8ebe96b 13
inst 1:e541c8ebe96b 14 enum AimTargetType{
inst 1:e541c8ebe96b 15 NONE = 0x0,
inst 1:e541c8ebe96b 16 OWN_POLE = 0x4,
inst 1:e541c8ebe96b 17 CENTER_POLE = 0x8,
inst 1:e541c8ebe96b 18 ENEMYS_POLE = 0xC
inst 1:e541c8ebe96b 19 };
inst 1:e541c8ebe96b 20
inst 1:e541c8ebe96b 21 enum ShotTargetID{
inst 1:e541c8ebe96b 22 OWN_POLE_ID,
inst 1:e541c8ebe96b 23 CENTER_POLE_ID,
inst 1:e541c8ebe96b 24 ENEMYS_POLE_ID
inst 1:e541c8ebe96b 25 };
inst 1:e541c8ebe96b 26
inst 1:e541c8ebe96b 27 Command( ActionType action, float moveDirection_rad, float moveDuty, float roll, bool isShootabl, AimTargetType target );
inst 1:e541c8ebe96b 28
inst 1:e541c8ebe96b 29 void setActionType( ActionType action ){
inst 1:e541c8ebe96b 30 mActionType = action;
inst 1:e541c8ebe96b 31 }
inst 1:e541c8ebe96b 32 void setMoveDirection_rad( float moveDirection_rad ){
inst 1:e541c8ebe96b 33 mMoveDirection_rad = moveDirection_rad;
inst 1:e541c8ebe96b 34 }
inst 1:e541c8ebe96b 35 void setMoveDuty( float moveDuty ){
inst 1:e541c8ebe96b 36 mMoveDuty = moveDuty;
inst 1:e541c8ebe96b 37 }
inst 1:e541c8ebe96b 38 void setRollCoeff( float rollCoeff ){
inst 1:e541c8ebe96b 39 mRollCoeff = rollCoeff;
inst 1:e541c8ebe96b 40 }
inst 1:e541c8ebe96b 41 void setAimStateByTargetType( AimTargetType target );
inst 1:e541c8ebe96b 42 void setPositionOfShooting( float position ){
inst 1:e541c8ebe96b 43 mPositionOfShooting = position;
inst 1:e541c8ebe96b 44 }
inst 1:e541c8ebe96b 45 void setAngleOfShooting( float angle ){
inst 1:e541c8ebe96b 46 mAngleOfShooting = angle;
inst 0:57ef16865c0b 47 }
inst 0:57ef16865c0b 48
inst 1:e541c8ebe96b 49 ActionType getActionType(){
inst 0:57ef16865c0b 50 return mActionType;
inst 0:57ef16865c0b 51 }
inst 0:57ef16865c0b 52 float getMoveDirection_rad(){
inst 0:57ef16865c0b 53 return mMoveDirection_rad;
inst 0:57ef16865c0b 54 }
inst 0:57ef16865c0b 55 float getMoveDuty(){
inst 0:57ef16865c0b 56 return mMoveDuty;
inst 0:57ef16865c0b 57 }
inst 0:57ef16865c0b 58 float getRollCoeff(){
inst 0:57ef16865c0b 59 return mRollCoeff;
inst 0:57ef16865c0b 60 }
inst 1:e541c8ebe96b 61 float getPositionOfShooting(){
inst 1:e541c8ebe96b 62 return mPositionOfShooting;
inst 1:e541c8ebe96b 63 }
inst 1:e541c8ebe96b 64 float getAngleOfShooting(){
inst 1:e541c8ebe96b 65 return mAngleOfShooting;
inst 1:e541c8ebe96b 66 }
inst 1:e541c8ebe96b 67 bool isShootable(){
inst 1:e541c8ebe96b 68 return mIsShootable;
inst 1:e541c8ebe96b 69 }
inst 0:57ef16865c0b 70
inst 0:57ef16865c0b 71 private:
inst 1:e541c8ebe96b 72 static const float mPositionSetOfShooting[];
inst 1:e541c8ebe96b 73 static const float mAngleSetOfShooting[];
inst 1:e541c8ebe96b 74
inst 1:e541c8ebe96b 75 ActionType mActionType;
inst 0:57ef16865c0b 76 float mMoveDirection_rad;
inst 0:57ef16865c0b 77 float mMoveDuty;
inst 0:57ef16865c0b 78 float mRollCoeff;
inst 1:e541c8ebe96b 79 float mPositionOfShooting;
inst 1:e541c8ebe96b 80 float mAngleOfShooting;
inst 1:e541c8ebe96b 81 bool mIsShootable;
inst 0:57ef16865c0b 82 };
inst 0:57ef16865c0b 83
inst 0:57ef16865c0b 84 #endif