Dependents:   OBROT_ALL

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Command.h Source File

Command.h

00001 #ifndef INCLUDED_COMMAND_H
00002 #define INCLUDED_COMMAND_H
00003 
00004 #include "Steering.h"
00005 #include "Shooter.h"
00006 #include "ShootingSystem.h"
00007 
00008 class Command{
00009 public:
00010     enum ShotTargetID{
00011         OWN_POLE_ID,
00012         CENTER_MIDDLE_POLE_ID,
00013         CENTER_SIDE_POLE_ID,
00014         ENEMYS_POLE_ID
00015     };
00016     
00017     Command();
00018     Command( Steering::ActionType steeringAction,
00019              ShootingSystem::AimState aimState,
00020              float moveDirection_rad, float angleAdjust_deg,
00021              float moveDuty, float roll, bool isSupplying );
00022     
00023     void setSteeringActionType( Steering::ActionType action ){
00024         mSteeringActionType = action;
00025     }
00026     void setAimStateAndAimParam( ShootingSystem::AimState aimState );
00027     void setMoveDirection_rad( float moveDirection_rad ){
00028         mMoveDirection_rad = moveDirection_rad;
00029     }
00030     void setMoveDuty( float moveDuty ){
00031         mMoveDuty = moveDuty;
00032     }
00033     void setRollCoeff( float rollCoeff ){
00034         mRollCoeff = rollCoeff;
00035     }
00036     void setAngleOfShooting( float angle ){
00037         mShootingAngle_deg = angle;
00038     }
00039     void setAngleAdjust_deg( float angle_deg ){
00040         mAngleAdjust_deg = angle_deg;
00041     }
00042     void setShooterPosition( float pos ){
00043         mShooterPosition = pos;
00044     }
00045     
00046     Steering::ActionType getSteeringActionType(){
00047         return mSteeringActionType;
00048     }
00049     ShootingSystem::AimState getAimState(){
00050         return mAimState;
00051     }
00052     float getMoveDirection_rad(){
00053         return mMoveDirection_rad;
00054     }
00055     float getMoveDuty(){
00056         return mMoveDuty;
00057     }
00058     float getRollCoeff(){
00059         return mRollCoeff;
00060     }
00061     float getShootingAngleAnalog(){
00062         return angleToAnalog( mShootingAngle_deg );
00063     }
00064     Shooter::ActionType getShootVoltage(){
00065         return mShootVoltage;
00066     }
00067     float getAngleAdjust_deg(){
00068         return mAngleAdjust_deg;
00069     }
00070     float getShooterPosition(){
00071         return mShooterPosition;
00072     }
00073     bool isShooting(){
00074         return mIsShooting;
00075     }
00076     bool isSupplying(){
00077         return mIsSupplying;
00078     }
00079     
00080 private:
00081     float angleToAnalog( float angle_deg ){
00082         return mAngleToAnalogCoeffA * angle_deg + mAngleToAnalogCoeffB;
00083     }
00084 
00085     static const float mShootingAngleTable[];
00086     static const float mAngleToAnalogCoeffA;
00087     static const float mAngleToAnalogCoeffB;
00088     static const float mMaxAngle_deg;
00089     static const float mMinAngle_deg;
00090     static const float mShooterPositionTable[];
00091     
00092     Steering::ActionType mSteeringActionType;
00093     Shooter::ActionType mShootVoltage;
00094     ShootingSystem::AimState mAimState;
00095     float mMoveDirection_rad;
00096     float mMoveDuty;
00097     float mRollCoeff;
00098     float mShootingAngle_deg;
00099     float mAngleAdjust_deg;
00100     float mShooterPosition;
00101     bool mIsShooting;
00102     bool mIsSupplying;
00103 };
00104 
00105 #endif