wheel_test7

Dependencies:   QEI omni_wheel prototype01 PID ikarashiMDC OmniPosition

Files at this revision

API Documentation at this revision

Comitter:
piroro4560
Date:
Mon Aug 26 05:16:15 2019 +0000
Parent:
0:898471aea1af
Commit message:
using proto01; ;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
prototype01.lib Show annotated file Show diff for this revision Revisions of this file
sample.lib Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Aug 22 06:39:31 2019 +0000
+++ b/main.cpp	Mon Aug 26 05:16:15 2019 +0000
@@ -1,7 +1,7 @@
 #include "mbed.h"           //wheel_test7
-#include "ikarashiMDC.h"    //sampleライブラリ+PID -> うひょひょひょ
+#include "ikarashiMDC.h"    //protoライブラリ+PID -> うひょひょひょ
 #include "omni_wheel.h"
-#include "sample02.h"
+#include "proto01.h"
 #include "OmniPosition.h"
 #include "PID.h"
 
@@ -22,7 +22,7 @@
     ikarashiMDC(&serialcontrol,0,3,SM,&serial),
 };
 
-Sample sample(500, 1000, 0.4, 0.14);
+Proto1 proto(500, 1000, 0.4, 0.14);
 
 int main()
 {
@@ -42,25 +42,23 @@
     angle.setSetPoint(0);
     while(1){
         
-        if (cnt==500) sample.target_xy(-3800, 0, posi.getX(), posi.getY());
-        if (cnt==1000) sample.target_xy(0, 0, posi.getX(), posi.getY());
-        if (cnt==1500) sample.target_xy(-2000, 0, posi.getX(), posi.getY());
-        if (cnt==2000) sample.target_xy(-2000, 2700, posi.getX(), posi.getY());
-        if (cnt==2500) sample.target_xy(-2000, 0, posi.getX(), posi.getY());
-        if (cnt==3000) sample.target_xy(0, 0, posi.getX(), posi.getY());
+        if (cnt==500) prot.target_xy(-3800, 0, posi.getX(), posi.getY());
+        if (cnt==1000) proto.target_xy(0, 0, posi.getX(), posi.getY());
+        if (cnt==1500) proto.target_xy(-2000, 0, posi.getX(), posi.getY());
+        if (cnt==2000) proto.target_xy(-2000, 2700, posi.getX(), posi.getY());
+        if (cnt==2500) proto.target_xy(-2000, 0, posi.getX(), posi.getY());
+        if (cnt==3000) proto.target_xy(0, 0, posi.getX(), posi.getY());
         angle.setProcessValue(posi.getTheta());
         double spin_power = -angle.compute();
-        sample.calculate(posi.getX(), posi.getY());
-        omni.computeXY(sample.getvalue_x(), sample.getvalue_y(), spin_power);
-//        omni.computeXY(0, 0, spin_power);
+        proto.calculate(posi.getX(), posi.getY());
+        omni.computeXY(proto.getvalue_x(), proto.getvalue_y(), spin_power);
         
         for(int i = 0; i < 4; i++){
             value[i] = omni.wheel[i];
             pc.printf("%.2f || ",value[i]);
         }
-        int a = sample.nowDis > (sample.accdis+sample.middledis);
         pc.printf("x:%d || y:%d || θ:%f || vector:%f || now:%f || c:%f"
-        , posi.getX(), posi.getY(), posi.getTheta(), sample.vector, sample.nowDis, sample.counter);
+        , posi.getX(), posi.getY(), posi.getTheta(), proto.vector, proto.nowDis, proto.counter);
         
         for(int i = 0; i < 4; i++) {
             if (fabs(value[i]) < 0.05) value[i] = 0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/prototype01.lib	Mon Aug 26 05:16:15 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/NHK-Robocon2016_Nagaoka_B_Team/code/prototype01/#c46f084010aa
--- a/sample.lib	Thu Aug 22 06:39:31 2019 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://os.mbed.com/users/piroro4560/code/sample/#3dfd0b02745f