卒研

Dependencies:   P_motor T_motor

Fork of omuni by gaku takasawa

Revision:
7:76e11784ce6b
Parent:
6:60f122986f29
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