From 4824b17a6ffea0e964a5b302702c9df53a42be92 Mon Sep 17 00:00:00 2001 From: liujing Date: Fri, 2 Apr 2021 18:17:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E8=BD=A6=E4=B8=8E=E5=81=9C=E6=AD=A2?= =?UTF-8?q?=E7=BA=BF=E9=97=B4=E7=94=BB=E7=BA=BF(=E7=94=BB=E7=BA=BF?= =?UTF-8?q?=E7=B1=BB=E7=BC=BA=E5=B0=91=E8=89=B2=E5=80=BC=E9=80=82=E9=85=8D?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scenario/scene/warning/V2XWarningMarker.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningMarker.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningMarker.java index 90eb63254b..4c9e3078ae 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningMarker.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/warning/V2XWarningMarker.java @@ -1,6 +1,7 @@ package com.mogo.module.v2x.scenario.scene.warning; import android.content.Context; +import android.util.Log; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.map.MogoLatLng; @@ -28,6 +29,7 @@ import java.util.List; * @since: 2021/3/30 */ public class V2XWarningMarker implements IV2XMarker { + private static final String TAG = "V2XWarningMarker"; private V2XWarningEntity mMarkerEntity; private MarkerShowEntity markerShowEntity = new MarkerShowEntity(); private Context mContext = V2XServiceManager.getContext(); @@ -65,13 +67,7 @@ public class V2XWarningMarker implements IV2XMarker { clearPOI(); WorkThreadHandler.getInstance().postDelayed(() -> { //自车位置 - MogoLatLng car = mMarkerEntity.getCarLocation(); - if (car == null) { - double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon(); - double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat(); - car = new MogoLatLng(lat, lon); - car = new MogoLatLng(39.977709,116.417703); - } + MogoLatLng car = V2XServiceManager.getNavi().getCarLocation(); if (car != null) { //根据到停止线的距离和方向角获取经纬度 MogoLatLng @@ -79,6 +75,8 @@ public class V2XWarningMarker implements IV2XMarker { if (mMarkerEntity.getCollisionLat() > 0 && mMarkerEntity.getCollisionLon() > 0) { drawLine(car, stopLineLo); } + } else { + Log.d(TAG, "自车位置没有拿到"); } }, 0); } @@ -105,7 +103,7 @@ public class V2XWarningMarker implements IV2XMarker { fillPoints.add(y); } } catch (Exception e) { - + e.printStackTrace(); } }