更改转向逻辑

This commit is contained in:
lxbpxylps@126.com 2021-03-01 21:15:04 +08:00
parent 8af854fbdf
commit 7268f79074

View File

@ -65,8 +65,10 @@ int8_t route[][3] =
//最大抓取尝试次数 //最大抓取尝试次数
#define MAX_CATCH_TIMES 2 #define MAX_CATCH_TIMES 2
//传感器判断转向完成延时 //从触碰白线到开始转向延时
#define TRUN_CHECK_DELAY 1000 #define BEFORE_TURN_DELAY 775
//从开始转向到转向结束延时
#define AFTER_TURN_DELAY 1130
//修正循迹时单侧减速比率 //修正循迹时单侧减速比率
#define LINE_FIX_SPEED_RATE 0.8 #define LINE_FIX_SPEED_RATE 0.8
@ -643,11 +645,9 @@ void TurnDirection(float speed_rate)
} }
else //继续转向 else //继续转向
{ {
delay(BEFORE_TURN_DELAY);
move.MoveDirection(direction, speed_rate); move.MoveDirection(direction, speed_rate);
delay(AFTER_TURN_DELAY);
//传感器判断转向完成
delay(TRUN_CHECK_DELAY); //延时后判断
while(!(sensor.IsWhite(GRAY_3) && sensor.IsWhite(GRAY_4))) {}
} }
#ifdef TAICHI_DEBUG #ifdef TAICHI_DEBUG