2025.5.15第三次提交,继续修改

This commit is contained in:
氧原子
2025-05-15 22:40:18 +08:00
parent 75f7336601
commit a81594bf68
8 changed files with 63 additions and 55 deletions

View File

@@ -4,13 +4,14 @@
/*---声明数据---*/
/*---声明全局常量---*/
extern const int DIST_cell; //单元格长度
extern const int DIST_wall; //与墙壁的距离
extern const int DIST_wall_F; //与前面墙壁的距离
extern const int DIST_wall_RL; //与左右墙壁的距离
/*---声明全局变量---*/
/*---声明全局容器---*/
extern std::vector<std::vector<int>> mark; //声明mark容器二维容器
extern std::vector<std::vector<std::vector<int>>> wall; //声明wall容器三维容器
extern std::vector<std::vector<int>> mark; //声明mark容器二维容器
extern std::vector<std::vector<std::vector<int>>> wall; //声明wall容器三维容器
/*---声明机器人坐标---*/
extern int rob_x0; //机器人起点X坐标
@@ -26,8 +27,9 @@ extern int rob_dir; //机器人当前的朝向
/*---PID算法---*/
extern const float Kp, Ki, Kd; //声明PID的参数
extern float Kpid; //定义PID计算后输出的倍率
extern float Kpid_speed; //定义计算后的速度
extern const int Kpid_base, speed; //定义基本角速度和速度
extern int Kpid_speed; //定义计算后的速度
extern const float Kpid_base; //定义速度基础倍数速度
extern const int speed; //定义速度基础倍数速度
extern const int speed2; //快到目的地时减速
extern int speed1;
extern int err, err_old, err_sum, err_diff; //定义误差,上一次误差,积分误差,微分误差