OBROT.h@4:82a00eee7eb5, 2015-11-13 (annotated)
- Committer:
- inst
- Date:
- Fri Nov 13 08:15:50 2015 +0000
- Revision:
- 4:82a00eee7eb5
- Parent:
- 2:cefcd4cb1777
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
inst | 0:4877273ec8cc | 1 | #ifndef INCLUDED_OBROT_H |
inst | 0:4877273ec8cc | 2 | #define INCLUDED_OBROT_H |
inst | 0:4877273ec8cc | 3 | |
inst | 0:4877273ec8cc | 4 | #include "mbed.h" |
inst | 0:4877273ec8cc | 5 | #include "Robot.h" |
inst | 0:4877273ec8cc | 6 | |
inst | 0:4877273ec8cc | 7 | class XBee; |
inst | 0:4877273ec8cc | 8 | class Steering; |
inst | 0:4877273ec8cc | 9 | class ShootingSystem; |
inst | 1:a46109178200 | 10 | class I2CServo; |
inst | 1:a46109178200 | 11 | class I2CMotor; |
inst | 1:a46109178200 | 12 | class Shooter; |
inst | 1:a46109178200 | 13 | class AmmoSupplier; |
inst | 1:a46109178200 | 14 | class AmmoPusher; |
inst | 0:4877273ec8cc | 15 | |
inst | 0:4877273ec8cc | 16 | namespace I2CDeviceID{ |
inst | 0:4877273ec8cc | 17 | enum ID{ |
inst | 0:4877273ec8cc | 18 | STEERING_MOTOR_0 = 0, |
inst | 0:4877273ec8cc | 19 | STEERING_MOTOR_1 = 1, |
inst | 0:4877273ec8cc | 20 | STEERING_MOTOR_2 = 2, |
inst | 0:4877273ec8cc | 21 | STEERING_SERVO_0 = 3, |
inst | 0:4877273ec8cc | 22 | STEERING_SERVO_1 = 4, |
inst | 0:4877273ec8cc | 23 | STEERING_SERVO_2 = 5, |
inst | 0:4877273ec8cc | 24 | XBEE = 6, |
inst | 0:4877273ec8cc | 25 | ANGLE_MANAGER = 7, |
inst | 0:4877273ec8cc | 26 | SHOOTER = 8, |
inst | 0:4877273ec8cc | 27 | AMMO_PUSHER = 9, |
inst | 0:4877273ec8cc | 28 | AMMO_SUPPLIER = 10, |
inst | 0:4877273ec8cc | 29 | POSITION_MANAGER = 11 |
inst | 0:4877273ec8cc | 30 | }; |
inst | 0:4877273ec8cc | 31 | } |
inst | 0:4877273ec8cc | 32 | |
inst | 0:4877273ec8cc | 33 | class OBROT : public Robot{ |
inst | 0:4877273ec8cc | 34 | public: |
inst | 2:cefcd4cb1777 | 35 | static OBROT* getInstance(){ |
inst | 0:4877273ec8cc | 36 | if ( mInstance == NULL ){ |
inst | 0:4877273ec8cc | 37 | mInstance = new OBROT; |
inst | 0:4877273ec8cc | 38 | } |
inst | 2:cefcd4cb1777 | 39 | |
inst | 0:4877273ec8cc | 40 | return mInstance; |
inst | 0:4877273ec8cc | 41 | } |
inst | 0:4877273ec8cc | 42 | |
inst | 0:4877273ec8cc | 43 | static const char mI2CDeviceAddress[]; |
inst | 0:4877273ec8cc | 44 | |
inst | 0:4877273ec8cc | 45 | private: |
inst | 0:4877273ec8cc | 46 | OBROT(); |
inst | 0:4877273ec8cc | 47 | ~OBROT(); |
inst | 0:4877273ec8cc | 48 | |
inst | 0:4877273ec8cc | 49 | virtual void updateAction(); |
inst | 0:4877273ec8cc | 50 | |
inst | 2:cefcd4cb1777 | 51 | I2CServo** initSteeringServo(); |
inst | 2:cefcd4cb1777 | 52 | I2CMotor** initSteeringTire(); |
inst | 2:cefcd4cb1777 | 53 | XBee* initXBee(); |
inst | 2:cefcd4cb1777 | 54 | I2CServo* initAngleManager(); |
inst | 2:cefcd4cb1777 | 55 | AmmoPusher* initAmmoPusher(); |
inst | 2:cefcd4cb1777 | 56 | AmmoSupplier* initAmmoSupplier(); |
inst | 2:cefcd4cb1777 | 57 | Shooter* initShooter(); |
inst | 2:cefcd4cb1777 | 58 | I2CServo* initPositionManager(); |
inst | 1:a46109178200 | 59 | |
inst | 0:4877273ec8cc | 60 | static OBROT* mInstance; |
inst | 0:4877273ec8cc | 61 | |
inst | 0:4877273ec8cc | 62 | Steering* mSteering; |
inst | 0:4877273ec8cc | 63 | ShootingSystem* mShootingSystem; |
inst | 0:4877273ec8cc | 64 | XBee* mXBee; |
inst | 0:4877273ec8cc | 65 | }; |
inst | 0:4877273ec8cc | 66 | |
inst | 0:4877273ec8cc | 67 | #endif |