![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
yei
Dependencies: interface mbed enc_1multi calPID motorout KondoServoLibrary
Fork of cat18_operate by
Diff: main.cpp
- Revision:
- 37:d4b711619962
- Parent:
- 36:b8171eeefcd0
- Child:
- 38:9bed85d32c97
diff -r b8171eeefcd0 -r d4b711619962 main.cpp --- a/main.cpp Wed Sep 05 03:58:53 2018 +0000 +++ b/main.cpp Wed Sep 05 09:37:41 2018 +0000 @@ -12,7 +12,10 @@ //debug用に追加 #include "coordinate.h" //#define DEBUG_MODE -const int kWait_ms = 250; +const int kWait_ms = 500; +const double kServoOffsetDegreeInBox = 10; + + int worknum = 0; int main() { @@ -31,7 +34,10 @@ while((worknum = CalPickPlace()) != 23 ) { Close(); //ワークに向かう - if(Go(work[worknum]) != 0) continue; + if(Go(work[worknum]) == -1) { + work[worknum].is_exist = 0; + continue; + } //掴む wait_ms(kWait_ms); Close(); @@ -43,21 +49,18 @@ work[worknum].is_exist = 0; //シュート位置計算 int boxspace = CalPutPlace(work[worknum].color); + OriginDegree[0] = kOriginDegree[0] - kServoOffsetDegreeInBox; //ボックスに行く(失敗(-1)したらcontinue) //3のときだけ特別に速度下げる if(worknum == 3) kServoVelocity_mm = 100; if(Go(shootingbox[boxspace]) != 0) continue; - __disable_irq();//割込み禁止 ManualPutPlace(shootingbox[boxspace]); kServoVelocity_mm = 300; //放す Open(); - wait_ms(1000); + wait_ms(kWait_ms); + OriginDegree[0] = kOriginDegree[0]; //上に持ち上げる - pre_skip = -1; - do_skip = 0; - __enable_irq();//割込み許可 - Above(BOX); wait_ms(kWait_ms); //置いたことを保存