mirror of
https://gitee.com/yyz_o/bk_bishe_pi.git
synced 2025-09-07 23:21:26 +00:00
2025.5.16第一次提交,彻底完成eyesim平台完整仿真,就差实机控制了。
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#include<iostream>
|
||||
#include<string>
|
||||
#include<vector>
|
||||
#include<cstddef>
|
||||
#include"eyebot++.h"
|
||||
#include"maze_parameter.h"
|
||||
#include"maze_func.h"
|
||||
@@ -27,21 +26,17 @@ int main()
|
||||
output_arrwall(mazesize_x, mazesize_y, copy_wall); //打印墙壁wall信息
|
||||
|
||||
int map[mazesize_x * mazesize_y] = {}; //创建最短路径求解地图并初始化为0
|
||||
int copy_map[mazesize_x * mazesize_y] = {}; //创建copy复制地图并初始化为0
|
||||
array_negative_one(mazesize_x * mazesize_y, map); //将map数组初始化为-1
|
||||
|
||||
array_negative_one(map); //将map数组初始化为-1
|
||||
array_negative_one(copy_map); //将copy_map数组初始化为-1
|
||||
|
||||
flood(map, copy_map, copy_wall); //洪水填充算法
|
||||
|
||||
flood(map, copy_wall); //洪水填充算法
|
||||
output_arr2D(mazesize_x, mazesize_y, map); //打印map的数组信息
|
||||
|
||||
const int len = map[(target_x * mazesize_y) + target_y]; //迷宫的终点(人为确定)
|
||||
const int len = map[((target_x - 1) * mazesize_y) + (target_y -1)]; //迷宫的终点(人为确定)
|
||||
int path[len] = {}; //创建最短路径结果地图并初始化为0
|
||||
|
||||
build_path(target_x, target_y, len, path, map, copy_wall); //构建出最短路径path数组
|
||||
build_path(target_x - 1, target_y - 1, len, path, map, copy_wall); //构建出最短路径path数组
|
||||
drive_path(len, path); //移动到指定目标点
|
||||
|
||||
output_arrpath(path); //打印path数组信息,及小车每一步的行驶方向
|
||||
output_arrpath(len, path); //打印path数组信息,及小车每一步的行驶方向
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user