[8.1.0]
[fea] [Vlm 接入]
This commit is contained in:
@@ -10,10 +10,14 @@ import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.och.bridge.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.bridge.distance.TrajectoryAndDistanceManager
|
||||
import com.mogo.och.bridge.bridge.OchBridgeManager
|
||||
import com.mogo.och.bridge.bridge.OchVlmManager
|
||||
import com.mogo.och.bridge.trajectory.TrajectoryManager
|
||||
import com.mogo.och.common.module.biz.birdge.BridgeService
|
||||
import com.mogo.och.common.module.biz.birdge.BridgeListener
|
||||
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
|
||||
import com.mogo.och.common.module.biz.birdge.data.VlmData
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.EnvManager
|
||||
|
||||
|
||||
/**
|
||||
@@ -29,7 +33,16 @@ class BridgeProvider : BridgeService, CallerBase<BridgeListener>() {
|
||||
|
||||
override fun init(context: Context?) {
|
||||
this.context = context
|
||||
OchBridgeManager.load()
|
||||
|
||||
// 车前引导线+预测数据
|
||||
if(EnvManager.isB2Passenger()||EnvManager.isT1T2Passenger()){
|
||||
OchBridgeManager.load()
|
||||
}
|
||||
|
||||
// if(EnvManager.isT1T2Passenger()){
|
||||
OchVlmManager.load()
|
||||
// }
|
||||
|
||||
TrajectoryManager.load()
|
||||
}
|
||||
|
||||
@@ -92,5 +105,17 @@ class BridgeProvider : BridgeService, CallerBase<BridgeListener>() {
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeVlmDataDispatch(vlmData:VlmData){
|
||||
M_LISTENERS.forEach {
|
||||
it.value.onVlmDataListener(vlmData)
|
||||
}
|
||||
}
|
||||
|
||||
fun inVokeNdeData(title: String, desc: String, sortedList: List<RoadMsg>) {
|
||||
M_LISTENERS.forEach {
|
||||
it.value.onNdeDataListener(title,desc,sortedList)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,13 +3,10 @@ package com.mogo.och.bridge
|
||||
import android.annotation.SuppressLint
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
|
||||
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
|
||||
import com.mogo.och.common.module.biz.birdge.data.VlmData
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loop.LoopInfo
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
object BridgeServiceManager {
|
||||
|
||||
@@ -19,52 +16,12 @@ object BridgeServiceManager {
|
||||
private var bridgeService: BridgeProvider? =
|
||||
ARouter.getInstance().build(OchCommonConst.BIZ_Bridge).navigation() as BridgeProvider
|
||||
|
||||
private var trajectoryTime = 0L
|
||||
private var predictionTime = 0L
|
||||
|
||||
init {
|
||||
BizLoopManager.setLoopFunction(TAG,
|
||||
LoopInfo(2, ::checkTimeout, immediately = false, scheduler = Schedulers.io())
|
||||
)
|
||||
}
|
||||
|
||||
// 是否有车前引导线
|
||||
private var haveTrajectoryInfo: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
bridgeService?.invokeTrajectoryHaveDataListener(newValue)
|
||||
CallerLogger.d(TAG,"haveTrajectoryInfo 发生变化:${newValue}")
|
||||
}
|
||||
trajectoryTime = System.currentTimeMillis()
|
||||
|
||||
}
|
||||
|
||||
// 是否有预测数据
|
||||
private var havePredictionInfo: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
bridgeService?.invokePredictionHavaData(newValue)
|
||||
CallerLogger.d(TAG,"havePredictionInfo 发生变化:${newValue}")
|
||||
}
|
||||
predictionTime = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
fun checkTimeout(){
|
||||
if(System.currentTimeMillis() - trajectoryTime>2_000){
|
||||
haveTrajectoryInfo = false
|
||||
CallerLogger.d(TAG,"超时设置为false:haveTrajectoryInfo ${haveTrajectoryInfo}")
|
||||
}
|
||||
if(System.currentTimeMillis() - predictionTime>2_000){
|
||||
havePredictionInfo = false
|
||||
CallerLogger.d(TAG,"超时设置为false:havePredictionInfo ${havePredictionInfo}")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun invokePlanningListener(haveTrajectoryInfos:Boolean){
|
||||
this.haveTrajectoryInfo = haveTrajectoryInfos
|
||||
bridgeService?.invokeTrajectoryHaveDataListener(haveTrajectoryInfos)
|
||||
}
|
||||
|
||||
fun invokePredictionHaveData(havePredictionInfos:Boolean){
|
||||
this.havePredictionInfo = havePredictionInfos
|
||||
bridgeService?.invokePredictionHavaData(havePredictionInfos)
|
||||
}
|
||||
|
||||
fun invokeTrajectoryPoints(trajectoryList: MutableList<MogoLocation>){
|
||||
@@ -78,4 +35,15 @@ object BridgeServiceManager {
|
||||
this.bridgeService?.invokeTrajectoryPointAndDistance(trajectoryList, distance)
|
||||
}
|
||||
|
||||
/**
|
||||
* 分发vmData
|
||||
*/
|
||||
fun invokeVlmData(vlmData: VlmData){
|
||||
this.bridgeService?.invokeVlmDataDispatch(vlmData)
|
||||
}
|
||||
|
||||
fun invokeNdeData(title: String, desc: String, sortedList: List<RoadMsg>) {
|
||||
this.bridgeService?.inVokeNdeData(title,desc,sortedList)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.mogo.och.bridge.bridge
|
||||
|
||||
data class VlmImageData(val imageSourceTimestamp: Double ,var image: ByteArray?) {
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
other as VlmImageData
|
||||
|
||||
return imageSourceTimestamp == other.imageSourceTimestamp
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return imageSourceTimestamp.hashCode()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "VlmImageData(imageSourceTimestamp=$imageSourceTimestamp)"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
data class VlmMessageData(val messageSourceTimestamp: Double ,val id:Int?,val message:String?){
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
other as VlmMessageData
|
||||
|
||||
// if (messageSourceTimestamp != other.messageSourceTimestamp) return false
|
||||
if (id != other.id) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = messageSourceTimestamp.hashCode()
|
||||
result = 31 * result + (id ?: 0)
|
||||
return result
|
||||
}
|
||||
}
|
||||
@@ -4,24 +4,62 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningTrajectoryListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
|
||||
import com.mogo.och.bridge.BridgeServiceManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loop.LoopInfo
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import prediction2025.Prediction2025
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
object OchBridgeManager: CallerBase<IMoGoPlanningTrajectoryListener>(),
|
||||
IMoGoPlanningTrajectoryListener, IMoGoAutopilotIdentifyListener {
|
||||
object OchBridgeManager: IMoGoPlanningTrajectoryListener, IMoGoAutopilotIdentifyListener {
|
||||
private val TAG = "${M_OCHCOMMON}OchPlanningListenerManager"
|
||||
|
||||
|
||||
private var trajectoryTime = 0L
|
||||
private var predictionTime = 0L
|
||||
|
||||
fun load(){
|
||||
CallerPlanningTrajectoryListenerManager.addListener(TAG,this)
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG,this)
|
||||
BizLoopManager.setLoopFunction(TAG, LoopInfo(2, ::checkTimeout, immediately = false, scheduler = Schedulers.io()))
|
||||
}
|
||||
|
||||
fun release(){
|
||||
CallerPlanningTrajectoryListenerManager.removeListener(TAG)
|
||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
// 是否有车前引导线
|
||||
private var haveTrajectoryInfo: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
BridgeServiceManager.invokePlanningListener(newValue)
|
||||
CallerLogger.d(TAG,"haveTrajectoryInfo 发生变化:${newValue}")
|
||||
}
|
||||
trajectoryTime = System.currentTimeMillis()
|
||||
|
||||
}
|
||||
|
||||
// 是否有预测数据
|
||||
private var havePredictionInfo: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
BridgeServiceManager.invokePredictionHaveData(newValue)
|
||||
CallerLogger.d(TAG,"havePredictionInfo 发生变化:${newValue}")
|
||||
}
|
||||
predictionTime = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
fun checkTimeout(){
|
||||
if(System.currentTimeMillis() - trajectoryTime>2_000){
|
||||
haveTrajectoryInfo = false
|
||||
CallerLogger.d(TAG,"超时设置为false:haveTrajectoryInfo $haveTrajectoryInfo")
|
||||
}
|
||||
if(System.currentTimeMillis() - predictionTime>2_000){
|
||||
havePredictionInfo = false
|
||||
CallerLogger.d(TAG,"超时设置为false:havePredictionInfo $havePredictionInfo")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,17 +67,20 @@ object OchBridgeManager: CallerBase<IMoGoPlanningTrajectoryListener>(),
|
||||
*/
|
||||
override fun onAutopilotTrajectory(trajectoryInfos: MutableList<MessagePad.TrajectoryPoint>) {
|
||||
if(trajectoryInfos.isEmpty()){
|
||||
BridgeServiceManager.invokePlanningListener(false)
|
||||
haveTrajectoryInfo = false
|
||||
}else{
|
||||
BridgeServiceManager.invokePlanningListener(true)
|
||||
haveTrajectoryInfo = true
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 预测信息
|
||||
*/
|
||||
override fun onPredictionObstacleTrajectory(predictionObjects: Prediction2025.mPredictionObjects) {
|
||||
if (predictionObjects.objsAppList==null) {
|
||||
BridgeServiceManager.invokePredictionHaveData(false)
|
||||
havePredictionInfo = false
|
||||
}else{
|
||||
BridgeServiceManager.invokePredictionHaveData(true)
|
||||
havePredictionInfo = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.mogo.och.bridge.bridge
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerVlmManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
|
||||
import com.mogo.och.bridge.BridgeServiceManager
|
||||
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
|
||||
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
|
||||
object OchNdeManager : IMoGoAutopilotIdentifyListener {
|
||||
private val TAG = "${M_OCHCOMMON}OchVlmManager"
|
||||
|
||||
fun load(){
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
fun release(){
|
||||
CallerVlmManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
private var lastMap2 = HashMap<Int, String>()
|
||||
private var lastTime = 0L
|
||||
|
||||
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?){
|
||||
super.onAutopilotIdentifyDataUpdate(trafficData)
|
||||
handleCheLong(trafficData)
|
||||
}
|
||||
|
||||
private fun handleCheLong(trafficData: List<TrackedObject>?) {
|
||||
var hasCheLong = false
|
||||
var isNewData = false
|
||||
val roadMsgList = ArrayList<RoadMsg>()
|
||||
val curMap = HashMap<Int, String>()
|
||||
if (lastTime > 0 && System.currentTimeMillis() - lastTime > 60000) {
|
||||
lastMap2.clear()// 清除上次车龙事件的缓存
|
||||
}
|
||||
var lastLocStr: String? = ""
|
||||
trafficData?.forEach { obj ->
|
||||
if (obj.type == 707) {// 当前方向所有车道
|
||||
if (obj.polygonCount > 1) {// 当次数据有车龙事件
|
||||
lastLocStr = lastMap2[obj.laneNum]
|
||||
// 1. 上次无车龙但此次有车龙,认为是新车龙事件
|
||||
// 2. 两次都有车龙,则判断车龙的长度是否相同
|
||||
if (lastLocStr == null || lastLocStr == "0" || lastLocStr != "${obj.polygonList[0]}-${obj.polygonList[obj.polygonCount - 1]}") {
|
||||
isNewData = true
|
||||
}
|
||||
hasCheLong = true
|
||||
|
||||
// key: 车道号,value: 非0代表有车龙且首、尾两个点可计算车龙长度
|
||||
curMap[obj.laneNum] =
|
||||
"${obj.polygonList[0]}-${obj.polygonList[obj.polygonCount - 1]}"
|
||||
} else {// 当次没有车龙
|
||||
if (lastMap2[obj.laneNum] != null && lastMap2[obj.laneNum] != "0") {// 3. 上次有车龙,这次无车龙
|
||||
isNewData = true
|
||||
}
|
||||
// key: 车道号,value: 0代表无车龙
|
||||
curMap[obj.laneNum] = "0"
|
||||
}
|
||||
// 保存所有车道信息
|
||||
roadMsgList.add(RoadMsg(
|
||||
obj.arrowType,
|
||||
laneNum = obj.laneNum,
|
||||
isRecommend = obj.suggestedLanes,
|
||||
isCheLong = obj.polygonCount > 1
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
if (isNewData) {
|
||||
// 清除上次车道信息
|
||||
lastMap2.clear()
|
||||
if (hasCheLong) {
|
||||
// 缓存当次车龙事件所有车道信息
|
||||
lastMap2.putAll(curMap)
|
||||
lastTime = System.currentTimeMillis()
|
||||
|
||||
val sortedList = roadMsgList.sortedWith(compareByDescending { it.laneNum })
|
||||
BridgeServiceManager.invokeNdeData("路口车龙","前方路口有车龙",sortedList)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.mogo.och.bridge.bridge
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IVlmListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerVlmManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
|
||||
import com.mogo.och.bridge.BridgeServiceManager
|
||||
import com.mogo.och.common.module.biz.birdge.data.VlmData
|
||||
import vllm.Vlm
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
object OchVlmManager : IVlmListener {
|
||||
private val TAG = "${M_OCHCOMMON}OchVlmManager"
|
||||
|
||||
fun load(){
|
||||
CallerVlmManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
fun release(){
|
||||
CallerVlmManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
//
|
||||
private var vllmImageData: VlmImageData by Delegates.observable(VlmImageData(0.0,null)) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
if(newValue.imageSourceTimestamp == vllmData.messageSourceTimestamp){
|
||||
CallerLogger.d(TAG," message先来 图片后来 发送message和图片 ${newValue.imageSourceTimestamp}---${vllmData.messageSourceTimestamp}")
|
||||
BridgeServiceManager.invokeVlmData(VlmData(vllmData.id,vllmData.message,newValue.image))
|
||||
}
|
||||
}
|
||||
}
|
||||
private var vllmData: VlmMessageData by Delegates.observable(VlmMessageData(0.0,0,"")) { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
if(newValue.messageSourceTimestamp== vllmImageData.imageSourceTimestamp){
|
||||
// 图片先来 发送message和图片
|
||||
BridgeServiceManager.invokeVlmData(VlmData(newValue.id,newValue.message,
|
||||
vllmImageData.image)
|
||||
)
|
||||
CallerLogger.d(TAG,"messsage后来 图片先来 发送message和图片 ${newValue.message}----${newValue.messageSourceTimestamp}---${newValue.id}")
|
||||
}else{
|
||||
// message 先来 单独发送message 图片来了后 再次发送出去
|
||||
BridgeServiceManager.invokeVlmData(VlmData(newValue.id,newValue.message,null))
|
||||
CallerLogger.d(TAG,"message先来 图片后来 发送message ${newValue.message}---${newValue.messageSourceTimestamp}---${newValue.id}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onVllm(sourceTimestamp: Double, vllm: Vlm.VLLMObject) {
|
||||
if(this.vllmData.id!=vllm.workZone.id){
|
||||
this.vllmData = VlmMessageData(sourceTimestamp,vllm.workZone.id,vllm.workZone.sceneExplantion)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onVllmImage(sourceTimestamp: Double, image: ByteArray) {
|
||||
this.vllmImageData = VlmImageData(sourceTimestamp,image)
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.mogo.och.common.module.debug
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.BitmapFactory
|
||||
import android.os.Environment
|
||||
import android.os.SystemClock
|
||||
import chassis.Chassis
|
||||
@@ -8,6 +10,7 @@ import chassis.Chassis.DoorNumber
|
||||
import chassis.VehicleStateOuterClass
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
@@ -24,6 +27,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerVlmManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
@@ -34,24 +38,25 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.biz.birdge.BridgeManager
|
||||
import com.mogo.och.common.module.biz.order.OrderManager
|
||||
import com.mogo.och.common.module.debug.location.MogoLocationExit
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
//import com.mogo.och.bridge.distance.TrajectoryAndDistanceManager
|
||||
//import com.mogo.och.bridge.utils.CoordinateCalculateRouteUtil
|
||||
//import com.mogo.och.bridge.utils.CoordinateCalculateRouteUtil
|
||||
import com.mogo.och.common.module.view.DebugFloatWindow
|
||||
import com.mogo.och.common.module.wigets.media.MediaBeanManager
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
import vllm.Vlm
|
||||
import java.io.BufferedReader
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.File
|
||||
import java.io.FileInputStream
|
||||
import java.io.IOException
|
||||
import java.io.InputStreamReader
|
||||
|
||||
|
||||
object DebugDataDispatch {
|
||||
|
||||
const val TAG = "DebugDataDispatch"
|
||||
@@ -73,6 +78,8 @@ object DebugDataDispatch {
|
||||
const val ota = "ota"
|
||||
const val video = "video"
|
||||
const val mediaMusic = "mediaAndMusic"
|
||||
const val vlmMessage = "vlmMessage"
|
||||
const val vlmImage = "vlmImage"
|
||||
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "location" --es path "1111/11111"
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "globalPath" --es path "sy73.json"
|
||||
@@ -89,7 +96,8 @@ object DebugDataDispatch {
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "showDebugView"
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "scanner" --es qrInfo ""
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "ota" --ei "ota" 1
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "video" --ei "video" 1 --es url "rtmp://video.zhidaozhixing.com/live/861130041693196C_2"
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "vlmMessage" --es message "前方100米有道路施工,施工长度100米,影响第1、2车道通行。" --ei id 128 --ef time 1880.0
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "vlmImage" --ef time 1880.0
|
||||
|
||||
|
||||
val ROOT_PATH =
|
||||
@@ -102,6 +110,25 @@ object DebugDataDispatch {
|
||||
|
||||
}
|
||||
when (type) {
|
||||
vlmMessage -> {
|
||||
val time = intent.getFloatExtra("time",0f)
|
||||
val id = intent.getIntExtra("id",0)
|
||||
val message = intent.getStringExtra("message")
|
||||
val newBuilder = Vlm.VLLMObject.newBuilder()
|
||||
val build = newBuilder.workZoneBuilder.setId(id).setSceneExplantion(message).build()
|
||||
newBuilder.workZone = build
|
||||
CallerVlmManager.invokeVllm(time.toDouble(),newBuilder.build())
|
||||
}
|
||||
vlmImage -> {
|
||||
val time = intent.getFloatExtra("time",0f)
|
||||
BizLoopManager.runInIoThread{
|
||||
val bitmap = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.common_debug)
|
||||
val stream = ByteArrayOutputStream()
|
||||
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream)
|
||||
val byteArray = stream.toByteArray()
|
||||
CallerVlmManager.invokeVllmImage(time.toDouble(),byteArray)
|
||||
}
|
||||
}
|
||||
mediaMusic -> {
|
||||
val musicList = MediaBeanManager.getMusicList()
|
||||
val mediaList = MediaBeanManager.getMediaList()
|
||||
|
||||
BIN
OCH/common/common/src/debug/res/drawable/common_debug.webp
Normal file
BIN
OCH/common/common/src/debug/res/drawable/common_debug.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 182 KiB |
@@ -1,6 +1,8 @@
|
||||
package com.mogo.och.common.module.biz.birdge
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.och.common.module.biz.birdge.data.RoadMsg
|
||||
import com.mogo.och.common.module.biz.birdge.data.VlmData
|
||||
|
||||
interface BridgeListener {
|
||||
/**
|
||||
@@ -15,4 +17,9 @@ interface BridgeListener {
|
||||
fun onTrajectoryDistanceListener(distance: Double){}
|
||||
|
||||
fun onTrajectoryPointsAndDistanceListener(trajectoryList: MutableList<MogoLocation>,distance: Double){}
|
||||
|
||||
|
||||
fun onVlmDataListener(vlmData: VlmData){}
|
||||
|
||||
fun onNdeDataListener(title: String, desc: String, sortedList: List<RoadMsg>) {}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.mogo.och.common.module.biz.birdge.data
|
||||
|
||||
data class RoadMsg(
|
||||
var arrowType: Int, // 车道类型,如直行201(详情参考文件:message_pad.proto)
|
||||
var laneNum: Int,// 车道号
|
||||
var isRecommend: Boolean,// 是否是推荐车道
|
||||
var isCheLong: Boolean// 是否有车龙,代表拥堵、行驶缓慢
|
||||
)
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.mogo.och.common.module.biz.birdge.data
|
||||
|
||||
data class VlmData(val id:Int?,val message:String?,var image: ByteArray?) {
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
other as VlmData
|
||||
|
||||
if (id != other.id) return false
|
||||
if (message != other.message) return false
|
||||
if (image != null) {
|
||||
if (other.image == null) return false
|
||||
if (!image.contentEquals(other.image)) return false
|
||||
} else if (other.image != null) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return id ?: 0
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "VlmData(id=$id, message=$message)"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.mogo.och.common.module.manager
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
|
||||
object EnvManager {
|
||||
fun isB1(): Boolean {
|
||||
return AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)
|
||||
}
|
||||
|
||||
fun isB1Driver(): Boolean {
|
||||
return isB1() && AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
}
|
||||
|
||||
fun isB1Passenger(): Boolean {
|
||||
return isB1() && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
}
|
||||
|
||||
fun isB2(): Boolean {
|
||||
return AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)
|
||||
}
|
||||
|
||||
fun isB2Driver(): Boolean {
|
||||
return isB2() && AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
}
|
||||
|
||||
fun isB2Passenger(): Boolean {
|
||||
return isB2() && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
}
|
||||
|
||||
fun isT1T2(): Boolean {
|
||||
return AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)
|
||||
}
|
||||
|
||||
fun isT1T2Driver(): Boolean {
|
||||
return isT1T2() && AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
}
|
||||
|
||||
fun isT1T2Passenger(): Boolean {
|
||||
return isT1T2() && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user