2015/08/11
Dependents: Cansat_program3 Cansat_program4
Fork of CanSat_aoki by
cansat.h@0:3f50511c1c1f, 2015-07-11 (annotated)
- Committer:
- kityann
- Date:
- Sat Jul 11 06:35:44 2015 +0000
- Revision:
- 0:3f50511c1c1f
- Child:
- 1:6a034792e059
2015/07/11
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kityann | 0:3f50511c1c1f | 1 | #ifndef CANSAT_H |
kityann | 0:3f50511c1c1f | 2 | #define CANSAT_H |
kityann | 0:3f50511c1c1f | 3 | |
kityann | 0:3f50511c1c1f | 4 | /** |
kityann | 0:3f50511c1c1f | 5 | * Includes |
kityann | 0:3f50511c1c1f | 6 | */ |
kityann | 0:3f50511c1c1f | 7 | #include "mbed.h" |
kityann | 0:3f50511c1c1f | 8 | |
kityann | 0:3f50511c1c1f | 9 | |
kityann | 0:3f50511c1c1f | 10 | class CanSat{ |
kityann | 0:3f50511c1c1f | 11 | public: |
kityann | 0:3f50511c1c1f | 12 | //ロボットとターゲットの方角からロボットの動きを決める |
kityann | 0:3f50511c1c1f | 13 | char get_moving_angle(int robot_angle,int target_angle); |
kityann | 0:3f50511c1c1f | 14 | //ロボットとターゲットの距離の計算 |
kityann | 0:3f50511c1c1f | 15 | double get_taget_distance(); |
kityann | 0:3f50511c1c1f | 16 | //ロボットとターゲットの距離から速度を決める |
kityann | 0:3f50511c1c1f | 17 | int get_roboto_velocity(); |
kityann | 0:3f50511c1c1f | 18 | //気圧の取得 |
kityann | 0:3f50511c1c1f | 19 | double get_pressure(); |
kityann | 0:3f50511c1c1f | 20 | //スタック判定:加速度データをもとに? |
kityann | 0:3f50511c1c1f | 21 | bool is_stack(); |
kityann | 0:3f50511c1c1f | 22 | //ログデータの送信 |
kityann | 0:3f50511c1c1f | 23 | void log_send(); |
kityann | 0:3f50511c1c1f | 24 | |
kityann | 0:3f50511c1c1f | 25 | private: |
kityann | 0:3f50511c1c1f | 26 | //モータ |
kityann | 0:3f50511c1c1f | 27 | //VNH5019 _agzSheild; |
kityann | 0:3f50511c1c1f | 28 | //ロボットとターゲットの座標(緯度と経度)を表す |
kityann | 0:3f50511c1c1f | 29 | double robot_x,robot_y,target_x,target_y; |
kityann | 0:3f50511c1c1f | 30 | //ロボットとターゲットの方角を表す。北を1として北東:2、東:3、南東4のように1~8の値を持つ |
kityann | 0:3f50511c1c1f | 31 | int robot_angle,target_angle; |
kityann | 0:3f50511c1c1f | 32 | //ジャイロ |
kityann | 0:3f50511c1c1f | 33 | double gyro_x,gyro_y,gyro_z; |
kityann | 0:3f50511c1c1f | 34 | //コンパス |
kityann | 0:3f50511c1c1f | 35 | double compass_x,compass_y,compass_z; |
kityann | 0:3f50511c1c1f | 36 | //気圧計の気圧、気温、湿度 |
kityann | 0:3f50511c1c1f | 37 | double pressure,temperature,humidity; |
kityann | 0:3f50511c1c1f | 38 | //ロボットの速度 |
kityann | 0:3f50511c1c1f | 39 | int velocity; |
kityann | 0:3f50511c1c1f | 40 | //ターゲットまでの距離 |
kityann | 0:3f50511c1c1f | 41 | int target_distance; |
kityann | 0:3f50511c1c1f | 42 | }; |
kityann | 0:3f50511c1c1f | 43 | |
kityann | 0:3f50511c1c1f | 44 | #endif |