1
This commit is contained in:
34
编写代码/maze_parameter.h
Normal file
34
编写代码/maze_parameter.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
/*---声明数据---*/
|
||||
/*---声明全局常量---*/
|
||||
extern const int DIST_cell; //单元格长度
|
||||
extern const int DIST_wall; //与墙壁的距离
|
||||
extern const int mazesize_x; //迷宫X轴长度
|
||||
extern const int mazesize_y; //迷宫Y轴高度
|
||||
/*---声明全局变量---*/
|
||||
/*---声明数组类---*/
|
||||
extern int mark[6][6]; //迷宫单元格是否访问数组
|
||||
extern int wall[7][7][2]; //迷宫墙壁信息数组
|
||||
extern int map[6][6]; //迷宫地图数组
|
||||
extern int copy_map[6][6]; //迷宫地图复制数组
|
||||
extern int path[6][6];
|
||||
/*---声明机器人坐标---*/
|
||||
extern int rob_x;
|
||||
extern int rob_y;
|
||||
extern int rob_dir;
|
||||
/*---各种全局量声明结束---*/
|
||||
|
||||
/*---递归算法---*/
|
||||
/*---PID算法---*/
|
||||
extern const float Kp, Ki, Kd; //声明PID的参数
|
||||
extern float Kpid; //定义PID计算后输出的倍率
|
||||
extern const int Alpha, SPEED; //定义基本角速度和速度
|
||||
extern const int SPEED2; //快到目的地时减速
|
||||
extern int err, err_old, err_sum, err_diff; //定义误差,上一次误差,积分误差,微分误差
|
||||
extern const int eI_max = 20; //定义积分限幅
|
||||
|
||||
|
||||
|
||||
|
||||
/*---全局各种变量声明完成---*/
|
||||
Reference in New Issue
Block a user