2015.07.23

Dependencies:   VNH5019

Dependents:   Cansat_program2

Fork of CanSat by CanSat2015aizu

Files at this revision

API Documentation at this revision

Comitter:
s1210160
Date:
Mon Aug 10 10:01:15 2015 +0000
Parent:
4:8713fff9e20d
Commit message:
2015/08/10

Changed in this revision

cansat.cpp Show annotated file Show diff for this revision Revisions of this file
cansat.h Show annotated file Show diff for this revision Revisions of this file
diff -r 8713fff9e20d -r 534a54a44b22 cansat.cpp
--- a/cansat.cpp	Thu Aug 06 17:06:08 2015 +0000
+++ b/cansat.cpp	Mon Aug 10 10:01:15 2015 +0000
@@ -50,9 +50,18 @@
 double CanSat::get_robotKalman_y(){
     return robotK_y;
 }
-double CanSat::get_compass_z(){
+int16_t CanSat::get_compass_x(){
+    return compass_x;
+}
+int16_t CanSat::get_compass_y(){
+    return compass_y;
+}
+int16_t CanSat::get_compass_z(){
     return compass_z;
 }
+double CanSat::get_compass_angle(){
+    return compass_angle;
+}
 double CanSat::get_target_distance(){
     return target_distance;
 }
@@ -101,10 +110,11 @@
     CanSat::gyro_y = y;
     CanSat::gyro_z = z;    
 }
-void CanSat::set_compass(double x, double y, double z){
+void CanSat::set_compass(int16_t x, int16_t y, int16_t z, double angle){
     CanSat::compass_x = x;
     CanSat::compass_y = y;
     CanSat::compass_z = z;
+    CanSat::compass_angle = angle;
 }
 void CanSat::set_pressure(double p){
     CanSat::pressure = p;
diff -r 8713fff9e20d -r 534a54a44b22 cansat.h
--- a/cansat.h	Thu Aug 06 17:06:08 2015 +0000
+++ b/cansat.h	Mon Aug 10 10:01:15 2015 +0000
@@ -36,7 +36,10 @@
         double get_robot_y();
         double get_robotKalman_x();
         double get_robotKalman_y();
-        double get_compass_z();
+        int16_t get_compass_x();
+        int16_t get_compass_y();
+        int16_t get_compass_z();
+        double get_compass_angle();
         double get_target_distance();
         double get_target_x();
         double get_target_y();
@@ -55,7 +58,7 @@
         void set_robotKalman_y(double);
     
         void set_gyro(double x, double y, double z);
-        void set_compass(double x, double y, double z);
+        void set_compass(int16_t x, int16_t y, int16_t z, double angle);
         void set_pressure(double p);
         void set_temperature(double t);
         void set_humidity(double h);
@@ -75,12 +78,13 @@
         double robot_x,robot_y;
         double robotK_x,robotK_y;//kalman filter
         double target_x,target_y;
-        //ロボットとターゲットの方角を表す。北を1として北東:2、東:3、南東4のように1~8の値を持つ
+        //ロボットとターゲットの方角を表す。北を0として北東:1、東:1、南東3のように0~7の値を持つ
         int robot_angle,target_angle;
         //ジャイロ
         int gyro_x,gyro_y,gyro_z;
         //コンパス
         int compass_x,compass_y,compass_z;
+        double compass_angle;
         //加速度
         double acceleration_x,acceleration_y,acceleration_z;
         //気圧計の気圧、気温、湿度