From 126905b2571a6557d7509477f2bc8a98852a213f Mon Sep 17 00:00:00 2001 From: donghongyu Date: Sat, 2 Apr 2022 15:17:14 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=8CChange=E3=80=8D=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=8COCH=20=E5=B0=8F=E5=9C=B0=E5=9B=BE=E3=80=8D=E8=BD=A6?= =?UTF-8?q?=E8=BE=86=E8=A7=92=E5=BA=A6=E6=99=83=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../function/v2x/events/V2XEventManager.kt | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt index c804df39ca..795d4e6a15 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt @@ -336,7 +336,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb } private fun refreshCarState(location: MogoLocation) { - fixCarAngle(location) + V2XStatusManager.getInstance().location = location // 只有车速大于 5 的时候进行计算 if (location.speed < 5) return val v2xPolyline = BridgeApi.v2xPolyline()?.mogoPolyline @@ -422,32 +422,6 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb } } - private fun fixCarAngle(location: MogoLocation) { // 记录位置轨迹 - // 记录位置轨迹 - if (historyPath[0] != null) { - historyPath[1] = historyPath[0] - } - historyPath[0] = location - - if (historyPath[1] != null && historyPath[0] != null) { - val carAngle: Double = DrivingDirectionUtils.getCarAngle( - historyPath[1]!!.latitude, - historyPath[1]!!.longitude, - historyPath[0]!!.latitude, - historyPath[0]!!.longitude - ).toDouble() - - //CallerLogger.d("$M_V2X$TAG", - // "\n车辆经纬度:" + Arrays.toString(historyPath) + - // "\n车辆角度:" + carAngle); - // 这里是真实的车辆角度 - location.bearing = carAngle.toFloat() - } else { //CallerLogger.e("$M_V2X$TAG", - // "\n首次获取经纬度,默认车头朝北:" + Arrays.toString(historyPath)); - location.bearing = 0.0f - } - V2XStatusManager.getInstance().location = location - } override fun onTokenGot(token: String?, sn: String?) { if (V2XManager.hasInit()) {