[3.3.0][M1] 环视转向角弄反了

This commit is contained in:
renwj
2023-07-11 11:56:02 +08:00
parent 9507c211c9
commit fcf0cf02fd

View File

@@ -200,7 +200,7 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
val outerAngle = abs(steering * 1.0 / VEHICLE_STEERING_RATIO)
val radians = Math.toRadians(outerAngle)
val d = (newTargetHeight / tan(radians)).toFloat()
if (steering < 0) {
if (steering > 0) {
// 左打轮
// 将坐标原点平移到圆心
canvas.translate(newTargetX - (d - newTargetWidth), newTargetY + newTargetHeight)
@@ -215,7 +215,7 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
canvas.drawArc(innerRect, -innerAngle.toFloat(), -60f, false, routerPaint)
}
if (steering > 0) {
if (steering < 0) {
//右打轮
// 将坐标原点平移到圆心
canvas.translate(newTargetX + d, newTargetY + newTargetHeight)