Merge branch 'dev_robotaxi-d_240705_6.5.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_240705_6.5.0
This commit is contained in:
@@ -497,19 +497,19 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
}
|
||||
|
||||
private fun computeCrossCountBetween(start: Triple<Double, Double, Double>, end: kotlin.Pair<Double, Double>): Int {
|
||||
val points = V2NUtils.generateIntermediatePoints(kotlin.Pair(start.first, start.second), end, 50.0 * 1e-7)
|
||||
V2XBizTrace.onAck(points, "computeCrossCountBetween", true)
|
||||
var crossId = MapDataWrapper.getCrossRoad(start.first, start.second, start.third)?.cross_id
|
||||
val angle = start.third
|
||||
var count = 1
|
||||
for (p in points) {
|
||||
val crossRoad = MapDataWrapper.getCrossRoad(p.first, p.second, angle)
|
||||
if (crossRoad != null && !TextUtils.isEmpty(crossRoad.cross_id) && !TextUtils.equals(crossId, crossRoad.cross_id)) {
|
||||
count++
|
||||
crossId = crossRoad.cross_id
|
||||
}
|
||||
}
|
||||
return count
|
||||
// val points = V2NUtils.generateIntermediatePoints(kotlin.Pair(start.first, start.second), end, 50.0 * 1e-7)
|
||||
// V2XBizTrace.onAck(points, "computeCrossCountBetween", true)
|
||||
// var crossId = MapDataWrapper.getCrossRoad(start.first, start.second, start.third)?.cross_id
|
||||
// val angle = start.third
|
||||
// var count = 0
|
||||
// for (p in points) {
|
||||
// val crossRoad = MapDataWrapper.getCrossRoad(p.first, p.second, angle)
|
||||
// if (crossRoad != null && !TextUtils.isEmpty(crossRoad.cross_id) && !TextUtils.equals(crossId, crossRoad.cross_id)) {
|
||||
// count++
|
||||
// crossId = crossRoad.cross_id
|
||||
// }
|
||||
// }
|
||||
return 1
|
||||
}
|
||||
|
||||
private fun getAlertContent(poiType: String, distance: Double): String {
|
||||
|
||||
@@ -115,7 +115,7 @@ class AiRoadMarker {
|
||||
.longitude(marker.poi_lon)
|
||||
.latitude(marker.poi_lat)
|
||||
if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType) {
|
||||
builder.anchorColor("#D6E1BA9A")
|
||||
builder.anchorColor("#FFE1BA9A")
|
||||
}
|
||||
CallerMapUIServiceManager.getOverlayManager()?.showOrUpdatePoint(builder.build())?.let { p ->
|
||||
if (!markerIds.contains(markerId)) {
|
||||
|
||||
@@ -6,6 +6,8 @@ import androidx.lifecycle.lifecycleScope
|
||||
import com.google.protobuf.TextFormat
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLine
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
@@ -16,6 +18,7 @@ import com.mogo.eagle.core.data.v2x.V2XEvent.RoadEventX
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setDemoMode
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIgnoreConditionDraw
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
|
||||
@@ -66,7 +69,7 @@ class TeleMsgHandler : IMsgHandler {
|
||||
private var listener: EventListener? = null
|
||||
|
||||
override fun handleMsgFromServer(msg: MogoProtocolMsg?, channel: Channel?) {
|
||||
msg?.let {
|
||||
msg?.let { it ->
|
||||
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_DATA_TO_PASSENGER) {
|
||||
try {
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的V2N事件 --- 1 ---")
|
||||
@@ -84,6 +87,9 @@ class TeleMsgHandler : IMsgHandler {
|
||||
|
||||
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_PEOPLE_CROSS) {
|
||||
runCatching {
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx ->
|
||||
itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "")
|
||||
})
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的行人/非机动车横穿事件 --- 1 ---")
|
||||
CallerV2nNioEventListenerManager.invokeV2nNioCrossoverEvent(MessagePad.Event.parseFrom(msg.body))
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的行人/非机动车横穿事件 --- 2 ---")
|
||||
@@ -93,6 +99,9 @@ class TeleMsgHandler : IMsgHandler {
|
||||
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_GREEN_WAVE) {
|
||||
runCatching {
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的绿波通行 --- 1 ---")
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx ->
|
||||
itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "")
|
||||
})
|
||||
CallerV2nNioEventListenerManager.invokeV2nNioGreenWavePassageEvent(MessagePad.V2nCrossSpeed.parseFrom(msg.body))
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的绿波通行 --- 2 ---")
|
||||
}
|
||||
@@ -101,6 +110,9 @@ class TeleMsgHandler : IMsgHandler {
|
||||
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_OTHER_RETROGRADE_VEHICLE) {
|
||||
runCatching {
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的他车逆行 --- 1 ---")
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx ->
|
||||
itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "")
|
||||
})
|
||||
CallerV2nNioEventListenerManager.invokeV2nNioOtherRetrogradeEvent(MessagePad.Event.parseFrom(msg.body))
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的他车逆行 --- 2 ---")
|
||||
}
|
||||
@@ -108,6 +120,9 @@ class TeleMsgHandler : IMsgHandler {
|
||||
}
|
||||
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_SHI_GONG) {
|
||||
runCatching {
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx ->
|
||||
itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "")
|
||||
})
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路施工 --- 1 ---")
|
||||
CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate(Collections.singletonList(TrackedObject.parseFrom(msg.body)))
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路施工 --- 2 ---")
|
||||
@@ -116,6 +131,9 @@ class TeleMsgHandler : IMsgHandler {
|
||||
}
|
||||
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_SHI_GU) {
|
||||
runCatching {
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx ->
|
||||
itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "")
|
||||
})
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路事故 --- 1 ---")
|
||||
CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate(Collections.singletonList(TrackedObject.parseFrom(msg.body)))
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路事故 --- 2 ---")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_16" />
|
||||
<corners android:radius="@dimen/dp_20" />
|
||||
<solid android:color="#43D1A6" />
|
||||
</shape>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_16" />
|
||||
<corners android:radius="@dimen/dp_20" />
|
||||
<gradient
|
||||
android:startColor="#68E0BB"
|
||||
android:endColor="#b072ECC3"/>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
android:layout_marginBottom="-5dp"
|
||||
android:textColor="#43D1AB"
|
||||
android:textSize="@dimen/sp_34"
|
||||
android:fontFamily="@font/font_din"
|
||||
tools:text="56" />
|
||||
|
||||
<TextView
|
||||
@@ -62,6 +63,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textStyle="bold"
|
||||
tools:text="建议车速45-60km/h" />
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
android:textSize="@dimen/dp_49"
|
||||
android:textColor="#0F664B"
|
||||
android:layout_marginBottom="-5dp"
|
||||
android:fontFamily="@font/font_din"
|
||||
tools:text="56"/>
|
||||
|
||||
<TextView
|
||||
@@ -61,6 +62,7 @@
|
||||
android:textSize="@dimen/dp_33"
|
||||
android:textColor="#004A35"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:textStyle="bold"
|
||||
tools:text="建议车速45-60km/h" />
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.map.MapDataWrapper
|
||||
import com.zhidaoauto.map.data.road.StopLine
|
||||
import com.zhidaoauto.map.sdk.open.common.tools.MapTools
|
||||
import kotlinx.coroutines.*
|
||||
@@ -34,25 +35,27 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
|
||||
private val listeners by lazy { ConcurrentHashMap<String, ArrayList<OnMoGoVisualAngleSceneChangeListener>>() }
|
||||
|
||||
private val triggerLocation = AtomicReference<MogoLocation>()
|
||||
|
||||
private val distanceOfCarToStopLine = AtomicReference(0.0)
|
||||
|
||||
private val travelled by lazy { AtomicReference(0.0) }
|
||||
|
||||
private val prevScene by lazy { AtomicReference<Scene>() }
|
||||
|
||||
private val listener = object : IMoGoMapRoadListener {
|
||||
private val roadId = AtomicReference<String>()
|
||||
private val triggerRoadId = AtomicReference<String>()
|
||||
@Volatile
|
||||
private var inCrossRoad = false
|
||||
@Volatile
|
||||
private var hasCrossRoad = false
|
||||
private val distanceOfCarToStopLine = AtomicReference(0.0)
|
||||
private val triggerLocation = AtomicReference<MogoLocation>()
|
||||
private val travelled by lazy { AtomicReference(0.0) }
|
||||
|
||||
override fun onRoadIdInfo(roadId: String) {
|
||||
this.roadId.set(roadId)
|
||||
Log.d(TAG, "-- onRoadIdInfo --: prev: ${this.triggerRoadId.get()} -> curr: $roadId")
|
||||
val loc = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
var triggerClose = false
|
||||
val distance = distanceOfCarToStopLine.get() + 5
|
||||
var distance = distanceOfCarToStopLine.get()
|
||||
if (hasCrossRoad && distance > 0) {
|
||||
distance += 3.0
|
||||
val prev = triggerLocation.get()
|
||||
if (prev != null) {
|
||||
travelled.set(MapTools.distance(loc.longitude, loc.latitude, prev.longitude, prev.latitude) + travelled.get())
|
||||
@@ -60,19 +63,34 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
}
|
||||
val oldRoadId = triggerRoadId.get()
|
||||
Log.d(TAG, "-- onRoadIdInfo --: travelled --: ${travelled.get()}")
|
||||
if ((travelled.get() > distance) && oldRoadId != roadId) {
|
||||
distanceOfCarToStopLine.set(0.0)
|
||||
hasCrossRoad = false
|
||||
triggerRoadId.set(null)
|
||||
travelled.set(0.0)
|
||||
triggerLocation.set(null)
|
||||
Log.d(TAG, "-- onRoadIdInfo --: trigger close --")
|
||||
triggerClose = true
|
||||
if ((travelled.get() > distance)) {
|
||||
val cross = MapDataWrapper.getCrossRoad(loc.longitude, loc.latitude, loc.heading)
|
||||
Log.d(TAG, "-- onRoadIdInfo --: cross --: ${cross?.status}")
|
||||
if (cross?.status == 1) {
|
||||
if (!inCrossRoad) {
|
||||
inCrossRoad = true
|
||||
}
|
||||
} else {
|
||||
if (inCrossRoad) {
|
||||
triggerClose = true
|
||||
}
|
||||
if (!triggerClose && roadId != "0" && oldRoadId != null && oldRoadId != roadId) {
|
||||
triggerClose = true
|
||||
}
|
||||
}
|
||||
|
||||
if (triggerClose) {
|
||||
Log.d(TAG, "-- onRoadIdInfo --: trigger close --")
|
||||
distanceOfCarToStopLine.set(0.0)
|
||||
hasCrossRoad = false
|
||||
triggerRoadId.set(null)
|
||||
travelled.set(0.0)
|
||||
triggerLocation.set(null)
|
||||
inCrossRoad = false
|
||||
changeScene(Default())
|
||||
}
|
||||
}
|
||||
}
|
||||
if (triggerClose) {
|
||||
changeScene(Default())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,11 +98,16 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
Log.d(TAG, "-- onStopLineInfo --: ${info.distance}")
|
||||
if (!hasCrossRoad && info.distance <= 80.0) {
|
||||
hasCrossRoad = true
|
||||
triggerRoadId.set(this.roadId.get())
|
||||
distanceOfCarToStopLine.set(info.distance)
|
||||
triggerLocation.set(CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02())
|
||||
changeScene(CrossRoad(2))
|
||||
}
|
||||
if (hasCrossRoad && triggerRoadId.get() == null && info.distance <= 20) {
|
||||
val roadId = this.roadId.get()
|
||||
if (roadId != null && roadId != "0") {
|
||||
triggerRoadId.set(this.roadId.get())
|
||||
distanceOfCarToStopLine.set(info.distance)
|
||||
triggerLocation.set(CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,9 +133,6 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
CallerMapRoadListenerManager.addListener(TAG, listener)
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var hasCrossRoad = false
|
||||
|
||||
private var scope: CoroutineScope = acquireScope()
|
||||
|
||||
private fun acquireScope(): CoroutineScope {
|
||||
|
||||
@@ -367,6 +367,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
|
||||
private fun advanceRequest() {
|
||||
isRoadTrackReq = true
|
||||
Log.d(TAG, "请求获取智慧导致轨迹!")
|
||||
// 获取智慧道路轨迹
|
||||
travelNetWorkModel.getCityRoadTrack(onSuccess = {
|
||||
Log.d(TAG, "Road track result is:$it")
|
||||
@@ -661,6 +662,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun reqCrossLive(ipList: MutableList<String>) {
|
||||
Log.d(TAG, "请求获取缩略图!")
|
||||
ndeRoadCameraNetWorkModel.batchRequestCrossLive(ipList, onSuccess = {
|
||||
val liveOptionsList = ArrayList<MarkerOptions>()
|
||||
var markerOption: MarkerOptions
|
||||
@@ -1076,6 +1078,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
reqData = pointList
|
||||
handleGlobalPath(pointList)
|
||||
|
||||
Log.d(TAG, "请求获取路口设备!")
|
||||
// 获取路口设备
|
||||
travelNetWorkModel.getCrossDevice(onSuccess = {
|
||||
Log.d(TAG, "Cross device result is:$it")
|
||||
@@ -1084,6 +1087,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}, onError = {
|
||||
Log.d(TAG, "Cross device error is:$it")
|
||||
})
|
||||
Log.d(TAG, "请求获取道路事件!")
|
||||
// 获取道路事件
|
||||
val cityCode = CallerMapUIServiceManager.getCityCode() ?: "0734"
|
||||
travelNetWorkModel.getEventsWithTrajRequest(
|
||||
|
||||
Reference in New Issue
Block a user