From 8a5c3f0ea2572fd21f7c758ef3ea0d41502439a7 Mon Sep 17 00:00:00 2001 From: liujing Date: Sat, 2 Apr 2022 14:50:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E7=A9=BA=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/notice/NoticeTrafficDialog.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeTrafficDialog.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeTrafficDialog.java index d381f12080..fb1058fcbc 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeTrafficDialog.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeTrafficDialog.java @@ -169,17 +169,19 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs * 开启自动驾驶 */ private void startAutoPilot() { - AutopilotControlParameters parameters = new AutopilotControlParameters(); - parameters.isSpeakVoice = false; - parameters.vehicleType = 10; - //云平台使用的是火星坐标,自动驾驶需要wgs84 - double[] gcj02 = CoordinateUtils.transformGcj02toWgs84(mTrafficStyleInfo.getLat(), mTrafficStyleInfo.getLon()); - parameters.startLatLon = new AutopilotControlParameters.AutoPilotLonLat - (CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat(), - CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon()); - parameters.endLatLon = new AutopilotControlParameters.AutoPilotLonLat - (gcj02[0], gcj02[1]); - CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters); + if (mTrafficStyleInfo != null){ + AutopilotControlParameters parameters = new AutopilotControlParameters(); + parameters.isSpeakVoice = false; + parameters.vehicleType = 10; + //云平台使用的是火星坐标,自动驾驶需要wgs84 + double[] gcj02 = CoordinateUtils.transformGcj02toWgs84(mTrafficStyleInfo.getLat(), mTrafficStyleInfo.getLon()); + parameters.startLatLon = new AutopilotControlParameters.AutoPilotLonLat + (CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat(), + CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon()); + parameters.endLatLon = new AutopilotControlParameters.AutoPilotLonLat + (gcj02[0], gcj02[1]); + CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters); + } } /**