• R/O
  • SSH
  • HTTPS

team-ncxx-sl: Commit


Commit MetaInfo

Revision433 (tree)
Zeit2019-09-15 15:53:48
Autorncxx-watanabe

Log Message

(empty log message)

Ändern Zusammenfassung

Diff

--- trunk/src/hrp2_beta7/sdk/workspace/sample_cpp2/course/LookupGate.cpp (revision 432)
+++ trunk/src/hrp2_beta7/sdk/workspace/sample_cpp2/course/LookupGate.cpp (revision 433)
@@ -132,7 +132,7 @@
132132 ++waitCount;
133133 }
134134 }
135- else if (125 < ++waitCount) {
135+ else if (100 < ++waitCount) {
136136 waitCount = 0;
137137 lookupGateState = LookupGateStateAfterSpin;
138138 log("To LookupGateStateAfterSpin\r\n");
@@ -202,7 +202,7 @@
202202 tail_control(throughGateTailAngle);
203203 runMode = run66;
204204 BaseCourse::Run();
205- if (++counter >= 300) {
205+ if (++counter >= 200) {
206206 forwardMotorAngL = 0;
207207 log("LookupGateStateThroughGateForward\r\n");
208208 lookupGateState = LookupGateStateThroughGateForward;
@@ -344,7 +344,7 @@
344344 void LookupGate::throughGateReady4th() {
345345 runMode = run66;
346346 BaseCourse::Run();
347- if (++counter >= 200) {
347+ if (++counter >= 50) {
348348 log("LookupGateStateThroughGateReady5th\r\n");
349349 lookupGateState = LookupGateStateThroughGateReady5th;
350350 counter = 0;
@@ -364,7 +364,7 @@
364364 {
365365 runMode = run66;
366366 BaseCourse::Run();
367- if (++counter >= 200) {
367+ if (++counter >= 50) {
368368 log("LookupGateStateThroughGateReady7th\r\n");
369369 lookupGateState = LookupGateStateThroughGateReady7th;
370370 counter = 0;
@@ -383,7 +383,7 @@
383383 void LookupGate::throughGateReady8th() {
384384 runMode = run66;
385385 BaseCourse::Run();
386- if (++counter >= 400) {
386+ if (++counter >= 200) {
387387 forwardMotorAngL = 0;
388388 log("LookupGateStateThroughGateForward\r\n");
389389 lookupGateState = LookupGateStateThroughGateForward;
@@ -418,7 +418,7 @@
418418 void LookupGate::RunStop() {
419419 runMode = run66;
420420 BaseCourse::Run();
421- if (++counter >= 150) {
421+ if (++counter >= 50) {
422422 log("LookupGateStateUpridhtBody1st\r\n");
423423 lookupGateState = LookupGateStateUpridhtBody1st;
424424 counter = 0;
@@ -437,7 +437,7 @@
437437 void LookupGate::UpridhtBody2nd() {
438438 runMode = run66;
439439 BaseCourse::Run();
440- if (++counter >= 300) {
440+ if (++counter >= 150) {
441441 log("LookupGateStateUpridhtBody3rd\r\n");
442442 lookupGateState = LookupGateStateUpridhtBody3rd;
443443 counter = 0;
@@ -456,7 +456,7 @@
456456 void LookupGate::UpridhtBody4th() {
457457 runMode = run66;
458458 BaseCourse::Run();
459- if (++counter >= 300) {
459+ if (++counter >= 100) {
460460 log("LookupGateStateUpridhtBody5th\r\n");
461461 lookupGateState = LookupGateStateUpridhtBody5th;
462462 counter = 0;
@@ -468,7 +468,7 @@
468468 BaseCourse::Run();
469469 if(tail_control(standTailAngle)) {
470470 UpridhtBodyCount++;
471- if(UpridhtBodyCount != 3){
471+ if(UpridhtBodyCount != 5){
472472 log("LookupGateStateBeforeSpin\r\n");
473473 lookupGateState = LookupGateStateBeforeSpin;
474474 } else {
@@ -505,21 +505,18 @@
505505 if(runMode == normalRun) {
506506 BaseCourse::calcMotorPower();
507507 } else if(runMode == run66) {
508- const int LightWhite = 3;
508+ const int LightWhite = 1;
509509 // const int LightGray = 3;
510510 const int LightBlack = 0;
511- const int targetColor = (LightWhite + LightBlack) / 2;
511+ const int targetColor = LightWhite + LightBlack;
512512 const int defaultPower = 10;
513513 const int additionalPower = 10;
514514 if (forward > 0) {
515515 int colorDiff = targetColor - ev3_color_sensor_get_reflect(color_sensor);
516- if(colorDiff <= 10){
517- pwm_L = defaultPower + ((0 < colorDiff) ? additionalPower : 0);
518- pwm_R = defaultPower + ((colorDiff < 0) ? additionalPower : 0);
519- }else {
520- pwm_R = defaultPower + ((0 < colorDiff) ? additionalPower : 0);
521- pwm_L = defaultPower + ((colorDiff < 0) ? additionalPower : 0);
522- }
516+ pwm_L = defaultPower + ((0 < colorDiff) ? additionalPower : 0);
517+ pwm_R = defaultPower + ((colorDiff < 0) ? additionalPower : 0);
518+ //pwm_R = defaultPower + ((0 < colorDiff) ? additionalPower : 0);
519+ //pwm_L = defaultPower + ((colorDiff < 0) ? additionalPower : 0);
523520 } else if(forward == 0) {
524521 pwm_L = 0;
525522 pwm_R = 0;
@@ -536,13 +533,10 @@
536533 const int additionalPower = 10;
537534 if (forward > 0) {
538535 int colorDiff = targetColor - ev3_color_sensor_get_reflect(color_sensor);
539- if(colorDiff <= 10){
540- pwm_L = defaultPower + ((0 < colorDiff) ? additionalPower : 0);
541- pwm_R = defaultPower + ((colorDiff < 0) ? additionalPower : 0);
542- }else {
543- pwm_R = defaultPower + ((0 < colorDiff) ? additionalPower : 0);
544- pwm_L = defaultPower + ((colorDiff < 0) ? additionalPower : 0);
545- }
536+ pwm_L = defaultPower + ((0 < colorDiff) ? additionalPower : 0);
537+ pwm_R = defaultPower + ((colorDiff < 0) ? additionalPower : 0);
538+ //pwm_R = defaultPower + ((0 < colorDiff) ? additionalPower : 0);
539+ //pwm_L = defaultPower + ((colorDiff < 0) ? additionalPower : 0);
546540 } else if(forward == 0) {
547541 pwm_L = 0;
548542 pwm_R = 0;
@@ -610,7 +604,7 @@
610604 bool LookupGate::SpinRight() {
611605 int32_t motorAngle = ev3_motor_get_counts(right_motor);
612606 if (targetSpinCount == 0) {
613- targetSpinCount = motorAngle + 370;
607+ targetSpinCount = motorAngle + 360;
614608 //targetSpinCount = motorAngle - 330;
615609 ev3_motor_stop(left_motor, true);
616610 }
Show on old repository browser