aigamo get data
Dependents: agz_base_ver2 agz_base_ver2 get_GPS_data_ver1 aigamozu_program_ver2 ... more
agz_common.h@3:14e469b0c33e, 2015-04-20 (annotated)
- Committer:
- kityann
- Date:
- Mon Apr 20 10:36:59 2015 +0000
- Revision:
- 3:14e469b0c33e
- Parent:
- 0:54e62ef6d287
a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kityann | 0:54e62ef6d287 | 1 | //define common data |
kityann | 0:54e62ef6d287 | 2 | |
kityann | 0:54e62ef6d287 | 3 | #ifndef AGZ_COMMON |
kityann | 0:54e62ef6d287 | 4 | #define AGZ_COMMON |
kityann | 0:54e62ef6d287 | 5 | |
kityann | 0:54e62ef6d287 | 6 | #include "XBee.h" |
kityann | 0:54e62ef6d287 | 7 | #include "mbed.h" |
kityann | 0:54e62ef6d287 | 8 | |
kityann | 0:54e62ef6d287 | 9 | //device num with XBee |
kityann | 0:54e62ef6d287 | 10 | #define AGZ_NUM_NODES 56 |
kityann | 0:54e62ef6d287 | 11 | |
kityann | 0:54e62ef6d287 | 12 | //about robot |
kityann | 0:54e62ef6d287 | 13 | #define AGZ_NUM_ROBOTS 4//40 |
kityann | 0:54e62ef6d287 | 14 | #define AGZ_FROM_ROBOT 0 |
kityann | 0:54e62ef6d287 | 15 | #define AGZ_TO_ROBOT 39 |
kityann | 0:54e62ef6d287 | 16 | |
kityann | 0:54e62ef6d287 | 17 | //about base |
kityann | 0:54e62ef6d287 | 18 | #define AGZ_FROM_BASE 40 |
kityann | 0:54e62ef6d287 | 19 | #define AGZ_TO_BASE 47 |
kityann | 0:54e62ef6d287 | 20 | #define AGZ_BASE_A_FROM_ROBOT_ID 0 |
kityann | 0:54e62ef6d287 | 21 | #define AGZ_BASE_A_TO_ROBOT_ID 7 |
kityann | 0:54e62ef6d287 | 22 | #define AGZ_BASE_B_FROM_ROBOT_ID 8 |
kityann | 0:54e62ef6d287 | 23 | #define AGZ_BASE_B_TO_ROBOT_ID 15 |
kityann | 0:54e62ef6d287 | 24 | #define AGZ_BASE_C_FROM_ROBOT_ID 16 |
kityann | 0:54e62ef6d287 | 25 | #define AGZ_BASE_C_TO_ROBOT_ID 23 |
kityann | 0:54e62ef6d287 | 26 | |
kityann | 0:54e62ef6d287 | 27 | //about joy-stick |
kityann | 0:54e62ef6d287 | 28 | #define AGZ_FROM_JOY 48 |
kityann | 0:54e62ef6d287 | 29 | #define AGZ_TO_JOY 55 |
kityann | 0:54e62ef6d287 | 30 | |
kityann | 0:54e62ef6d287 | 31 | /*---------------------------------------------------------- |
kityann | 0:54e62ef6d287 | 32 | data of Xbee |
kityann | 0:54e62ef6d287 | 33 | -----------------------------------------------------------*/ |
kityann | 0:54e62ef6d287 | 34 | //Addres List |
kityann | 0:54e62ef6d287 | 35 | extern XBeeAddress64 Agz_XBee_Remote_Address[AGZ_NUM_ROBOTS]; |
kityann | 0:54e62ef6d287 | 36 | |
kityann | 0:54e62ef6d287 | 37 | |
kityann | 0:54e62ef6d287 | 38 | |
kityann | 0:54e62ef6d287 | 39 | /*---------------------------------------------------------- |
kityann | 0:54e62ef6d287 | 40 | data of ROBOT |
kityann | 0:54e62ef6d287 | 41 | -----------------------------------------------------------*/ |
kityann | 0:54e62ef6d287 | 42 | union AGZ_UNION_INT8_LONG{ |
kityann | 0:54e62ef6d287 | 43 | uint8_t value_ch[4]; |
kityann | 0:54e62ef6d287 | 44 | long value_long; |
kityann | 0:54e62ef6d287 | 45 | }; |
kityann | 0:54e62ef6d287 | 46 | |
kityann | 0:54e62ef6d287 | 47 | class AGZ_ROBOT{ |
kityann | 0:54e62ef6d287 | 48 | private: |
kityann | 0:54e62ef6d287 | 49 | uint8_t state; |
kityann | 0:54e62ef6d287 | 50 | AGZ_UNION_INT8_LONG LatitudeH,LatitudeL, LongitudeH,LongitudeL; |
kityann | 3:14e469b0c33e | 51 | AGZ_UNION_INT8_LONG LatitudeKH,LatitudeKL, LongitudeKH,LongitudeKL; |
kityann | 0:54e62ef6d287 | 52 | public: |
kityann | 0:54e62ef6d287 | 53 | AGZ_ROBOT(); |
kityann | 0:54e62ef6d287 | 54 | void set_state(uint8_t); |
kityann | 0:54e62ef6d287 | 55 | void set_LatitudeH(uint8_t*); |
kityann | 0:54e62ef6d287 | 56 | void set_LatitudeL(uint8_t*); |
kityann | 0:54e62ef6d287 | 57 | void set_LongitudeH(uint8_t*); |
kityann | 0:54e62ef6d287 | 58 | void set_LongitudeL(uint8_t*); |
kityann | 0:54e62ef6d287 | 59 | uint8_t get_state(); |
kityann | 0:54e62ef6d287 | 60 | long get_LatitudeH(); |
kityann | 0:54e62ef6d287 | 61 | long get_LatitudeL(); |
kityann | 0:54e62ef6d287 | 62 | long get_LongitudeH(); |
kityann | 0:54e62ef6d287 | 63 | long get_LongitudeL(); |
kityann | 3:14e469b0c33e | 64 | void set_LatitudeKH(uint8_t*); |
kityann | 3:14e469b0c33e | 65 | void set_LatitudeKL(uint8_t*); |
kityann | 3:14e469b0c33e | 66 | void set_LongitudeKH(uint8_t*); |
kityann | 3:14e469b0c33e | 67 | void set_LongitudeKL(uint8_t*); |
kityann | 3:14e469b0c33e | 68 | long get_LatitudeKH(); |
kityann | 3:14e469b0c33e | 69 | long get_LatitudeKL(); |
kityann | 3:14e469b0c33e | 70 | long get_LongitudeKH(); |
kityann | 3:14e469b0c33e | 71 | long get_LongitudeKL(); |
kityann | 0:54e62ef6d287 | 72 | }; |
kityann | 0:54e62ef6d287 | 73 | |
kityann | 0:54e62ef6d287 | 74 | /*---------------------------------------------------------- |
kityann | 0:54e62ef6d287 | 75 | data of BASE |
kityann | 0:54e62ef6d287 | 76 | -----------------------------------------------------------*/ |
kityann | 0:54e62ef6d287 | 77 | |
kityann | 0:54e62ef6d287 | 78 | |
kityann | 0:54e62ef6d287 | 79 | /*---------------------------------------------------------- |
kityann | 0:54e62ef6d287 | 80 | data of JOY-STICK |
kityann | 0:54e62ef6d287 | 81 | -----------------------------------------------------------*/ |
kityann | 0:54e62ef6d287 | 82 | |
kityann | 0:54e62ef6d287 | 83 | |
kityann | 0:54e62ef6d287 | 84 | |
kityann | 0:54e62ef6d287 | 85 | |
kityann | 0:54e62ef6d287 | 86 | #endif |