diff --git a/bot_code_turn/maze_func_turn.cpp b/bot_code_turn/maze_func_turn.cpp index 449e9dd..2033e6b 100644 --- a/bot_code_turn/maze_func_turn.cpp +++ b/bot_code_turn/maze_func_turn.cpp @@ -16,7 +16,7 @@ void BOTturn(int turn) { MOTORDriveRaw(1,20); MOTORDriveRaw(2,-18); - } while (abs(ENCODERRead(2)) < 250); + } while (abs(ENCODERRead(2)) < 240); MOTORDriveRaw(1,0); MOTORDriveRaw(2,0); } @@ -28,7 +28,7 @@ void BOTturn(int turn) { MOTORDriveRaw(1,-20); MOTORDriveRaw(2,18); - } while (abs(ENCODERRead(2)) < 250); + } while (abs(ENCODERRead(2)) < 240); MOTORDriveRaw(1,0); MOTORDriveRaw(2,0); } @@ -41,7 +41,7 @@ void BOTturn(int turn) MOTORDriveRaw(1,20); MOTORDriveRaw(2,-18); - } while (abs(ENCODERRead(2)) < 580); + } while (abs(ENCODERRead(2)) < 570); MOTORDriveRaw(1,0); MOTORDriveRaw(2,0); } diff --git a/bot_code_turn/maze_main.cpp b/bot_code_turn/maze_main.cpp index b576d56..420e0b3 100644 --- a/bot_code_turn/maze_main.cpp +++ b/bot_code_turn/maze_main.cpp @@ -26,11 +26,14 @@ int main() array_copy_wall(mazesize_x, mazesize_y, copy_wall); //复制一份wall数组,并转换为一维数组,便于后续频繁读取提升性能 cout << "访问数组打印:" << endl; + cout << endl; output_arr2D(mazesize_x, mazesize_y, copy_mark); //打印地图mark信息 cout << "地图打印:" << endl; + cout << endl; output_arrwall(mazesize_x, mazesize_y, copy_wall); //打印墙壁wall信息 cout << "请输入目标点的X,Y坐标值 用空格隔开并回车" << endl; + cout << endl; cin >> target_x >> target_y; cout << endl; @@ -39,6 +42,7 @@ int main() flood(map, copy_wall); //洪水填充算法 cout << "路径打印:" << endl; + cout << endl; output_arr2D(mazesize_x, mazesize_y, map); //打印map的数组信息 const int len = map[((target_x - 1) * mazesize_y) + (target_y -1)]; //迷宫的终点(人为确定) @@ -47,6 +51,7 @@ int main() build_path(target_x - 1, target_y - 1, len, path, map, copy_wall); //构建出最短路径path数组 cout << "移动指令打印:" << endl; + cout << endl; output_arrpath(len, path); //打印path数组信息,及小车每一步的行驶方向 drive_path(len, path); //移动到指定目标点 diff --git a/bot_code_turn/maze_parameter.cpp b/bot_code_turn/maze_parameter.cpp index 919afac..c92efb0 100644 --- a/bot_code_turn/maze_parameter.cpp +++ b/bot_code_turn/maze_parameter.cpp @@ -9,8 +9,10 @@ using namespace std; /*---定义数据---*/ /*---定义全局常量---*/ const int DIST_cell = 240; //单元格长度 -const int DIST_move = 330; //移动的单元格距离 -const int DIST_wall_F = 95; //与墙壁的距离 +const int DIST_move = 320; //移动的单元格距离 +//~ const int DIST_move = 330; //移动的单元格距离 +const int DIST_wall_F = 100; //与墙壁的距离 +//~ const int DIST_wall_F = 95; //与墙壁的距离 //~ const int DIST_wall_RL = 90; //与左右墙壁的距离 1 const int DIST_wall_RL = 87; //与左右墙壁的距离