2015.07.23

Dependencies:   ADXL345 CanSat_aoki HMC5883L ITG3200 MBed_Adafruit-GPS-Library XBee agzIDLIST mbed

Fork of Cansat_program by CanSat2015aizu

Files at this revision

API Documentation at this revision

Comitter:
aoki0731
Date:
Thu Jul 23 09:18:20 2015 +0000
Parent:
3:0bd9ad37f319
Commit message:
test

Changed in this revision

CanSat.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 0bd9ad37f319 -r 0fc7221e2f79 CanSat.lib
--- a/CanSat.lib	Thu Jul 23 08:55:47 2015 +0000
+++ b/CanSat.lib	Thu Jul 23 09:18:20 2015 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/CanSat2015aizu/code/CanSat/#0f76226be922
+https://developer.mbed.org/teams/CanSat2015aizu/code/CanSat_aoki/#a7510585a11a
diff -r 0bd9ad37f319 -r 0fc7221e2f79 main.cpp
--- a/main.cpp	Thu Jul 23 08:55:47 2015 +0000
+++ b/main.cpp	Thu Jul 23 09:18:20 2015 +0000
@@ -146,6 +146,44 @@
     
 } 
 
+//ロボットの動き方
+char robot_Action(double robot_angle, double target_angle) {
+    
+    double n, t, r;
+    t = target_angle;
+    r = robot_angle;
+    n = r - t;
+    if(n<0) n *= -1;
+    
+    
+    if(t==r) {
+        //前進
+        return 'f';
+    } else if(n < 4) {
+        if(t > r)
+            t -= 8;
+        else
+            r -= 8; 
+            
+        if(r-t > 0)
+            return 'l';
+        else
+            return 'r';
+    } else if(n >= 4) {
+        if(t > r)
+            t -= 8;
+        else
+            r -= 8; 
+            
+        if(r-t > 0)
+            return 'r';
+        else
+            return 'l';
+    }
+    
+    return 'b';
+}
+
 /******************************
 スタンバイモード
 ******************************/
@@ -164,7 +202,15 @@
 走行モード
 ******************************/
 void running(){
-            
+    double r = 6378.137;
+    double y1 = get_ta
+    double y2 = 
+    double x1 =
+    double x2 =
+    set_target_distance(r*acos(sin);
+    if(get_compass_z < 0) {
+        //ひっくり返っている
+    }    
 }
 
 /******************************