• R/O
  • SSH
  • HTTPS

team-ncxx-sl: Commit


Commit MetaInfo

Revision400 (tree)
Time2018-08-24 19:32:58
Authorncxxsuzuki

Log Message

ルックアップゲート バック用追加

Change Summary

Incremental Difference

--- trunk/src/hrp2_beta7/sdk/workspace/sample_cpp2/course/LookupGate.cpp (revision 399)
+++ trunk/src/hrp2_beta7/sdk/workspace/sample_cpp2/course/LookupGate.cpp (revision 400)
@@ -614,7 +614,8 @@
614614 bool LookupGate::SpinLeft() {
615615 int32_t motorAngle = ev3_motor_get_counts(left_motor);
616616 if (targetSpinCount == 0) {
617- targetSpinCount = motorAngle - 360;
617+ targetSpinCount = motorAngle - 200;
618+ targetSpinCountBack = motorAngle - 600;
618619 //targetSpinCount = motorAngle + 390;
619620 ev3_motor_stop(right_motor, true);
620621 }
@@ -623,6 +624,11 @@
623624 ev3_motor_set_power(left_motor, -10);
624625 return false;
625626 } else {
627+ if(targetSpinCountBack < motorAngle){
628+ ev3_motor_set_power(left_motor, -10);
629+ ev3_motor_set_power(right_motor, -10);
630+ return false;
631+ }
626632 ev3_motor_stop(left_motor, true);
627633 targetSpinCount = 0;
628634 return true;
--- trunk/src/hrp2_beta7/sdk/workspace/sample_cpp2/course/LookupGate.h (revision 399)
+++ trunk/src/hrp2_beta7/sdk/workspace/sample_cpp2/course/LookupGate.h (revision 400)
@@ -126,6 +126,7 @@
126126 int forwardMotorAngL = 0;
127127 int UpridhtBodyCount = 0;
128128 int32_t targetSpinCount = 0;
129+ int32_t targetSpinCountBack = 0;
129130 const int COLOR_LIST_COUNT_SEARCHLINE = 3; // ライン探索時のカラー値累積カウント
130131 // カラーセンサー値関連
131132 const int LIGHT_GRAY = 9; // グレー色の光センサ値
Show on old repository browser