|
|
|
@ -215,6 +215,21 @@ void Auto() |
|
|
|
} |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
//水平
|
|
|
|
if ((AM_Pa.ExpectationAngle >= 45 && AM_Pa.ExpectationAngle <= 135)) |
|
|
|
{ |
|
|
|
AM_Pa.ExpectationAngle = 90 - GV.Right_Compensation; |
|
|
|
} |
|
|
|
else if ((AM_Pa.ExpectationAngle >= -135 && AM_Pa.ExpectationAngle <= -45)) |
|
|
|
{ |
|
|
|
AM_Pa.ExpectationAngle = -90 + GV.Left_Compensation; |
|
|
|
} |
|
|
|
|
|
|
|
//垂直
|
|
|
|
else if ((AM_Pa.ExpectationAngle > -45 && AM_Pa.ExpectationAngle < 45)) |
|
|
|
{ |
|
|
|
AM_Pa.ExpectationAngle = 0; |
|
|
|
} |
|
|
|
VehicleAutoForward(angle, |
|
|
|
GV.PV.Robot_LeftCompensation, GV.PV.Robot_RightCompensation);//自动前进
|
|
|
|
break; |
|
|
|
@ -247,6 +262,21 @@ void Auto() |
|
|
|
} |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
//水平
|
|
|
|
if ((AM_Pa.ExpectationAngle >= 45 && AM_Pa.ExpectationAngle <= 135)) |
|
|
|
{ |
|
|
|
AM_Pa.ExpectationAngle = 90 + GV.Left_Compensation; |
|
|
|
} |
|
|
|
if ((AM_Pa.ExpectationAngle >= -135 && AM_Pa.ExpectationAngle <= -45)) |
|
|
|
{ |
|
|
|
AM_Pa.ExpectationAngle = - 90 - GV.Right_Compensation; |
|
|
|
} |
|
|
|
|
|
|
|
//垂直
|
|
|
|
if ((AM_Pa.ExpectationAngle > -45 && AM_Pa.ExpectationAngle < 45)) |
|
|
|
{ |
|
|
|
AM_Pa.ExpectationAngle = 0; |
|
|
|
} |
|
|
|
VehicleAutoBackward(angle, |
|
|
|
GV.PV.Robot_LeftCompensation, GV.PV.Robot_RightCompensation);//自动后退
|
|
|
|
break; |
|
|
|
|