タコ 駆動側
Dependencies: 2017NHKpin_config FEP R1307 PID ikarashiMDC omni_wheel
Fork of NHK2017_octopus2 by
Diff: bot/bot.cpp
- Branch:
- develop1
- Revision:
- 19:34da005ea4ea
- Parent:
- 17:79fa65706f92
- Child:
- 23:797d25f3df5e
- Child:
- 24:593910fa1397
--- a/bot/bot.cpp Thu Sep 28 17:32:01 2017 +0900 +++ b/bot/bot.cpp Thu Sep 28 20:37:09 2017 +0900 @@ -131,8 +131,8 @@ PIDC::confirm(); quadOmni.moveXY( - pad.getStick(0), -pad.getStick(1), + -pad.getStick(0), -PIDC::calculationResult ); } @@ -149,9 +149,7 @@ } if(pad.getButton1(6)) armMotor[SWORD].setSpeed(0.0); - if(!pad.getButton1(3)) slider.slide(1.0); - if(!pad.getButton1(4)) slider.slide(-1.0); - if(pad.getButton1(3) && pad.getButton1(4)) slider.slide(0.0); + slider.slide(pad.getStick(3)); if(!pad.getButton2(1)) { armMotor[DESTROY].setSpeed(-1.0); @@ -173,9 +171,17 @@ !pad.getButton2(0) && !pad.getButton2(1) ) { + t.start(); + t.reset(); PIDC::calibration(HMC6352_ENTER_CALIB); - quadOmni.moveXY(0, 0, 0.4); - wait(5.0); + while(t.read() < 5.0) { + quadOmni.moveXY(0, 0, 0.4); + slider.slide(0); + for(int i = 0; i < 3; i++) { + armMotor[i].setSpeed(0); + } + } + t.stop(); quadOmni.moveXY(0, 0, 0); PIDC::calibration(HMC6352_EXIT_CALIB); }