Skip to content

Commit

Permalink
fix: エッジ切替の問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
miyashita64 committed Nov 7, 2023
1 parent 1952afa commit 88b0142
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
2 changes: 1 addition & 1 deletion datafiles/BlockDeTreasureLeft.csv
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PR,60,60,clockwise,右回頭
EC,right,エッジ切替
DS,80,250,直進
CS,BLACK,150,黒まで直進、ブロックエリア侵入
DS,50,150,黒線から外れるよう直進
EC,right,エッジ切替
PR,60,60,anticlockwise,左回頭
CL,BLUE,200,-10,0.4,0.22,0.1,青サークルまで移動(2 0 N),
IS,交点内直進,
Expand Down
41 changes: 34 additions & 7 deletions datafiles/BlockDeTreasureRight.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
PR,75,60,anticlockwise,左回頭
DS,1900,300,ブロックエリア内を直進
CS,BLACK,150,黒線まで直進
DS,30,150,黒を乗り越える直進
EC,left,エッジを左に切り替え
AR,40,150,clockwise,右回頭
DL,600,200,0,0.6,0.22,0.1,黒線上をライントレース、ゴールへ
PR,60,60,anticlockwise,左回頭
DS,80,250,直進
CS,BLACK,150,黒まで直進、ブロックエリア侵入
DS,50,150,黒線から外れるよう直進
EC,left,エッジ切替
PR,60,60,clockwise,右回頭
CL,BLUE,200,-10,0.4,0.22,0.1,青サークルまで移動(2 3 N),
BR,(2 3 S),
XR,0,100,回頭補正,
IS,交点内直進,
CC,BLUE,(3 3 S),
BT,ブロック移動,
BR,(3 3 N),
XR,0,100,回頭補正,
IS,交点内直進,
CC,BLUE,(2 3 N),
IS,交点内直進,
CC,RED,(1 3 N),
IS,交点内直進,
CC,RED,(0 3 N),
BT,ブロック移動,
IL,(0 3 W),
XR,0,100,回頭補正,
IS,交点内直進,
CC,RED,(0 2 W),
IS,交点内直進,
CC,YELLOW,(0 1 W),
IS,交点内直進,
CC,YELLOW,(0 0 W),
IL,(0 0 S),
XR,0,100,回頭補正,
IS,交点内直進,
CC,YELLOW,(1 0 S),
PR,75,60.0,clockwise,(1 0 W),
4 changes: 1 addition & 3 deletions module/AreaMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,14 @@ void AreaMaster::run()
// 動作インスタンスのリストを生成する
motionList = MotionParser::createMotions(commandFilePath, targetBrightness, isLeftEdge);

// 動作実行のメッセージログを出す
// エリア動作実行開始のメッセージログを出す
snprintf(buf, BUF_SIZE, "\nRun the commands in '%s'\n", commandFilePath);
logger.logHighlight(buf);

// 各動作を実行する
for(const auto& motion : motionList) {
Measurer::resetCount();
motion->logRunning();
snprintf(buf, BUF_SIZE, "isLeftEdge=%s\n", isLeftEdge);
logger.logHighlight(buf);
motion->run();
}
}
2 changes: 1 addition & 1 deletion module/Motion/LineTracing.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class LineTracing : public Motion {
double targetSpeed; // 目標速度 0~
int targetBrightness; // 目標輝度 0~
PidGain gain; // PIDゲイン
bool isLeftEdge; // エッジの左右判定(true:左エッジ, false:右エッジ)
bool& isLeftEdge; // エッジの左右判定(true:左エッジ, false:右エッジ)
double initLeftMileage; // クラス呼び出し時の左車輪の走行距離
double initRightMileage; // クラス呼び出し時の右車輪の走行距離
double initialDistance; // 実行前の走行距離
Expand Down

0 comments on commit 88b0142

Please sign in to comment.