2015/08/14

Dependencies:   VNH5019

Dependents:   Cansat_program4_1

Fork of cansat by Mami Yokokawa

cansat.h

Committer:
kityann
Date:
2015-07-16
Revision:
1:6a034792e059
Parent:
0:3f50511c1c1f
Child:
2:0f76226be922

File content as of revision 1:6a034792e059:

#ifndef CANSAT_H
#define CANSAT_H

/**
 * Includes
 */
#include "mbed.h"



const int distance_threshold[2]={0.1,0.5}

class CanSat{
    public:
        //ロボットとターゲットの方角からロボットの動きを決める
        char get_moving_angle(int robot_angle,int target_angle);
        //ロボットとターゲットの距離の計算
        double get_taget_distance();
        //ロボットとターゲットの距離から速度を決める
        int get_roboto_velocity();
        //気圧の取得
        double get_pressure();
        //スタック判定:加速度データをもとに?
        bool is_stack();
        //ログデータの送信
        void log_send();
    
    private:
        //モータ
        //VNH5019 _agzSheild;
        //ロボットのスピード:32,64,128の3つ?
        int speed;
        //ロボットとターゲットの座標(緯度と経度)を表す
        double robot_x,robot_y,target_x,target_y;
        //ロボットとターゲットの方角を表す。北を1として北東:2、東:3、南東4のように1~8の値を持つ
        int robot_angle,target_angle;
        //ジャイロ
        double gyro_x,gyro_y,gyro_z;
        //コンパス
        double compass_x,compass_y,compass_z;
        //気圧計の気圧、気温、湿度
        double pressure,temperature,humidity;
        //ロボットの速度
        int velocity;
        //ターゲットまでの距離
        int target_distance;
};

#endif