避障bug测试
This commit is contained in:
@@ -270,12 +270,19 @@ void MidLineTrack()
|
||||
float dy = cy - rptsn[aim_idx][0]; // + 0.2f * PIXPERMETER;
|
||||
float dn = (dx * dx + dy * dy);
|
||||
float temp_near = 0;
|
||||
if (barrier_type == BARRIER_LEFT_BEGIN || barrier_type == BARRIER_LEFT_RUNNING) {
|
||||
dx_near = mid_track[aim_idx_near][1] - cx + barrier_offset;
|
||||
pure_angle = -atanf(PIXPERMETER * 2.0f * 0.2f * dx / dn) / PI32 * 180.0f - 25;
|
||||
} else if (barrier_type == BARRIER_RIGHT_BEGIN || barrier_type == BARRIER_RIGHT_RUNNING) {
|
||||
dx_near = mid_track[aim_idx_near][1] - cx - barrier_offset;
|
||||
pure_angle = -atanf(PIXPERMETER * 2.0f * 0.2f * dx / dn) / PI32 * 180.0f + 25;
|
||||
if (barrier_type == BARRIER_LEFT_BEGIN) {
|
||||
//dx_near = mid_track[aim_idx_near][1] - cx + barrier_offset;
|
||||
pure_angle = -25.f;
|
||||
}else if (barrier_type == BARRIER_LEFT_RUNNING)
|
||||
{
|
||||
pure_angle = 25.f;
|
||||
}else if (barrier_type == BARRIER_RIGHT_BEGIN)
|
||||
{
|
||||
pure_angle = 25.f;
|
||||
}
|
||||
else if (barrier_type == BARRIER_RIGHT_RUNNING) {
|
||||
//dx_near = mid_track[aim_idx_near][1] - cx - barrier_offset;
|
||||
pure_angle = -25.f;
|
||||
} else {
|
||||
// pure_angle = -atanf(PIXPERMETER * 2.0f * 0.2f * 0.5f * dx / dn) / PI32 * 180.0f;
|
||||
if (dy > 0) {
|
||||
|
||||
Reference in New Issue
Block a user