feat: 避障功能实现
This commit is contained in:
@@ -29,7 +29,7 @@ void aim_distance_select(void)
|
||||
} else if (circle_type != CIRCLE_NONE) {
|
||||
aim_distance = cross_aim;
|
||||
} else if (barrier_type != BARRIER_NONE) {
|
||||
aim_distance = 0.3f;
|
||||
aim_distance = barrier_aim;
|
||||
} else {
|
||||
aim_distance = common_aim;
|
||||
}
|
||||
@@ -138,10 +138,10 @@ void MidLineTrack()
|
||||
// float error = -atan2f(dx, dy) * 180 / PI32;
|
||||
|
||||
if (barrier_type == BARRIER_LEFT_BEGIN) {
|
||||
dx_near = rptsn[aim_idx_near][1] - cx;
|
||||
dx_near = rptsn[aim_idx_near][1] - cx +barrier_offset;
|
||||
pure_angle = -atanf(PIXPERMETER * 2.0f * 0.2f * dx / dn / dn) / PI32 * 180.0f;
|
||||
} else if (barrier_type == BARRIER_RIGHT_BEGIN) {
|
||||
dx_near = rptsn[aim_idx_near][1] - cx;
|
||||
dx_near = rptsn[aim_idx_near][1] - cx - barrier_offset;
|
||||
pure_angle = -atanf(PIXPERMETER * 2.0f * 0.2f * dx / dn / dn) / PI32 * 180.0f;
|
||||
} else {
|
||||
dx_near = rptsn[aim_idx_near][1] - cx;
|
||||
|
||||
Reference in New Issue
Block a user