卒研

Dependencies:   P_motor T_motor

Fork of omuni by gaku takasawa

Files at this revision

API Documentation at this revision

Comitter:
kikoaac
Date:
Fri Mar 02 02:54:58 2018 +0000
Parent:
6:60f122986f29
Commit message:
??

Changed in this revision

omuni.cpp Show annotated file Show diff for this revision Revisions of this file
omuni.h Show annotated file Show diff for this revision Revisions of this file
diff -r 60f122986f29 -r 76e11784ce6b omuni.cpp
--- a/omuni.cpp	Wed Oct 25 08:53:17 2017 +0000
+++ b/omuni.cpp	Fri Mar 02 02:54:58 2018 +0000
@@ -46,29 +46,22 @@
     float x_2 = cos(sieta2);
     float y_2 = sin(sieta2);
     float w = 0;
-    if(r1 > 0.1F) {
-        if(sieta1 > PI/3 && sieta1 < PI*2/3.0)
-            w = PI/3;
-        if((sieta1 < -PI/3 && sieta1 > -2*PI/3.0))
-            w = -PI/3;
-    }
+    w = PI/3*x1*0.01;
+   
     
-    if(r2)
-    {
+    //if(r2)
+    //{
         m1 = r2*float(sin(alpha)*-x2*0.01) + float(L*w);
         m2 = r2*float(sin(alpha+4.0/3*PI)*-x2 - cos(alpha+4.0/3*PI)*y2)*0.01 + float(L*w);
         m3 = r2*float(sin(alpha+2.0/3*PI)*-x2 - cos(alpha+2.0/3*PI)*y2)*0.01 + float(L*w);
-        m1.run();
-        m2.run();
-        m3.run();
-    }
-    else
+    //}
+    /*else
     {
         float spdt = 0.5f * float(L*w);
         m1.direct_controll(spdt);
         m2.direct_controll(spdt);
         m3.direct_controll(spdt);
-    }
+    }*/
     //printf("%5.2f : %5.2f : %5.2f : %5.2f",(float)x2,(float)y2,sieta1*180/PI,r1);
     //printf("\n");
 }
\ No newline at end of file
diff -r 60f122986f29 -r 76e11784ce6b omuni.h
--- a/omuni.h	Wed Oct 25 08:53:17 2017 +0000
+++ b/omuni.h	Fri Mar 02 02:54:58 2018 +0000
@@ -10,7 +10,7 @@
 class omuni{
     private:
         I2C *i2c;
-        P_motor m1,m2,m3;
+        T_motor m1,m2,m3;
         char RXData[dataNum];
         int8_t map(int8_t in, int8_t inMin, int8_t inMax, int8_t outMin, int8_t outMax);