Dependencies:   SteeringTire

Dependents:   OBROT_ALL

Steering.h

Committer:
inst
Date:
2015-08-15
Revision:
0:0bac1fed0273
Child:
1:4b719f80e9c4

File content as of revision 0:0bac1fed0273:

#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