[6.2.6][V2N] V2N功能初始化移除车型限制;道路施工取车道中心线后300数据,将经过的停止线之后的数据过滤掉

This commit is contained in:
renwj
2023-12-28 16:39:28 +08:00
parent 602cc2a343
commit 524c632418
3 changed files with 66 additions and 12 deletions

View File

@@ -8,6 +8,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.biz.IMoGoFuncBizProvider
import com.mogo.eagle.core.function.api.biz.IMoGoNoticeNetCallBack
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager.V2NCarTypeCheck
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.function.biz.dispatch.DispatchAutoPilotManager.Companion.dispatchAutoPilotManager
@@ -43,11 +44,9 @@ class FuncBizProvider : IMoGoFuncBizProvider {
MogoTrafficLightManager.INSTANCE.initServer(context)
}
VipCarManager.INSTANCE.initServer(context)
if(!(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode))){
if (V2NCarTypeCheck.verifyCarType()) {
V2XEventManager.init(context)
}
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
LineUploadManager.getInstance(context)?.init()
}

View File

@@ -36,10 +36,13 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager.V2NCarTypeCheck.Companion.verifyCarType
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoadListener
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -58,8 +61,8 @@ import com.mogo.eagle.function.biz.v2x.v2n.receiver.SceneBroadcastReceiver
import com.mogo.eagle.function.biz.v2x.v2n.scenario.impl.V2XScenarioManager
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
import com.mogo.eagle.function.biz.v2x.v2n.utils.toRoadMarker
import com.zhidaoauto.map.data.road.StopLine
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TraceNodeCore.Companion.update
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.android.asCoroutineDispatcher
@@ -68,15 +71,15 @@ import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad.PlanningObject
import mogo.v2x.MogoV2X
import java.nio.charset.Charset
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.CopyOnWriteArraySet
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicReference
object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
IMoGoAutopilotIdentifyListener, IMoGoCloudListener,
IMoGoV2XListener, IMoGoAutopilotStatusListener {
IMoGoV2XListener, IMoGoAutopilotStatusListener, OnRoadListener {
private const val TAG = "V2XEventManager"
@@ -88,15 +91,56 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
private val hasInit by lazy { AtomicBoolean(false) }
private val firstLocationInCross by lazy { AtomicReference<MogoLocation>() }
@Volatile
private var roadId = ""
@Volatile
private var roadIdWithEnterCross = ""
@Volatile
private var hasCrossRoad = false
fun init(context: Context) {
if (hasInit.compareAndSet(false, true)) {
registerListener()
v2xPoiLoader.startLoopPoi()
// 注册广播接收场景弹窗使用的
SceneBroadcastReceiver.register(context)
CallerMapRoadListenerManager.registerRoadListener(TAG, this)
}
}
override fun onRoadIdInfo(roadId: String) {
super.onRoadIdInfo(roadId)
Log.d(TAG, "--- onRoadIdInfo ---: $roadId")
this.roadId = roadId
val enterCrossRoadId = this.roadIdWithEnterCross
if (hasCrossRoad && roadId.isNotBlank() && enterCrossRoadId.isNotBlank() && enterCrossRoadId != roadId) {
hasCrossRoad = false
if (firstLocationInCross.get() == null) {
Log.d(TAG, "--- onRoadIdInfo --- 1 ---: $roadId")
firstLocationInCross.set(CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84())
}
}
}
override fun onStopLineInfo(info: StopLine) {
super.onStopLineInfo(info)
Log.d(TAG, "--- onStopLineInfo --- 1 ---: ${ info.distance }")
if (!hasCrossRoad && info.distance <= 10) {
Log.d(TAG, "--- onStopLineInfo --- 2 ---: $roadId")
hasCrossRoad = true
roadIdWithEnterCross = this.roadId
firstLocationInCross.set(null)
}
}
fun getFirstLocationInCross(): MogoLocation? {
return firstLocationInCross.get()
}
private fun registerListener() {
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 1, this)
v2xPoiLoader.addCallback(this)
@@ -319,6 +363,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
unRegisterListener()
}
v2xPoiLoader.stopLoopPoi()
CallerMapRoadListenerManager.unRegisterRoadListener(TAG)
}
}

View File

@@ -5,6 +5,7 @@ import android.graphics.Color
import android.os.Handler
import android.os.HandlerThread
import android.os.Looper
import android.util.Log
import android.view.animation.DecelerateInterpolator
import androidx.core.util.Pair
import com.mogo.eagle.core.data.map.MogoLatLng
@@ -14,6 +15,7 @@ import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
import com.mogo.eagle.function.biz.v2x.v2n.V2XEventManager
import com.mogo.eagle.function.biz.v2x.v2n.consts.V2XConst
import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerRemoveManager
import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerWrapper
@@ -37,6 +39,8 @@ class AiRoadMarker {
val aiMakers = ConcurrentHashMap<String, AiRoadMarker>()
private const val TAG = "AiRoadMarker"
private val COLOR_START = Color.parseColor("#002ABAD9")
private val COLOR_END = Color.parseColor("#66FF7A30")
}
private val marker by lazy { AtomicReference<Marker>() }
@@ -45,9 +49,6 @@ class AiRoadMarker {
CallerMapUIServiceManager.getOverlayManager()
}
private val START_COLOR = Color.parseColor("#002ABAD9")
private val END_COLOR = Color.parseColor("#66FF7A30")
private val roadMarker by lazy { V2XAiRoadEventMarker() }
private val line = AtomicReference<Polyline>()
@@ -151,7 +152,16 @@ class AiRoadMarker {
V2XBizTrace.onAck("$TAG -marker-4-l2:", l2)
val points = LinkedList<MogoLatLng>()
if (l2.points.isNotEmpty()) {
points.addAll(l2.points.reversed().map {
points.addAll(l2.points.reversed().filter {
val location = V2XEventManager.getFirstLocationInCross()
Log.d(TAG, "l2: location -> $location")
if (location != null) {
val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(location.longitude, location.latitude, it.longitude, it.latitude, location.heading)
angle <= 90
} else {
true
}
}.map {
MogoLatLng(it.latitude, it.longitude)
})
}
@@ -202,8 +212,8 @@ class AiRoadMarker {
(0..total).forEach { i ->
colors += evaluator.evaluate(
interceptor.getInterpolation(i * 1f / total),
START_COLOR,
END_COLOR
COLOR_START,
COLOR_END
) as Int
}
builder.points(points)