Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main_ps3.cpp
- Revision:
- 1:3ac2087996f3
- Parent:
- 0:b613dc16f27d
- Child:
- 2:738b28f6a04b
--- a/main_ps3.cpp Wed Oct 28 09:03:19 2015 +0000 +++ b/main_ps3.cpp Wed Oct 28 09:26:31 2015 +0000 @@ -2,20 +2,6 @@ * This program is written in main micro computer "mbed" for 2015 NHK Robot Contest (Bteam). */ -//回転機構wait PI/4 追加で待つ -//射出をスキップする機能を追加 -//スタートゾーンにマシンを戻した後に暴走しないようにする -//手動時の操作性の改善 -//一度手動モードになったらスタートゾーンに戻るまで再び自動モードにならないようにする -//flagfで前進・後退切り替え -//大和田射角 -//午後に一定回転制御の実験 -//モード切替時に時間を待つ -//赤チーム側を青チーム側のプログラムに合わせて実装 -//横幅調整済み -//相手妨害モードいらない new!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -//赤チームモード、相手チーム側の射出位置調整 - /***コース選択***/ //#define BLUE #define RED @@ -24,7 +10,7 @@ #define IM920 //#define PS3 -/***回転機構測定***/ +/******/ //#define MESURE #if defined(IM920) && defined(PS3) @@ -48,7 +34,13 @@ Ticker Com; void Call(){ mesure_state(); - if(autoflag) cal=1; + if(autoflag){ + move_following(); + if(spcount<speed){ + spcount+=speed/100.0; + targ_velocity=spcount; + } + } } int main() { @@ -85,10 +77,6 @@ #endif #ifdef BLUE //Blue - if(spcount<speed){ - spcount+=speed/100.0; - targ_velocity=spcount; - } /********************************Nomal Mode*********************************/ if((step==0)&&((8650.0>x)&&(x>800.0))) { targ_sita=0.025; @@ -214,10 +202,6 @@ } #else //Red - if(spcount<speed){ - spcount+=speed/100.0; - targ_velocity=spcount; - } /********************************Nomal Mode*********************************/ if((step==0)&&((8650.0>x)&&(x>800.0))) { targ_sita=-0.025; @@ -348,10 +332,6 @@ #endif // mesure_state(); /*位置測定*/ // move_following(); /*移動制御*/ - if(cal){ - cal=0; - move_following(); - } } else if(!autoflag) { flaga=0; @@ -374,13 +354,9 @@ #ifdef IM920 readIM920(); #endif -// mesureSwing(); pc.printf("x:%f,y:%f\r\n",x,y); // wait(RATE); // pc.printf("%f\r\n",(float)((((2.0 * PI) / swingRadVelocity) / 4.0))); -// pc.printf("sita:%f, x:%f, y:%f ,x1:%f, x2:%f ,velocity:%f\r\n",sita,x,y,x1,x2,velocity); -// pc.printf("A2 = %d, X = %d, Y = %d, B = %d, dead = %d\r\n", a2, X, Y, b, deadflag); -// pc.printf("%f %f %f\r\n",cont,swingRadVelocity, (double)SwingSens.getPulses()); } }