This commit is contained in:
Glz
2024-08-14 20:22:55 +08:00
parent 2db1937c89
commit dccfedc74c
3 changed files with 13 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ int8_t turn_flag = 0;
int circle_flag = 1;
int pingbi_num = 0;
int last_garage_type = GARAGE_NONE;
float turn_threshold = 12.0f;
// 计算最小二乘法斜率的函数
float leastSquaresSlope(float points[][2], int n)
{
@@ -369,6 +370,16 @@ void MidLineTrack()
{
aim_distance = cross_aim;
}
if (curvature >= turn_threshold)
{
aim_distance = turn_aim;
}
if (curvature <= turn_threshold)
{
aim_distance = mid_aim;
}