|
|
@ -164,7 +164,7 @@ void Off_AutoSpray() |
|
|
|
//若自动喷漆启动,计数AutoSpray_Stop_Count*2ms后再停车
|
|
|
|
if(AutoSpray_Flag == 1) |
|
|
|
{ |
|
|
|
if(AutoSpray_Stop_Count <= 600) |
|
|
|
if(AutoSpray_Stop_Count <= 250) |
|
|
|
{ |
|
|
|
AutoSpray_Flag = 0; |
|
|
|
AutoSpray_Stop_Count = 0; |
|
|
@ -284,23 +284,47 @@ void Dangerous_Test() |
|
|
|
//--气压检测
|
|
|
|
void Dym_Test() |
|
|
|
{ |
|
|
|
//计数,置位标志
|
|
|
|
//前进探边计数
|
|
|
|
if(GV.Robot_Ultrasonic.Dym_Value <= 10250 || GV.Robot_Ultrasonic.Dym_Value >= 11000) |
|
|
|
if(Current_T_F4_Value.Test_On == 1) |
|
|
|
{ |
|
|
|
GV.Robot_Ultrasonic.Dym_Value_Count ++; |
|
|
|
if(GV.Robot_Ultrasonic.Dym_Value_Count >= 3) |
|
|
|
//计数,置位标志
|
|
|
|
//前进探边计数
|
|
|
|
if(GV.Robot_Ultrasonic.Dym_Value <= 10300 || GV.Robot_Ultrasonic.Dym_Value >= 11000) |
|
|
|
{ |
|
|
|
GV.Robot_Ultrasonic.Dym_Value_Count ++; |
|
|
|
if(GV.Robot_Ultrasonic.Dym_Value_Count >= 3) |
|
|
|
{ |
|
|
|
GV.Robot_Ultrasonic.Dym_Value_Count = 3; |
|
|
|
GV.Robot_Ultrasonic.Dym_Value_Flag = 1; |
|
|
|
GF_BSP_GPIO_SetIO(Light, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
GV.Robot_Ultrasonic.Dym_Value_Count = 3; |
|
|
|
Current_T_F4_Value.AutoForWard = 0; |
|
|
|
Current_T_F4_Value.AutoBackWard = 0; |
|
|
|
GV.Robot_Ultrasonic.Dym_Value_Count = 0; |
|
|
|
GF_BSP_GPIO_SetIO(Light, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
GV.Robot_Ultrasonic.Dym_Value_Count = 0; |
|
|
|
GF_BSP_GPIO_SetIO(Light, 1); |
|
|
|
} |
|
|
|
|
|
|
|
//报警后,等自动程序都复位才能继续
|
|
|
|
if(GV.Robot_Ultrasonic.Dym_Value_Count < 3 |
|
|
|
&& Current_T_F4_Value.AutoForWard == 0 |
|
|
|
&& Current_T_F4_Value.AutoBackWard == 0 |
|
|
|
&& Current_T_F4_Value.ChgDown_Ver == 0 |
|
|
|
&& Current_T_F4_Value.ChgUp_Ver == 0 |
|
|
|
&& Current_T_F4_Value.ChgLeft_Hor == 0 |
|
|
|
&& Current_T_F4_Value.ChgRight_Hor == 0) |
|
|
|
{ |
|
|
|
GV.Robot_Ultrasonic.Dym_Value_Flag = 0; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//--探边置位消除
|
|
|
|
void Dangerous_Flag_Delete() |
|
|
|
{ |
|
|
@ -377,7 +401,7 @@ void GF_Dispatch()//2ms调用一次 给车体速度等赋值 |
|
|
|
} |
|
|
|
//--
|
|
|
|
//--气压判断
|
|
|
|
// Dym_Test();
|
|
|
|
Dym_Test(); |
|
|
|
//--
|
|
|
|
//运动部分 Move Region
|
|
|
|
if((Current_T_F4_Value.ChgDown_Ver == 1 || Current_T_F4_Value.ChgUp_Ver == 1 |
|
|
@ -386,7 +410,8 @@ void GF_Dispatch()//2ms调用一次 给车体速度等赋值 |
|
|
|
&& (Current_T_F4_Value.robot_forward_backward_speed >= 0X7A |
|
|
|
&& Current_T_F4_Value.robot_forward_backward_speed <= 0X84) |
|
|
|
&& (Current_T_F4_Value.robot_left_right_turn_speed >= 0X7A |
|
|
|
&& Current_T_F4_Value.robot_left_right_turn_speed <= 0X84)) |
|
|
|
&& Current_T_F4_Value.robot_left_right_turn_speed <= 0X84) |
|
|
|
&& GV.Robot_Ultrasonic.Dym_Value_Flag != 1) |
|
|
|
{ |
|
|
|
if((Current_T_F4_Value.AutoForWard == 1 || Current_T_F4_Value.AutoBackWard == 1) |
|
|
|
&&(Current_T_F4_Value.ChgDown_Ver != 1 && Current_T_F4_Value.ChgUp_Ver != 1 |
|
|
|