[2.13.2]fix bug of aicloud fusion problem and add limit of visual long sight

This commit is contained in:
zhongchao
2023-01-11 13:55:01 +08:00
parent c57e9d86e8
commit 79ff37d90d
18 changed files with 162 additions and 37 deletions

View File

@@ -632,6 +632,15 @@ class DebugSettingView @JvmOverloads constructor(
}
}
tbDrawAiCloudFusion.isChecked = FunctionBuildConfig.isDrawAiCloudFusion
//云端感知绘制
tbDrawAiCloudFusion.setOnCheckedChangeListener { _, isChecked ->
FunctionBuildConfig.isDrawAiCloudFusion = isChecked
if (!FunctionBuildConfig.isDrawAiCloudFusion) {
tbDrawAiCloudFusion.isChecked = false
}
}
//重启工控机所有节点
btnIpcReboot.onClick {
CallerAutoPilotManager.sendIpcReboot()

View File

@@ -5,6 +5,7 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.map.MogoMapUIController
import com.mogo.map.uicontroller.VisualAngleMode
@@ -34,12 +35,14 @@ class PerspectiveSwitchView @JvmOverloads constructor(
// .visibleAllMarkers()
MogoMapUIController.getInstance()
.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
CallerMapUIServiceManager.getMapUIController()?.setLockMode(true)
textSwitch.setText(R.string.module_map_model_normal)
} else if (MogoMapUIController.getInstance().currentMapVisualAngle.isMediumSight) {
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS)
MogoMapUIController.getInstance()
.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
CallerMapUIServiceManager.getMapUIController()?.setLockMode(false)
textSwitch.setText(R.string.module_map_model_faster)
} else {
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())

View File

@@ -254,6 +254,18 @@
android:textOn="关闭车端V2N预警"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbDrawAiCloudFusion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启云端感知绘制"
android:textOn="关闭云端感知绘制"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbMojie"
android:layout_width="match_parent"

View File

@@ -1,17 +1,19 @@
package com.mogo.eagle.core.function.business.ai
import android.content.Context
import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener
import com.mogo.cloud.socket.SocketManager
import com.mogo.cloud.socket.entity.SocketDownData.SocketDownDataProto
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.business.ai.net.AiCloudIdentifyNetWorkModel
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.mogo.map.listener.IMogoMapListener
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.module.common.MogoApisHandler
import com.mogo.realtime.constant.RealTimeConstant
import mogo.yycp.api.proto.SocketDownData
class AiCloudIdentifyDataManager : IMogoMapListener {
@@ -32,16 +34,20 @@ class AiCloudIdentifyDataManager : IMogoMapListener {
fun init(mContext: Context) {
MogoApisHandler.getInstance().apis.registerCenterApi.registerMogoMapListener(TAG, this)
SocketManager.getInstance()
MogoAiCloudSocketManager.getInstance(mContext)
.registerOnMessageListener(
RealTimeConstant.LOW_FREQUENCY_CHANNEL_ID,
object : IMogoCloudSocketOnMessageListener<SocketDownDataProto> {
override fun target(msgType: Int): Class<SocketDownDataProto> {
return SocketDownDataProto::class.java
0x040003, //低频数据
object : IMogoOnMessageListener<SocketDownData.SocketDownDataProto> {
override fun target(): Class<SocketDownData.SocketDownDataProto> {
return SocketDownData.SocketDownDataProto::class.java
}
override fun onMsgReceived(msgType: Int, obj: SocketDownDataProto?) {
override fun onMsgReceived(obj: SocketDownData.SocketDownDataProto?) {
CallerLogger.d("$M_MAP$TAG", "SocketDownDataProto obj : $obj")
if(!FunctionBuildConfig.isDrawAiCloudFusion){
MapIdentifySubscriber.instance.clearAiCloudRoma()
return
}
obj?.let {
obj.data?.let {
if (showAiCloud) {
@@ -74,9 +80,14 @@ class AiCloudIdentifyDataManager : IMogoMapListener {
override fun onMapVisualAngleChanged(visualAngleMode: VisualAngleMode) {
super.onMapVisualAngleChanged(visualAngleMode)
showAiCloud = when {
visualAngleMode.isLongSight -> true
else -> false
when {
visualAngleMode.isLongSight -> {
showAiCloud = true
}
else -> {
showAiCloud = false
CallerMapIdentifyManager.clearAiCloudRoma()
}
}
}

View File

@@ -1,9 +1,9 @@
package com.mogo.eagle.core.function.business.identify
import com.mogo.cloud.socket.entity.SocketDownData
import com.mogo.eagle.core.data.traffic.TrafficData
import mogo.telematics.pad.MessagePad
import mogo.telematics.pad.MessagePad.TrackedObject
import mogo.yycp.api.proto.SocketDownData
interface Identify {

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.business.identify
import android.annotation.SuppressLint
import androidx.collection.ArraySet
import com.mogo.cloud.socket.entity.SocketDownData
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.data.traffic.TrafficData
@@ -10,6 +9,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
import com.mogo.map.MogoMarkerManager
import mogo.telematics.pad.MessagePad.PlanningObject
import mogo.telematics.pad.MessagePad.TrackedObject
import mogo.yycp.api.proto.SocketDownData
import java.util.concurrent.ConcurrentHashMap
class IdentifyAiCloudDataDrawer : Identify {
@@ -62,7 +62,7 @@ class IdentifyAiCloudDataDrawer : Identify {
it.remove()
mMarkersCaches.remove(key)
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
.removeMarker(key)
.removeMarker(key.hashCode().toString())
}
val filterList = filterTrafficData(resultList)
@@ -86,15 +86,19 @@ class IdentifyAiCloudDataDrawer : Identify {
val uuid = "" + data.uuid
mMarkersCaches[uuid] = data
trafficDataUuidList.add(uuid)
mFilterTrafficData[uuid] = data
}
return mFilterTrafficData
}
@SuppressLint("NewApi")
override fun clearAiMarker() {
if(trafficDataUuidList.size == 0){
return
}
for (uuid in trafficDataUuidList) {
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
.removeMarker(uuid)
.removeMarker(uuid.hashCode().toString())
}
trafficDataUuidList.clear()
}

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.business.identify
import android.os.Handler
import android.os.Message
import com.mogo.cloud.socket.entity.SocketDownData
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
@@ -10,6 +9,7 @@ import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
import mogo.telematics.pad.MessagePad
import mogo.telematics.pad.MessagePad.TrackedObject
import mogo.yycp.api.proto.SocketDownData
object IdentifyFactory : Identify, IMoGoObuStatusListener {

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.business.identify
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.cloud.socket.entity.SocketDownData
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_IDENTIFY
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
@@ -13,6 +12,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListen
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import mogo.telematics.pad.MessagePad
import mogo.telematics.pad.MessagePad.TrackedObject
import mogo.yycp.api.proto.SocketDownData
/**
* 订阅感知数据的订阅者

View File

@@ -451,15 +451,6 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
}
}
@SuppressLint("NewApi")
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_CLOUD_V2N,
linkCode = CHAIN_LINK_CLOUD,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_CLOUD_V2N,
paramIndexes = [0],
clientPkFileName = "sn"
)
override fun onAutopilotIdentifyPlanningObj(planningObjects: List<MessagePad.PlanningObject>?) {
super.onAutopilotIdentifyPlanningObj(planningObjects)
if(!FunctionBuildConfig.isV2NFromCar){