方向盘转向忘记加"-"符号,左正右负
This commit is contained in:
@@ -230,14 +230,14 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
*/
|
||||
private void animationWithSteeringData(float steering) {
|
||||
Log.d(TAG, "方向盘转动" + String.valueOf(steering));
|
||||
rotateAnimation = new RotateAnimation(fromDegrees, steering,
|
||||
rotateAnimation = new RotateAnimation(fromDegrees, -steering,
|
||||
RotateAnimation.RELATIVE_TO_SELF, 0.5f,
|
||||
RotateAnimation.RELATIVE_TO_SELF, 0.5f);
|
||||
rotateAnimation.setDuration(1000);//旋转时长
|
||||
rotateAnimation.setFillAfter(true);//旋转后保持原状
|
||||
autopilotIV.clearAnimation();
|
||||
autopilotIV.startAnimation(rotateAnimation);
|
||||
fromDegrees = steering;
|
||||
fromDegrees = -steering;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user