#ifndef __TASK_H #define __TASK_H #include "zf_common_typedef.h" #include "PID_Controller.h" void task_init(void); //建议不直接修改此变量,而是通过set_yaw_ref(float set_value)设置,以防预期之外的值 extern volatile float yaw_ref; void set_yaw_ref(float set_value); //供外部控制使用 extern volatile uint8_t motor_control_task_enable; extern volatile uint8_t angle_control_task_enable; extern volatile uint8_t position_control_task_enable; extern volatile PIDInstance pid_speed_right; extern volatile PIDInstance pid_speed_left; extern volatile PIDInstance pid_yaw; extern volatile PIDInstance pid_position; /*速度环的输入,开启角度环后由角度环接管(范围-50到+50)*/ extern volatile int16_t motor_speed_right_ref; extern volatile int16_t motor_speed_left_ref; /*角度环接管速度之后的基础直行速度*/ extern volatile int16_t motor_speed_base; /*角度环参考值*/ extern volatile float yaw_ref; /*角度速率控制,开启位置环后由位置环接管*/ extern volatile float angle_velocity; //配置项 /*自动模式下的基础直行速度*/ #define AUTO_MODE_BASE_SPEED 10 #endif