Merge branch 'dev_arch_opt_3.0' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0

# Conflicts:
#	core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt
#	libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java
#	libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java
This commit is contained in:
yangyakun
2023-02-21 16:28:51 +08:00
34 changed files with 797 additions and 315 deletions

View File

@@ -13,7 +13,6 @@ import com.mogo.eagle.core.function.call.obu.CallerObuSaveMessageListenerManager
* 处理obu分发出来在消息盒子展示的消息 * 处理obu分发出来在消息盒子展示的消息
*/ */
object V2xObuEventManager : IMoGoObuSaveMessageListener { object V2xObuEventManager : IMoGoObuSaveMessageListener {
private const val TAG = "V2xObuEventManager" private const val TAG = "V2xObuEventManager"
fun init(context: Context) { fun init(context: Context) {
@@ -33,7 +32,7 @@ object V2xObuEventManager : IMoGoObuSaveMessageListener {
* @param content 事件内容 * @param content 事件内容
* @param tts 事件语音播报 * @param tts 事件语音播报
*/ */
override fun onMoGoObuSaveMessage(type: String, content: String, tts: String) { override fun onMoGoObuSaveMessage(type: String, content: String, tts: String, source: DataSourceType) {
CallerMsgBoxManager.saveMsgBox( CallerMsgBoxManager.saveMsgBox(
MsgBoxBean( MsgBoxBean(
MsgBoxType.V2X, MsgBoxType.V2X,
@@ -43,7 +42,7 @@ object V2xObuEventManager : IMoGoObuSaveMessageListener {
tts tts
) )
).apply { ).apply {
sourceType = DataSourceType.OBU sourceType = source
} }
) )
} }

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.datacenter.autopilot
import android.Manifest.permission import android.Manifest.permission
import android.content.Context import android.content.Context
import android.util.Log
import androidx.annotation.RequiresPermission import androidx.annotation.RequiresPermission
import chassis.SpecialVehicleTaskCmdOuterClass import chassis.SpecialVehicleTaskCmdOuterClass
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
@@ -737,4 +736,37 @@ class MoGoAutopilotControlProvider :
MessageType.TYPE_RECEIVE_POINT_CLOUD) MessageType.TYPE_RECEIVE_POINT_CLOUD)
} }
} }
override fun sendRoboBusJinlvM1FrontDoorCmd(switchCmd: Int): Boolean {
return AdasManager.getInstance().sendRoboBusJinlvM1FrontDoorCmd(switchCmd)
}
override fun sendRoboBusJinlvM1AirConditionerCmd(
switchCmd: Int,
modeCmd: Int,
windSpeedCmd: Int,
temperatureCmd: Int
): Boolean {
return AdasManager.getInstance().sendRoboBusJinlvM1AirConditionerCmd(switchCmd, modeCmd, windSpeedCmd, temperatureCmd)
}
override fun sendRoboBusJinlvM1HeaderCmd(switchCmd: Int, windSpeedCmd: Int): Boolean {
return AdasManager.getInstance().sendRoboBusJinlvM1HeaderCmd(switchCmd, windSpeedCmd)
}
override fun sendRoboBusJinlvM1MainLamp1Cmd(switchCmd: Int): Boolean {
return AdasManager.getInstance().sendRoboBusJinlvM1MainLamp1Cmd(switchCmd)
}
override fun sendRoboBusJinlvM1MainLamp2Cmd(switchCmd: Int): Boolean {
return AdasManager.getInstance().sendRoboBusJinlvM1MainLamp2Cmd(switchCmd)
}
override fun sendRoboBusJinlvM1SmallLampCmd(switchCmd: Int): Boolean {
return AdasManager.getInstance().sendRoboBusJinlvM1SmallLampCmd(switchCmd)
}
override fun sendRoboBusJinlvM1TaskCmd(roboBusJinlvM1Cmd: SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd): Boolean {
return AdasManager.getInstance().sendRoboBusJinlvM1TaskCmd(roboBusJinlvM1Cmd)
}
} }

View File

@@ -173,7 +173,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(vehicleState.brakeLightStatus) CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(vehicleState.brakeLightStatus)
//方向盘转向角数据 //方向盘转向角数据
CallerChassisSteeringStateListenerManager.invokeAutopilotSteeringData(vehicleState.steering) CallerChassisSteeringStateListenerManager.invokeAutopilotSteeringData(vehicleState.steering)
//挂档位数据 //挂档位数据
CallerChassisGearStateListenerManager.invokeAutopilotGearData(vehicleState.gear) CallerChassisGearStateListenerManager.invokeAutopilotGearData(vehicleState.gear)
//加速度 //加速度
CallerChassisAccStateListenerManager.invokeAutopilotAcc(vehicleState.accel) CallerChassisAccStateListenerManager.invokeAutopilotAcc(vehicleState.accel)
@@ -237,7 +237,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
} }
chassisStates.gearSystemStates?.let { gearSystemStates -> chassisStates.gearSystemStates?.let { gearSystemStates ->
gearSystemStates.gearPosition?.let { gearSystemStates.gearPosition?.let {
//挂档位数据 //挂档位数据
CallerChassisGearStateListenerManager.invokeAutopilotGearData(it) CallerChassisGearStateListenerManager.invokeAutopilotGearData(it)
} }
} }

View File

@@ -16,19 +16,16 @@ import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningSpatListener
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.obu.CallerObuMapMathListenerManager import com.mogo.eagle.core.function.call.obu.*
import com.mogo.eagle.core.function.call.obu.CallerObuWarningRsiListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuWarningRsmListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuWarningSpatListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.support.obu.ObuScene import com.mogo.support.obu.ObuScene
import com.mogo.support.obu.constants.MogoObuConstants import com.mogo.support.obu.constants.MogoObuConstants
import kotlin.math.roundToInt import kotlin.math.roundToInt
/** /**
* *
* @author lixiaopeng * @author lixiaopeng
@@ -78,7 +75,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
onMogoObuMapMath(mapMatchData) onMogoObuMapMath(mapMatchData)
} }
/** /**
* RSI预警信息 CvxRtiThreatIndInfo交通标志预警前方限速、前方学校等等交通事件预警前方拥堵、前方积水等等 * RSI预警信息 CvxRtiThreatIndInfo交通标志预警前方限速、前方学校等等交通事件预警前方拥堵、前方积水等等
*/ */
@@ -140,9 +136,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
//车内标牌 //车内标牌
MogoObuConstants.RSI_SCENE_TYPE.IVS.toString() -> { MogoObuConstants.RSI_SCENE_TYPE.IVS.toString() -> {
when (rsiWarningData.warningMsgList[0].signSerialNum) { when (rsiWarningData.warningMsgList[0].signSerialNum) {
// MogoObuConstants.RTS.RTI_TYPE_INTERSECTION -> { //十字路口
// appId = V2iEventTypeEnum.TYPE_ID_NTERSECTION.poiType
// }
MogoObuConstants.RTS.RTI_TYPE_SHAPR_TURNS -> { //急转弯 MogoObuConstants.RTS.RTI_TYPE_SHAPR_TURNS -> { //急转弯
appId = EventTypeEnumNew.TYPE_ID_SHAPR_TURNS.poiType appId = EventTypeEnumNew.TYPE_ID_SHAPR_TURNS.poiType
} }
@@ -191,10 +184,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
MogoObuConstants.RTS.RTI_TYPE_SPEED_LIMIT -> { //限速 MogoObuConstants.RTS.RTI_TYPE_SPEED_LIMIT -> { //限速
appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType
} }
// MogoObuConstants.RTS.RTI_TYPE_GO_STRAIGHT_TURN_RIGHT -> { //直行或右转
// appId =
// EventTypeEnumNew.TYPE_USECASE_ID_GO_STRAIGHT_TURN_RIGHT.poiType
// }
MogoObuConstants.RTS.RTI_TYPE_BUS_WARNING -> { //公交提醒 MogoObuConstants.RTS.RTI_TYPE_BUS_WARNING -> { //公交提醒
appId = EventTypeEnumNew.TYPE_USECASE_ID_BUS_WARNING.poiType appId = EventTypeEnumNew.TYPE_USECASE_ID_BUS_WARNING.poiType
} }
@@ -258,11 +247,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
MogoObuConstants.STATUS.ADD -> { MogoObuConstants.STATUS.ADD -> {
saveObuToDcData(appId, alertContent, ttsContent) saveObuToDcData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction) showWarning(appId, alertContent, ttsContent, direction)
// 更新数据,是否需要
// TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(rsiWarningData)?.let {
// CallerMapUIServiceManager.getMarkerService()
// ?.updateITrafficThreatLevelInfo(it)
// }
} }
MogoObuConstants.STATUS.UPDATE -> { // 更新 MogoObuConstants.STATUS.UPDATE -> { // 更新
@@ -272,14 +256,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
MogoObuConstants.STATUS.DELETE -> { MogoObuConstants.STATUS.DELETE -> {
// 关闭警告红边 // 关闭警告红边
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_NON) CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_NON)
// 更新数据,删除标牌?
// TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(rsiWarningData)
// ?.let {
// // 事件结束,还原车辆颜色
// it.threatLevel = 0x01
// CallerMapUIServiceManager.getMarkerService()
// ?.updateITrafficInfo(it)
// }
} }
} }
} }
@@ -296,25 +272,55 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
) )
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu // 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
if (rsmWarningData != null && rsmWarningData.participant != null) { if (rsmWarningData != null && rsmWarningData.participant != null) {
var v2xType = "" var v2xType = when (rsmWarningData.participant.ptcType) {
if (rsmWarningData.participant.ptcType == 1) { //机动车 1 -> { //机动车
v2xType =
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType
} else if (rsmWarningData.participant.ptcType == 2) { //非机动车 }
v2xType = 2 -> { //非机动车
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType
} else if (rsmWarningData.participant.ptcType == 3) { //行人 }
v2xType = 3 -> { //行人
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType
} else { //未知 }
v2xType = EventTypeEnumNew.TYPE_ERROR.poiType else -> { //未知
EventTypeEnumNew.TYPE_ERROR.poiType
}
} }
val ttsContent = EventTypeEnumNew.getWarningTts(v2xType) val ttsContent = EventTypeEnumNew.getWarningTts(v2xType)
val alertContent = val alertContent =
EventTypeEnumNew.getWarningContent(v2xType) EventTypeEnumNew.getWarningContent(v2xType)
var level = -1 var level = -1
val direction = val direction = getMessageDirection(rsmWarningData.participant.targetPosition)
getMessageDirection(rsmWarningData.participant.targetPosition) //TODO 只有一个 //模型的显示
when (rsmWarningData.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
// 更新数据模型变色的时候是不是update,如果不是更新可能导致模型不变色add的时候是否有level高的 TODO
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)
?.let {
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
}
MogoObuConstants.STATUS.DELETE -> { // 删除
// 更新数据 TODO 删除原来的改变颜色删除marker。不影响别的模型添加
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)
?.let {
// 事件结束,还原交通参与者颜色
it.threatLevel = 0x01
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
//删除弱势交通元素
CallerMapUIServiceManager.getMarkerService()
?.removeCvxRvInfoIndInfo(rsmWarningData.participant.ptcId.toString())
}
}
if (rsmWarningData.warningMsg != null && rsmWarningData.warningMsg.warningDataList != null && rsmWarningData.warningMsg.warningDataList.size > 0) { if (rsmWarningData.warningMsg != null && rsmWarningData.warningMsg.warningDataList != null && rsmWarningData.warningMsg.warningDataList.size > 0) {
level = rsmWarningData.warningMsg.warningDataList[0].warningLevel level = rsmWarningData.warningMsg.warningDataList[0].warningLevel
CallerLogger.d( CallerLogger.d(
@@ -323,45 +329,36 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
rsmWarningData.warningMsg.warningDataList[0].status rsmWarningData.warningMsg.warningDataList[0].status
} --v2xType--- $v2xType ---alertContent = $alertContent ---ttsContent= $ttsContent" } --v2xType--- $v2xType ---alertContent = $alertContent ---ttsContent= $ttsContent"
) )
when (rsmWarningData.warningMsg.warningDataList[0].status) { when (rsmWarningData.warningMsg.warningDataList[0].status) {
MogoObuConstants.STATUS.ADD -> { // 添加 MogoObuConstants.STATUS.ADD -> { // 添加
//更新模型的颜色
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)
?.let {
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuToDcData(v2xType, alertContent, ttsContent) saveObuToDcData(v2xType, alertContent, ttsContent)
showWarning(v2xType, alertContent, ttsContent, direction) showWarning(v2xType, alertContent, ttsContent, direction)
// 更新数据 TODO
// TrafficDataConvertUtils.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)?.let {
//// TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it)
// CallerMapUIServiceManager.getMarkerService()
// ?.updateITrafficThreatLevelInfo(it)
// }
} }
MogoObuConstants.STATUS.UPDATE -> {// 更新 MogoObuConstants.STATUS.UPDATE -> {// 更新
} }
// 删除 MogoObuConstants.STATUS.DELETE -> { // 删除
MogoObuConstants.STATUS.DELETE -> {
// 关闭警告红边 // 关闭警告红边
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL) CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
// 更新数据 TODO 由于obu通过域控需要转换单位这里临时转换后面3.0不需要转换
// TrafficDataConvertUtils.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)?.let {
// // 事件结束,还原交通参与者颜色
// it.threatLevel = 0x01
//// TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it)
// CallerMapUIServiceManager.getMarkerService()
// ?.updateITrafficThreatLevelInfo(it)
// }
//删除弱势交通元素 //删除弱势交通元素
CallerMapUIServiceManager.getMarkerService() CallerMapUIServiceManager.getMarkerService()
?.removeCvxRvInfoIndInfo(rsmWarningData.participant.ptcId.toString()) ?.removeCvxRvInfoIndInfo(rsmWarningData.participant.ptcId.toString())
// TrafficMarkerDrawer.removeCvxRvInfoIndInfo(rsmWarningData.participantOfOne.ptcID.toString())
} }
} }
} }
} }
} }
} }
/** /**
@@ -383,10 +380,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
* 地图匹配 是OBU算法输出地图匹配结果主车匹配道路哪条路或者哪条车道 * 地图匹配 是OBU算法输出地图匹配结果主车匹配道路哪条路或者哪条车道
*/ */
fun onMogoObuMapMath(data: ObuScene.MapMatchData?) { fun onMogoObuMapMath(data: ObuScene.MapMatchData?) {
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager onMogoObuMapMath HmiBuildConfig.isShowObuLimitSpeedView = " + HmiBuildConfig.isShowObuLimitSpeedView
)
if (HmiBuildConfig.isShowObuLimitSpeedView) { if (HmiBuildConfig.isShowObuLimitSpeedView) {
if (data != null) { if (data != null) {
CallerLogger.d( CallerLogger.d(
@@ -398,7 +391,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
} --- data.speedMaxLimit = ${data.speedMaxLimit}" } --- data.speedMaxLimit = ${data.speedMaxLimit}"
) )
when (data.status) { when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加 TODO MogoObuConstants.STATUS.ADD -> { // 添加
CallerLimitingVelocityListenerManager.invokeUnion( CallerLimitingVelocityListenerManager.invokeUnion(
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(), (data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),
DataSourceType.OBU DataSourceType.OBU
@@ -469,6 +462,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
MogoObuConstants.STATUS.DELETE -> { MogoObuConstants.STATUS.DELETE -> {
// 移除顶部弹窗,当收不到信号的时候触发一次 // 移除顶部弹窗,当收不到信号的时候触发一次
CallerTrafficLightListenerManager.disableTrafficLight() CallerTrafficLightListenerManager.disableTrafficLight()
CallerTrafficLightListenerManager.invokeTrafficLightDisapper()
isShowGreenWave = false isShowGreenWave = false
isShowRunRedLight = false isShowRunRedLight = false
} }
@@ -598,18 +592,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
* 保存obu通过工控机传输的数据到消息盒子 * 保存obu通过工控机传输的数据到消息盒子
*/ */
private fun saveObuToDcData(type: String, content: String, tts: String) { private fun saveObuToDcData(type: String, content: String, tts: String) {
CallerMsgBoxManager.saveMsgBox( CallerObuSaveMessageListenerManager.invokeObuSaveMessage(type, content, tts, DataSourceType.TELEMATIC)
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
type,
content,
tts
)
).apply {
sourceType = DataSourceType.TELEMATIC
}
)
} }
/** /**

View File

@@ -107,7 +107,7 @@ class MogoPrivateObuNewManager private constructor() {
fun setObuLog(isChecked: Boolean) { fun setObuLog(isChecked: Boolean) {
ObuManager.getInstance().setEnableLog(isChecked) ObuManager.getInstance().setEnableLog(isChecked)
val builder: com.mogo.support.obu.option.MogoObuLog.Builder = val builder: MogoObuLog.Builder =
MogoObuLog.newBuilder().setEnableStdio(isChecked) MogoObuLog.newBuilder().setEnableStdio(isChecked)
if (isChecked) { if (isChecked) {
builder.setStdioLevel(MogoObuLogLevel.DBG) builder.setStdioLevel(MogoObuLogLevel.DBG)
@@ -437,27 +437,24 @@ class MogoPrivateObuNewManager private constructor() {
if (HmiBuildConfig.isShowObuWeaknessTrafficView) { if (HmiBuildConfig.isShowObuWeaknessTrafficView) {
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu // 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
if (data != null && data.participant != null) { if (data != null && data.participant != null) {
var v2xType = "" var v2xType = when (data.participant.ptcType) {
if (data.participant.ptcType == 1) { //机动车 1 -> { //机动车
v2xType =
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType
} else if (data.participant.ptcType == 2) { //非机动车 }
v2xType = 2 -> { //非机动车
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType
} else if (data.participant.ptcType == 3) { //行人 }
v2xType = 3 -> { //行人
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType
} else { //未知 }
v2xType = EventTypeEnumNew.TYPE_ERROR.poiType else -> { //未知
EventTypeEnumNew.TYPE_ERROR.poiType
}
} }
val ttsContent = EventTypeEnumNew.getWarningTts(v2xType) val ttsContent = EventTypeEnumNew.getWarningTts(v2xType)
val alertContent = val alertContent = EventTypeEnumNew.getWarningContent(v2xType)
EventTypeEnumNew.getWarningContent(v2xType)
var level = -1 var level = -1
val direction = getMessageDirection(data.participant.targetPosition) val direction = getMessageDirection(data.participant.targetPosition)
//物体数据绘制
CallerLogger.d( CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onMogoObuRsmWarning ---- data.status = ${data.status} ---data.participant.ptcId = ${data.participant.ptcId} ---data.participant.ptcType = ${data.participant.ptcType} ---data.warningMsg = ${data.warningMsg} -----data = ${data.toString()}" "onMogoObuRsmWarning ---- data.status = ${data.status} ---data.participant.ptcId = ${data.participant.ptcId} ---data.participant.ptcType = ${data.participant.ptcType} ---data.warningMsg = ${data.warningMsg} -----data = ${data.toString()}"
@@ -745,11 +742,6 @@ class MogoPrivateObuNewManager private constructor() {
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType v2xType = EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType
} }
// 这里处理固定的提示信息,包括了<紧急车辆提醒>
else -> {
// ttsContent = EventTypeEnumNew.getWarningTts(appId.toString())
// alertContent = EventTypeEnumNew.getWarningContent(appId.toString())
}
} }
when (status) { when (status) {
@@ -830,9 +822,9 @@ class MogoPrivateObuNewManager private constructor() {
MogoObuConstants.STATUS.DELETE -> { MogoObuConstants.STATUS.DELETE -> {
// 移除顶部弹窗 // 移除顶部弹窗
CallerTrafficLightListenerManager.disableTrafficLight() CallerTrafficLightListenerManager.disableTrafficLight()
CallerTrafficLightListenerManager.invokeTrafficLightDisapper()
isShowGreenWave = false isShowGreenWave = false
isShowRunRedLight = false isShowRunRedLight = false
CallerTrafficLightListenerManager.invokeTrafficLightDisapper()
} }
} }
} }
@@ -969,7 +961,7 @@ class MogoPrivateObuNewManager private constructor() {
* 保存obu直连数据到消息盒子 * 保存obu直连数据到消息盒子
*/ */
private fun saveObuData(type: String, content: String, tts: String) { private fun saveObuData(type: String, content: String, tts: String) {
CallerObuSaveMessageListenerManager.invokeObuSaveMessage(type, content, tts) CallerObuSaveMessageListenerManager.invokeObuSaveMessage(type, content, tts, DataSourceType.OBU)
} }
/** /**

View File

@@ -1931,12 +1931,12 @@ internal class DebugSettingView @JvmOverloads constructor(
} }
/** /**
* 车辆挂档位 * 车辆挂档位
* @param gear 档位 * @param gear 档位
*/ */
override fun onAutopilotGearData(gear: Chassis.GearPosition) { override fun onAutopilotGearData(gear: Chassis.GearPosition) {
ThreadUtils.runOnUiThread { ThreadUtils.runOnUiThread {
tvGearInfo.text = "档位:${gear}" tvGearInfo.text = "档位:${gear}"
} }
} }

View File

@@ -60,7 +60,7 @@ class VersionNameView @JvmOverloads constructor(
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
private fun showCurrentPadVersion() { private fun showCurrentPadVersion() {
tvAppVersionName?.let { tvAppVersionName?.let {
// it.text = "APP:${AppUtils.getAppVersionName()}" it.text = "APP:${AppUtils.getAppVersionName()}"
} }
} }

View File

@@ -1009,7 +1009,7 @@
style="@style/DebugSettingText" style="@style/DebugSettingText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="挂档位:" /> android:text="挂档位:" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -11,15 +11,16 @@ import com.mogo.cloud.passport.IMoGoTokenCallback
import com.mogo.cloud.passport.MoGoAiCloudClient import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.AbsMogoApplication import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.utils.MogoAnalyticUtils
import com.mogo.commons.constants.SharedPrefsConstants import com.mogo.commons.constants.SharedPrefsConstants
import com.mogo.commons.debug.DebugConfig import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.module.status.MogoStatusManager import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.commons.network.NetConfigUtils import com.mogo.commons.network.NetConfigUtils
import com.mogo.commons.utils.MogoAnalyticUtils
import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_LOST import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_LOST
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_SUCCESS import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_SUCCESS
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_RECONNECT
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.data.map.MogoLocation
@@ -29,29 +30,35 @@ import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager 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.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAIN
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.* import com.mogo.eagle.core.utilcode.util.*
import com.rousetime.android_startup.AndroidStartup import com.rousetime.android_startup.AndroidStartup
import com.zhjt.service.chain.ChainLog import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
import kotlin.properties.Delegates
class HttpDnsStartUp : AndroidStartup<Boolean>() { class HttpDnsStartUp : AndroidStartup<Boolean>() {
private val TAG = "MogoApplication" companion object {
private const val TAG = "HttpDnsStartUp"
}
// 配置云服务API // 配置云服务API
private val clientConfig by lazy { private val clientConfig by lazy {
MoGoAiCloudClientConfig.getInstance() MoGoAiCloudClientConfig.getInstance()
} }
// 缓存IP地址
private var cacheIp: String? = null
private var context: Context? = null private var context: Context? = null
private var gotToken = false private var gotToken = false
private var httpDnsSimpleLocation by Delegates.observable(getDefaultSimpleLocation()) { _, oldValue, newValue ->
if (oldValue.cityCode != newValue.cityCode) {
reConnectSocket(oldValue.cityCode, newValue.cityCode)
}
}
override fun callCreateOnMainThread() = true override fun callCreateOnMainThread() = true
override fun waitOnMainThread() = false override fun waitOnMainThread() = false
@@ -90,9 +97,9 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
clientConfig.isUseOriginSocket = true clientConfig.isUseOriginSocket = true
// 设置是否输出网络日志 // 设置是否输出网络日志
clientConfig.isShowNetDebugLog = false clientConfig.isShowNetDebugLog = false
clientConfig.passportUrl = FunctionBuildConfig.urlJson.passportUrl // clientConfig.passportUrl //todo 亚坤
clientConfig.socketBaseUrl = FunctionBuildConfig.urlJson.socketBaseUrl // clientConfig.socketBaseUrl
clientConfig.socketTechUrl = FunctionBuildConfig.urlJson.socketTechUrl // clientConfig.socketTechUrl
// 设置是否是直播推流的主播 // 设置是否是直播推流的主播
clientConfig.isAnchor = true clientConfig.isAnchor = true
when (DebugConfig.getCarMachineType()) { when (DebugConfig.getCarMachineType()) {
@@ -121,7 +128,10 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
override fun getCurrentLocation(): HttpDnsSimpleLocation { override fun getCurrentLocation(): HttpDnsSimpleLocation {
val envConfig = CallerDevaToolsManager.getEnvConfig() val envConfig = CallerDevaToolsManager.getEnvConfig()
if (envConfig != null) { if (envConfig != null) {
return HttpDnsSimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon) // 更新
httpDnsSimpleLocation =
HttpDnsSimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon)
return httpDnsSimpleLocation
} }
var mogoLocation: MogoLocation? = null var mogoLocation: MogoLocation? = null
val locationClient = val locationClient =
@@ -129,49 +139,25 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
if (locationClient != null) { if (locationClient != null) {
mogoLocation = locationClient mogoLocation = locationClient
} }
val httpDnsSimpleLocation = if (mogoLocation != null && mogoLocation.latitude != 0.0 && mogoLocation.longitude != 0.0) {
if (mogoLocation != null && mogoLocation.latitude != 0.0 && mogoLocation.longitude != 0.0) { // 更新
if (mogoLocation.cityCode.isNullOrEmpty() httpDnsSimpleLocation = if (mogoLocation.cityCode.isNullOrEmpty()
&& !CallerMapUIServiceManager.getGDLocationServer(context!!)?.lastCityCode.isNullOrEmpty() && !CallerMapUIServiceManager.getGDLocationServer(context!!)?.lastCityCode.isNullOrEmpty()
) { ) {
HttpDnsSimpleLocation( HttpDnsSimpleLocation(
CallerMapUIServiceManager.getGDLocationServer(context!!)?.lastCityCode CallerMapUIServiceManager.getGDLocationServer(context!!)?.lastCityCode
?: "010", ?: "010",
mogoLocation.latitude, mogoLocation.latitude,
mogoLocation.longitude mogoLocation.longitude
) )
} else {
HttpDnsSimpleLocation(
mogoLocation.cityCode,
mogoLocation.latitude,
mogoLocation.longitude
)
}
} else { } else {
val ciyCode = HttpDnsSimpleLocation(
SharedPrefsMgr.getInstance( mogoLocation.cityCode,
AbsMogoApplication.getApp() mogoLocation.latitude,
) mogoLocation.longitude
.getString(SharedPrefsConstants.LOCATION_CITY_CODE) )
val latitude =
SharedPrefsMgr.getInstance(
AbsMogoApplication.getApp()
)
.getString(SharedPrefsConstants.LOCATION_LATITUDE)
val longitude =
SharedPrefsMgr.getInstance(
AbsMogoApplication.getApp()
)
.getString(SharedPrefsConstants.LOCATION_LONGITUDE)
try {
HttpDnsSimpleLocation(
ciyCode, latitude.toDouble(), longitude.toDouble()
)
} catch (e: NumberFormatException) {
// e.printStackTrace();
HttpDnsSimpleLocation("010", 1.0, 1.0)
}
} }
}
return httpDnsSimpleLocation return httpDnsSimpleLocation
} }
} }
@@ -186,10 +172,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
clientConfig.token = token clientConfig.token = token
// 由于存在token过期问题在更新后会回调至此处增加二次判定 // 由于存在token过期问题在更新后会回调至此处增加二次判定
if (!gotToken) { if (!gotToken) {
CallerLogger.d( CallerLogger.d("$M_MAIN$TAG", "onTokenGot token : $token , sn :$sn")
SceneConstant.M_MAIN + TAG,
"onTokenGot token : $token , sn :$sn"
)
CallerCloudListenerManager.invokeCloudTokenGot(token, sn) CallerCloudListenerManager.invokeCloudTokenGot(token, sn)
// 异步初始化NetConfig // 异步初始化NetConfig
asyncInit() asyncInit()
@@ -202,7 +185,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
override fun onError(code: Int, msg: String) { override fun onError(code: Int, msg: String) {
CallerLogger.d( CallerLogger.d(
SceneConstant.M_MAIN + TAG, "$M_MAIN$TAG",
"初始化MogoAiCloudSdk failed ,reason : $msg , 未能开启长链服务和初始化Modules服务" "初始化MogoAiCloudSdk failed ,reason : $msg , 未能开启长链服务和初始化Modules服务"
) )
} }
@@ -250,13 +233,10 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
} }
private fun startSocketService() { private fun startSocketService() {
CallerLogger.d(SceneConstant.M_MAIN + TAG, "startSocketService") CallerLogger.d("$M_MAIN$TAG","startSocketService")
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02() val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
// 关闭长链服务
MogoAiCloudSocketManager.getInstance(context).destroy()
MogoAiCloudSocketManager.getInstance(context) MogoAiCloudSocketManager.getInstance(context)
.registerLifecycleListener(10020, object : IMogoLifecycleListener { .registerLifecycleListener(10020, object : IMogoLifecycleListener {
@ChainLog( @ChainLog(
linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS, linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
linkCode = CHAIN_LINK_CLOUD, linkCode = CHAIN_LINK_CLOUD,
@@ -266,7 +246,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
clientPkFileName = "sn" clientPkFileName = "sn"
) )
override fun onConnectFailure() { override fun onConnectFailure() {
CallerLogger.d(SceneConstant.M_MAIN + TAG, "socket-onConnectFailure") CallerLogger.d("$M_MAIN$TAG", "socket-onConnectFailure")
MogoStatusManager.getInstance().setCloudSocketMode(TAG, false) MogoStatusManager.getInstance().setCloudSocketMode(TAG, false)
} }
@@ -279,7 +259,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
clientPkFileName = "sn" clientPkFileName = "sn"
) )
override fun onConnectSuccess() { override fun onConnectSuccess() {
CallerLogger.d(SceneConstant.M_MAIN + TAG, "socket-onConnectSuccess") CallerLogger.d("$M_MAIN$TAG", "socket-onConnectSuccess")
MogoStatusManager.getInstance().setCloudSocketMode(TAG, true) MogoStatusManager.getInstance().setCloudSocketMode(TAG, true)
} }
@@ -292,7 +272,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
clientPkFileName = "sn" clientPkFileName = "sn"
) )
override fun onConnectLost() { override fun onConnectLost() {
CallerLogger.d(SceneConstant.M_MAIN + TAG, "socket-onConnectLost") CallerLogger.d("$M_MAIN$TAG", "socket-onConnectLost")
MogoStatusManager.getInstance().setCloudSocketMode(TAG, false) MogoStatusManager.getInstance().setCloudSocketMode(TAG, false)
} }
@@ -305,10 +285,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
clientPkFileName = "sn" clientPkFileName = "sn"
) )
override fun onError(code: String, msg: String?) { override fun onError(code: String, msg: String?) {
CallerLogger.d( CallerLogger.d("$M_MAIN$TAG", "socket-onError code : $code , msg : $msg")
SceneConstant.M_MAIN + TAG,
"socket-onError code : $code , msg : $msg"
)
} }
}) })
// 开启Socket长链服务 // 开启Socket长链服务
@@ -319,4 +296,42 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
MogoAiCloudSocketManager.getInstance(context) MogoAiCloudSocketManager.getInstance(context)
.init(context, DebugConfig.getSocketAppId(), lat, lon) .init(context, DebugConfig.getSocketAppId(), lat, lon)
} }
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
linkCode = CHAIN_LINK_CLOUD,
endpoint = PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_CLOUD_RECONNECT,
paramIndexes = [0, 1],
clientPkFileName = "sn"
)
private fun reConnectSocket(oldCityCode: String, newCityCode: String) {
CallerLogger.d("$M_MAIN$TAG", "reConnectSocket oldCityCode : $oldCityCode , newCityCode : $newCityCode")
MogoAiCloudSocketManager.getInstance(context).reConnect()
}
private fun getDefaultSimpleLocation(): HttpDnsSimpleLocation {
val ciyCode =
SharedPrefsMgr.getInstance(
AbsMogoApplication.getApp()
)
.getString(SharedPrefsConstants.LOCATION_CITY_CODE)
val latitude =
SharedPrefsMgr.getInstance(
AbsMogoApplication.getApp()
)
.getString(SharedPrefsConstants.LOCATION_LATITUDE)
val longitude =
SharedPrefsMgr.getInstance(
AbsMogoApplication.getApp()
)
.getString(SharedPrefsConstants.LOCATION_LONGITUDE)
return try {
HttpDnsSimpleLocation(
ciyCode, latitude.toDouble(), longitude.toDouble()
)
} catch (e: NumberFormatException) {
HttpDnsSimpleLocation("010", 1.0, 1.0)
}
}
} }

View File

@@ -58,6 +58,7 @@ class ChainConstant {
const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL" const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL"
const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_SUCCESS = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_SUCCESS" const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_SUCCESS = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_SUCCESS"
const val CHAIN_ALIAS_CODE_CLOUD_RECONNECT = "CHAIN_ALIAS_CODE_CLOUD_RECONNECT"
const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_LOST = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_LOST" const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_LOST = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_LOST"
const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_ERROR = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_ERROR" const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_ERROR = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_ERROR"
const val CHAIN_ALIAS_CODE_HTTP_DNS_CHANGED = "CHAIN_ALIAS_CODE_HTTP_DNS_CHANGED" const val CHAIN_ALIAS_CODE_HTTP_DNS_CHANGED = "CHAIN_ALIAS_CODE_HTTP_DNS_CHANGED"

View File

@@ -290,4 +290,26 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
* @param isDrawPointCloud 是否绘制点云 * @param isDrawPointCloud 是否绘制点云
*/ */
fun setIsDrawPointCloud(isDrawPointCloud: Boolean) fun setIsDrawPointCloud(isDrawPointCloud: Boolean)
fun sendRoboBusJinlvM1FrontDoorCmd(switchCmd: Int): Boolean
fun sendRoboBusJinlvM1AirConditionerCmd(
switchCmd: Int,
modeCmd: Int,
windSpeedCmd: Int,
temperatureCmd: Int
): Boolean
fun sendRoboBusJinlvM1HeaderCmd(switchCmd: Int, windSpeedCmd: Int): Boolean
fun sendRoboBusJinlvM1MainLamp1Cmd(switchCmd: Int): Boolean
fun sendRoboBusJinlvM1MainLamp2Cmd(switchCmd: Int): Boolean
/**
* 车门控制
*/
fun sendRoboBusJinlvM1SmallLampCmd(switchCmd: Int): Boolean
fun sendRoboBusJinlvM1TaskCmd(roboBusJinlvM1Cmd: SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd): Boolean
} }

View File

@@ -3,12 +3,12 @@ package com.mogo.eagle.core.function.api.autopilot
import chassis.Chassis import chassis.Chassis
/** /**
* 车辆挂档位 数据 回调监听 * 车辆挂档位 数据 回调监听
*/ */
interface IMoGoChassisGearStateListener { interface IMoGoChassisGearStateListener {
/** /**
* 车辆挂档位 * 车辆挂档位
* @param gear 档位 * @param gear 档位
*/ */
fun onAutopilotGearData(gear: Chassis.GearPosition) fun onAutopilotGearData(gear: Chassis.GearPosition)

View File

@@ -1,5 +1,7 @@
package com.mogo.eagle.core.function.api.obu package com.mogo.eagle.core.function.api.obu
import com.mogo.eagle.core.data.enums.DataSourceType
/** /**
* OBU 数据保存 * OBU 数据保存
* @author lixiaopeng * @author lixiaopeng
@@ -11,8 +13,8 @@ interface IMoGoObuSaveMessageListener {
* @param type 事件id类似与uuid * @param type 事件id类似与uuid
* @param content 事件内容 * @param content 事件内容
* @param tts 事件语音播报 * @param tts 事件语音播报
* * @param sourceType 来源
*/ */
fun onMoGoObuSaveMessage(type: String, content: String, tts: String) fun onMoGoObuSaveMessage(type: String, content: String, tts: String, sourceType: DataSourceType)
} }

View File

@@ -415,4 +415,39 @@ object CallerAutoPilotControlManager {
providerApi?.setIsDrawPointCloud(isDrawPointCloud) providerApi?.setIsDrawPointCloud(isDrawPointCloud)
} }
fun sendRoboBusJinlvM1FrontDoorCmd(switchCmd: Int): Boolean {
return providerApi?.sendRoboBusJinlvM1FrontDoorCmd(switchCmd) ?: false
}
fun sendRoboBusJinlvM1AirConditionerCmd(
switchCmd: Int,
modeCmd: Int,
windSpeedCmd: Int,
temperatureCmd: Int
): Boolean {
return providerApi?.sendRoboBusJinlvM1AirConditionerCmd(switchCmd, modeCmd, windSpeedCmd, temperatureCmd) ?: false
}
fun sendRoboBusJinlvM1HeaderCmd(switchCmd: Int, windSpeedCmd: Int): Boolean {
return providerApi?.sendRoboBusJinlvM1HeaderCmd(switchCmd, windSpeedCmd) ?: false
}
fun sendRoboBusJinlvM1MainLamp1Cmd(switchCmd: Int): Boolean {
return providerApi?.sendRoboBusJinlvM1MainLamp1Cmd(switchCmd) ?: false
}
fun sendRoboBusJinlvM1MainLamp2Cmd(switchCmd: Int): Boolean {
return providerApi?.sendRoboBusJinlvM1MainLamp2Cmd(switchCmd) ?: false
}
/**
* 车门控制
*/
fun sendRoboBusJinlvM1SmallLampCmd(switchCmd: Int): Boolean {
return providerApi?.sendRoboBusJinlvM1SmallLampCmd(switchCmd) ?: false
}
fun sendRoboBusJinlvM1TaskCmd(roboBusJinlvM1Cmd: SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd): Boolean {
return providerApi?.sendRoboBusJinlvM1TaskCmd(roboBusJinlvM1Cmd) ?: false
}
} }

View File

@@ -4,7 +4,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener
import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.function.call.base.CallerBase
/** /**
* 车辆挂挡档位 回调监听 * 车辆刹车 回调监听
*/ */
object CallerChassisBrakeStateListenerManager : CallerBase<IMoGoChassisBrakeStateListener>() { object CallerChassisBrakeStateListenerManager : CallerBase<IMoGoChassisBrakeStateListener>() {

View File

@@ -5,12 +5,12 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener
import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.function.call.base.CallerBase
/** /**
* 车辆挂档位 回调监听 * 车辆挂档位 回调监听
*/ */
object CallerChassisGearStateListenerManager : CallerBase<IMoGoChassisGearStateListener>() { object CallerChassisGearStateListenerManager : CallerBase<IMoGoChassisGearStateListener>() {
/** /**
* 车辆挂档位 * 车辆挂档位
* @param gear 档位 * @param gear 档位
*/ */
fun invokeAutopilotGearData(gear: Chassis.GearPosition) { fun invokeAutopilotGearData(gear: Chassis.GearPosition) {

View File

@@ -35,8 +35,6 @@ object CallerChassisLocationGCJ02ListenerManager : CallerBase<IMoGoChassisLocati
setListenerHz(tag, callBackHz) setListenerHz(tag, callBackHz)
} }
//todo 宏宇 添加HZ的移除操作
fun getChassisLocationGCJ02(): MogoLocation? { fun getChassisLocationGCJ02(): MogoLocation? {
return mGnssInfo return mGnssInfo
} }

View File

@@ -70,6 +70,16 @@ open class CallerBase<T : Any> {
return return
} }
M_LISTENERS.remove(tag) M_LISTENERS.remove(tag)
if (!M_LISTENERS_HZ.containsKey(tag)) {
return
}
M_LISTENERS_HZ.remove(tag)
if (!M_LISTENERS_HZ_LAST_SEND_TIME.containsKey(tag)) {
return
}
M_LISTENERS_HZ_LAST_SEND_TIME.remove(tag)
} }
/** /**
@@ -83,6 +93,16 @@ open class CallerBase<T : Any> {
M_LISTENERS.forEach { M_LISTENERS.forEach {
if (it.value == listener) { if (it.value == listener) {
M_LISTENERS.remove(it.key) M_LISTENERS.remove(it.key)
if (!M_LISTENERS_HZ.containsKey(it.key)) {
return
}
M_LISTENERS_HZ.remove(it.key)
if (!M_LISTENERS_HZ_LAST_SEND_TIME.containsKey(it.key)) {
return
}
M_LISTENERS_HZ_LAST_SEND_TIME.remove(it.key)
} }
} }
} }

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.call.obu package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.function.api.obu.IMoGoObuSaveMessageListener import com.mogo.eagle.core.function.api.obu.IMoGoObuSaveMessageListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsiListener import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsiListener
import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.function.call.base.CallerBase
@@ -11,11 +12,11 @@ import com.mogo.support.obu.ObuScene
*/ */
object CallerObuSaveMessageListenerManager : CallerBase<IMoGoObuSaveMessageListener>() { object CallerObuSaveMessageListenerManager : CallerBase<IMoGoObuSaveMessageListener>() {
fun invokeObuSaveMessage(type: String, content: String, tts: String) { fun invokeObuSaveMessage(type: String, content: String, tts: String, sourceType: DataSourceType) {
M_LISTENERS.forEach { M_LISTENERS.forEach {
val tag = it.key val tag = it.key
val listener = it.value val listener = it.value
listener.onMoGoObuSaveMessage(type, content, tts) listener.onMoGoObuSaveMessage(type, content, tts, sourceType)
} }
} }

View File

@@ -31,7 +31,6 @@ object AppIdentityModeUtils {
private fun getInfo(appIdentityMode: String): Array<String> { private fun getInfo(appIdentityMode: String): Array<String> {
val split = appIdentityMode.split("_") val split = appIdentityMode.split("_")
if (split.size == 3) { if (split.size == 3) {
@@ -40,6 +39,14 @@ object AppIdentityModeUtils {
return arrayOf("", "", "") return arrayOf("", "", "")
} }
fun getBuildCarType(appIdentityMode: String): String {
val (_, _, carType) = getInfo(appIdentityMode)
if(carType.isNotEmpty()){
return carType
}
return ""
}
/** /**
* 是否是 司机端(这里不细分具体是:小巴、出租车等类型) * 是否是 司机端(这里不细分具体是:小巴、出租车等类型)
* *

View File

@@ -21,6 +21,11 @@ public interface IMogoSocketManager extends IProvider {
*/ */
void init( Context context, String appId , double lat, double lon); void init( Context context, String appId , double lat, double lon);
/**
* 重新连接
*/
void reConnect();
/** /**
* 注册消息监听 * 注册消息监听
* *

View File

@@ -74,6 +74,11 @@ public class MogoAiCloudSocketManager extends ConnectionLifecycleListener implem
SocketManager.getInstance().init(context, lat, lon); SocketManager.getInstance().init(context, lat, lon);
} }
@Override
public void reConnect() {
SocketManager.getInstance().reConnect();
}
@Override @Override
public void registerOnMessageListener(int msgType, IMogoOnMessageListener listener) { public void registerOnMessageListener(int msgType, IMogoOnMessageListener listener) {
if (mListeners.containsKey(msgType)) { if (mListeners.containsKey(msgType)) {

View File

@@ -66,23 +66,23 @@ SERVICE_BIZ_VERSION=1.2.4
LOGLIB_VERSION=1.5.10 LOGLIB_VERSION=1.5.10
######## MogoAiCloudSDK Version ######## ######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION # 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.4.4 MOGO_NETWORK_VERSION=1.4.4.7
# 鉴权 # 鉴权
MOGO_PASSPORT_VERSION=1.4.4.4 MOGO_PASSPORT_VERSION=1.4.4.7
# 常链接 # 常链接
MOGO_SOCKET_VERSION=1.4.4.4 MOGO_SOCKET_VERSION=1.4.4.7
# 数据采集 # 数据采集
MOGO_REALTIME_VERSION=1.4.4.4 MOGO_REALTIME_VERSION=1.4.4.7
# 探路,道路事件发布,获取 # 探路,道路事件发布,获取
MOGO_TANLU_VERSION=1.4.4.4 MOGO_TANLU_VERSION=1.4.4.7
# 直播推流 # 直播推流
MOGO_LIVE_VERSION=1.4.4.4 MOGO_LIVE_VERSION=1.4.4.7
# 直播拉流 # 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.4.4 MOGO_TRAFFICLIVE_VERSION=1.4.4.7
# 定位服务 # 定位服务
MOGO_LOCATION_VERSION=1.4.4.4 MOGO_LOCATION_VERSION=1.4.4.7
# 远程通讯模块 # 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.4.4 MOGO_TELEMATIC_VERSION=1.4.4.7
######## MogoAiCloudSDK Version ######## ######## MogoAiCloudSDK Version ########
# 自研地图 # 自研地图
MAP_SDK_VERSION=2.10.0.2_test_01 MAP_SDK_VERSION=2.10.0.2_test_01

View File

@@ -23,7 +23,6 @@ import androidx.annotation.Nullable;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.bean.AutopilotStatistics; import com.zhidao.support.adas.high.bean.AutopilotStatistics;
import com.zhidao.support.adas.high.bean.VersionCompatibility; import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.AutopilotAbilityManager;
import com.zhidao.support.adas.high.common.AutopilotReview; import com.zhidao.support.adas.high.common.AutopilotReview;
import com.zhidao.support.adas.high.common.ByteUtil; import com.zhidao.support.adas.high.common.ByteUtil;
import com.zhidao.support.adas.high.common.Constants; import com.zhidao.support.adas.high.common.Constants;
@@ -34,6 +33,7 @@ import com.zhidao.support.adas.high.common.MessageType;
import com.zhidao.support.adas.high.common.ProtocolStatus; import com.zhidao.support.adas.high.common.ProtocolStatus;
import com.zhidao.support.adas.high.common.ReceiveTimeoutManager; import com.zhidao.support.adas.high.common.ReceiveTimeoutManager;
import com.zhidao.support.adas.high.common.RegexUtils; import com.zhidao.support.adas.high.common.RegexUtils;
import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityManager;
import com.zhidao.support.adas.high.msg.IMsg; import com.zhidao.support.adas.high.msg.IMsg;
import com.zhidao.support.adas.high.msg.MyMessageFactory; import com.zhidao.support.adas.high.msg.MyMessageFactory;
import com.zhidao.support.adas.high.protocol.RawData; import com.zhidao.support.adas.high.protocol.RawData;
@@ -129,6 +129,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
* 乘客屏无法进行注册或取消注册,因为乘客屏无法感知司机屏与工控机连接状态。无法重置已注册或未注册接口列表 * 乘客屏无法进行注册或取消注册,因为乘客屏无法感知司机屏与工控机连接状态。无法重置已注册或未注册接口列表
*/ */
private SubscribeInterface subscribeInterface; private SubscribeInterface subscribeInterface;
private Timer carConfigReqTimer;//车辆基础信息请求 多次请求防止无法收到基础信息情况出现
public void setOnMultiDeviceListener(OnMultiDeviceListener onMultiDeviceListener) { public void setOnMultiDeviceListener(OnMultiDeviceListener onMultiDeviceListener) {
this.onMultiDeviceListener = onMultiDeviceListener; this.onMultiDeviceListener = onMultiDeviceListener;
@@ -535,7 +536,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
@Override @Override
public void onWebSocketConnectSuccess(String ipAddress, int port) { public void onWebSocketConnectSuccess(String ipAddress, int port) {
sendCarConfigReq(); startCarConfigReq();
ipcConnectedIp = ipAddress; ipcConnectedIp = ipAddress;
ipcConnectedPort = port; ipcConnectedPort = port;
subscribeInterface = new SubscribeInterface(this); subscribeInterface = new SubscribeInterface(this);
@@ -662,6 +663,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
if (status == Constants.IPC_CONNECTION_STATUS.DISCONNECTED) { if (status == Constants.IPC_CONNECTION_STATUS.DISCONNECTED) {
AdasManager.getInstance().setCarConfig(null); AdasManager.getInstance().setCarConfig(null);
stopDispatchHandler(); stopDispatchHandler();
stopCarConfigReq();
} }
if (adasConnectStatusListener != null) { if (adasConnectStatusListener != null) {
adasConnectStatusListener.onConnectionIPCStatus(ipcConnectionStatus.get(), reason); adasConnectStatusListener.onConnectionIPCStatus(ipcConnectionStatus.get(), reason);
@@ -775,6 +777,40 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
CupidLogUtils.setEnableLog(isEnableLog); CupidLogUtils.setEnableLog(isEnableLog);
} }
//车辆基础信息请求
private void startCarConfigReq() {
if (carConfigReqTimer == null) {
carConfigReqTimer = new Timer();
carConfigReqTimer.schedule(new TimerTask() {
int num = 0;
@Override
public void run() {
if (getIpcConnectionStatus() == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
if (AdasManager.getInstance().getCarConfig() == null) {
num++;
if (num > 3) {
CupidLogUtils.i(TAG, "最后一次也未获取到车机基础信息");
stopCarConfigReq();
} else {
CupidLogUtils.i(TAG, "" + num + "次获取车机基础信息");
sendCarConfigReq();
}
} else {
stopCarConfigReq();
}
}
}
}, 10, 2000L);
}
}
private synchronized void stopCarConfigReq() {
if (carConfigReqTimer != null) {
carConfigReqTimer.cancel();
carConfigReqTimer = null;
}
}
/**************************************************************************************************************************/ /**************************************************************************************************************************/
/** /**
@@ -1284,6 +1320,12 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
.build()); .build());
} }
/**
* 金旅M1顶灯1控制
*
* @param switchCmd //0: default, 1: 开启顶灯, 2: 关闭顶灯
* @return boolean
*/
@Override @Override
public boolean sendRoboBusJinlvM1MainLamp1Cmd(int switchCmd) { public boolean sendRoboBusJinlvM1MainLamp1Cmd(int switchCmd) {
return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder() return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder()
@@ -1291,6 +1333,12 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
.build()); .build());
} }
/**
* 金旅M1顶灯2控制
*
* @param switchCmd //0: default, 1: 开启顶灯, 2: 关闭顶灯
* @return boolean
*/
@Override @Override
public boolean sendRoboBusJinlvM1MainLamp2Cmd(int switchCmd) { public boolean sendRoboBusJinlvM1MainLamp2Cmd(int switchCmd) {
return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder() return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder()
@@ -1298,7 +1346,6 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
.build()); .build());
} }
/** /**
* 金旅M1小灯(氛围灯)控制 * 金旅M1小灯(氛围灯)控制
* *

View File

@@ -685,9 +685,9 @@ public class AdasManager implements IAdasNetCommApi {
} }
/** /**
* 金旅M1车门控制 * 金旅M1小灯(氛围灯)控制
* *
* @param switchCmd //0: default, 1: 开启车门, 2: 关闭车门 * @param switchCmd //0: default, 1: 开启小灯(氛围灯), 2: 关闭小灯(氛围灯)
* @return boolean * @return boolean
*/ */
@Override @Override

View File

@@ -1,6 +1,6 @@
package com.zhidao.support.adas.high; package com.zhidao.support.adas.high;
import com.zhidao.support.adas.high.common.AutopilotAbilityManager; import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityManager;
import com.zhidao.support.adas.high.subscribe.SubscribeInterfaceOptions; import com.zhidao.support.adas.high.subscribe.SubscribeInterfaceOptions;
import java.util.HashSet; import java.util.HashSet;

View File

@@ -0,0 +1,118 @@
package com.zhidao.support.adas.high.common.autopilot.ability;
import com.zhidao.support.adas.high.OnAdasListener;
import java.util.Timer;
import java.util.TimerTask;
import java.util.regex.Pattern;
import chassis.Chassis;
import chassis.ChassisStatesOuterClass;
/**
* 是否可以启动自动驾驶能力检测 工控机版本>=230&& <250 使用此类
* 目前监控了底盘的一些状态和查询节点状态应答的数据
* 没有使用监控事件报告的原因是因为,部分异常没进行正常恢复通知,例如收到了异常监控数据,但是异常恢复之后没有恢复的通知
* <p>
* 此定时器不能停止 鹰眼中存在UI更新依赖循环查询系统状态
*/
public class AutopilotAbility230 {
private static final String TAG = AutopilotAbility230.class.getSimpleName();
private static final long DEFAULT_DETECTION_TIME = 3 * 1000L;//默认检测时间
private volatile Timer timer;
private ChassisStatesOuterClass.ChassisStates chassisStates;
public AutopilotAbility230() {
}
public void setChassisStates(ChassisStatesOuterClass.ChassisStates chassisStates) {
this.chassisStates = chassisStates;
}
private void onCallback() {
//金旅、开沃小巴乘客端 不能启动自动驾驶
if (AutopilotAbilityManager.getInstance().isBusPassenger()) {
return;
}
boolean isAutopilotAbility = true;//是否能启动自动驾驶
String unableAutopilotReason = null;//不能启动自动驾驶原因
//检测底盘相关
if (chassisStates != null) {
if (chassisStates.hasBrakeSystemStates()) {
float brake = chassisStates.getBrakeSystemStates().getBrakePedalResponsePosition();
if (brake > 0) {
isAutopilotAbility = false;
unableAutopilotReason = "制动踏板被踩下";
}
}
if (isAutopilotAbility) {
/**
* 档位状态判断 目前判断的车型包括 东风Taxi 红旗Taxi 金旅Bus 金旅M1 金旅M1 福田清扫车 开沃
* TODO 如果 identityMode 未赋值以及目前已知其他车型判断逻辑跟东风Taxi和红旗 走
*/
//开沃任何档位都能启动自驾
if (!AutopilotAbilityManager.getInstance().isBusDriverVan()) {
if (chassisStates.hasGearSystemStates()) {
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
//金旅Bus和清扫车 档位不正常
if (AutopilotAbilityManager.getInstance().isBusDriver()) {
if (gear == Chassis.GearPosition.GEAR_N || gear == Chassis.GearPosition.GEAR_R) {
isAutopilotAbility = false;
unableAutopilotReason = "档位不正常";
}
} else if (AutopilotAbilityManager.getInstance().isSweeperDriverFutian()) {
if (gear == Chassis.GearPosition.GEAR_N) {
isAutopilotAbility = false;
unableAutopilotReason = "档位不正常";
}
} else {
//东风Taxi和红旗 司机端和乘客端 档位不正常
if (gear == Chassis.GearPosition.GEAR_P || gear == Chassis.GearPosition.GEAR_R) {
isAutopilotAbility = false;
unableAutopilotReason = "档位不正常";
}
}
}
}
}
//TODO 关于手刹:不同车型的实现不同所以目前没法使用此字段
// if (isAutopilotAbility) {
// //电子驻车制动系统
// if (chassisStates.hasEpbSystemStates()) {
// ChassisStatesOuterClass.EPBSystemStates epb = chassisStates.getEpbSystemStates();
// if (epb.hasEpbEnableState()){
// epb.getEpbWorkState();
// }
// }
// }
}
if (AutopilotAbilityManager.getInstance().getListener() != null) {
AutopilotAbilityManager.getInstance().getListener().onAutopilotAbility(isAutopilotAbility, unableAutopilotReason);
}
}
public synchronized void start() {
if (timer == null) {
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
onCallback();
}
}, 2000L, DEFAULT_DETECTION_TIME);//延迟执行,避免刚连接成功后底盘信息无法及时同步
}
}
public synchronized void stop() {
if (timer != null) {
timer.cancel();
timer = null;
}
this.chassisStates = null;
}
}

View File

@@ -1,106 +1,41 @@
package com.zhidao.support.adas.high.common; package com.zhidao.support.adas.high.common.autopilot.ability;
import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.text.TextUtils;
import com.zhidao.support.adas.high.AdasManager; import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.support.adas.high.OnAdasListener;
import java.util.List; import java.util.List;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import chassis.Chassis; import chassis.Chassis;
import chassis.ChassisStatesOuterClass; import chassis.ChassisStatesOuterClass;
import system_master.SystemStatusInfo; import system_master.SystemStatusInfo;
/** /**
* 是否可以启动自动驾驶能力检测 * 是否可以启动自动驾驶能力检测 工控机版本>=250使用此类
* 目前监控了底盘的一些状态和查询节点状态应答的数据 * 目前监控了底盘的一些状态和查询节点状态应答的数据
* 没有使用监控事件报告的原因是因为部分异常没进行正常恢复通知例如收到了异常监控数据但是异常恢复之后没有恢复的通知 * 没有使用监控事件报告的原因是因为部分异常没进行正常恢复通知例如收到了异常监控数据但是异常恢复之后没有恢复的通知
* <p> * <p>
* 此定时器不能停止 鹰眼中存在UI更新依赖循环查询系统状态 * 此定时器不能停止 鹰眼中存在UI更新依赖循环查询系统状态
*/ */
public class AutopilotAbilityManager { public class AutopilotAbility250 {
private static final String TAG = AutopilotAbilityManager.class.getSimpleName(); private static final String TAG = AutopilotAbility250.class.getSimpleName();
private static final int WHAT_TIMEOUT = 0; private static final int WHAT_TIMEOUT = 0;
private static final int DEFAULT_TIMEOUT = 1500; private static final int DEFAULT_TIMEOUT = 1500;
private static final long DEFAULT_DETECTION_TIME = 3 * 1000L;//默认检测时间 private static final long DEFAULT_DETECTION_TIME = 3 * 1000L;//默认检测时间
private static final String[] NODE_INFO_STATE = {"未知状态 ", "依赖未就绪 ", "启动中 ", "运行 ", "停止 ", "无法启动状态 ", "人为启动状态 ", "人为关闭状态 "}; private static final String[] NODE_INFO_STATE = {"未知状态 ", "依赖未就绪 ", "启动中 ", "运行 ", "停止 ", "无法启动状态 ", "人为启动状态 ", "人为关闭状态 "};
private static volatile AutopilotAbilityManager INSTANCE;
private OnAdasListener listener;
private volatile Timer timer; private volatile Timer timer;
private final Pattern pattern = Pattern.compile("\\d+.\\d+.\\d+");
private ChassisStatesOuterClass.ChassisStates chassisStates; private ChassisStatesOuterClass.ChassisStates chassisStates;
private Handler handler;
private OnAutopilotAbilityListener onAutopilotAbilityListener;
/**
* 身份/车型
*/
private String identityMode;
public interface OnAutopilotAbilityListener { public AutopilotAbility250() {
void onStatusQuery();//查询是被调用
} }
/**
* 身份规则定义根据app/productFlavors/README.md
* * taxi司机屏 Taxi_Driver_Base 东风红旗司机端
* * taxi乘客屏 Taxi_Passenger_Base 东风红旗乘客端
* * bus司机屏 Bus_Driver_Base 金旅小巴司机端
* * Bus_Driver_Van 开沃小巴司机端
* * bus乘客屏 Bus_Passenger_Base 金旅开沃小巴乘客端
* * Bus_Passenger_M1 M1小巴乘客端
* * Bus_Passenger_M2 M2小巴乘客端
* * 清扫车 Sweeper_Driver_FT 福田清扫车司机端
* <p>
* 此定义不区分角色只区分业务线和车型
*/
private interface IDENTITY_MODE {
String TAXI_DRIVER_BASE = "Taxi_Driver_Base";//东风红旗司机端
String TAXI_PASSENGER_BASE = "Taxi_Passenger_Base";//东风红旗乘客端
String BUS_DRIVER_BASE = "Bus_Driver_Base";//金旅小巴司机端
String BUS_DRIVER_VAN = "Bus_Driver_Van";//开沃小巴司机端
String BUS_PASSENGER_BASE = "Bus_Passenger_Base";//金旅开沃小巴乘客端
String BUS_PASSENGER_M1 = "Bus_Passenger_M1";//M1小巴乘客端
String BUS_PASSENGER_M2 = "Bus_Passenger_M2";//M2小巴乘客端
String SWEEPER_DRIVER_FT = "Sweeper_Driver_FT";//福田清扫车司机端
}
public void setIdentityMode(String identityMode) {
this.identityMode = identityMode;
}
public void setOnAdasListener(OnAdasListener listener) {
this.listener = listener;
}
public void setOnAutopilotAbilityListener(OnAutopilotAbilityListener onAutopilotAbilityListener) {
this.onAutopilotAbilityListener = onAutopilotAbilityListener;
}
private AutopilotAbilityManager() {
}
public static AutopilotAbilityManager getInstance() {
if (INSTANCE == null) {
synchronized (AutopilotAbilityManager.class) {
if (INSTANCE == null) {
INSTANCE = new AutopilotAbilityManager();
}
}
}
return INSTANCE;
}
public void setStatusInfo(SystemStatusInfo.StatusInfo statusInfo) { public void setStatusInfo(SystemStatusInfo.StatusInfo statusInfo) {
if (handler != null) { if (AutopilotAbilityManager.getInstance().getHandler() != null) {
if (handler.hasMessages(WHAT_TIMEOUT)) if (AutopilotAbilityManager.getInstance().getHandler().hasMessages(WHAT_TIMEOUT))
handler.removeMessages(WHAT_TIMEOUT); AutopilotAbilityManager.getInstance().getHandler().removeMessages(WHAT_TIMEOUT);
} }
onCallback(statusInfo); onCallback(statusInfo);
} }
@@ -111,7 +46,7 @@ public class AutopilotAbilityManager {
private void onCallback(SystemStatusInfo.StatusInfo statusInfo) { private void onCallback(SystemStatusInfo.StatusInfo statusInfo) {
//金旅开沃小巴乘客端 不能启动自动驾驶 //金旅开沃小巴乘客端 不能启动自动驾驶
if (IDENTITY_MODE.BUS_PASSENGER_BASE.equalsIgnoreCase(identityMode)) { if (AutopilotAbilityManager.getInstance().isBusPassenger()) {
return; return;
} }
boolean isAutopilotAbility = true;//是否能启动自动驾驶 boolean isAutopilotAbility = true;//是否能启动自动驾驶
@@ -122,20 +57,7 @@ public class AutopilotAbilityManager {
if (statusInfo.hasMasterVersion()) { if (statusInfo.hasMasterVersion()) {
//截取Master Version //截取Master Version
String masterVersion = statusInfo.getMasterVersion(); String masterVersion = statusInfo.getMasterVersion();
if (!TextUtils.isEmpty(masterVersion)) { version = AutopilotAbilityManager.getInstance().parseVersion(false, masterVersion);
try {
Matcher matcher = pattern.matcher(masterVersion);
if (matcher.find()) {
String group = matcher.group();
if (!TextUtils.isEmpty(group)) {
String v = group.split("\\.")[0];
version = Integer.parseInt(v);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
} }
//如果 maser version 大于1还需要判断AutoPilotReady字段是否存在以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行 //如果 maser version 大于1还需要判断AutoPilotReady字段是否存在以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
if (version > 1 && statusInfo.hasAutoPilotReady()) { if (version > 1 && statusInfo.hasAutoPilotReady()) {
@@ -204,24 +126,26 @@ public class AutopilotAbilityManager {
* 档位状态判断 目前判断的车型包括 东风Taxi 红旗Taxi 金旅Bus 金旅M1 金旅M1 福田清扫车 开沃 * 档位状态判断 目前判断的车型包括 东风Taxi 红旗Taxi 金旅Bus 金旅M1 金旅M1 福田清扫车 开沃
* TODO 如果 identityMode 未赋值以及目前已知其他车型判断逻辑跟东风Taxi和红旗 * TODO 如果 identityMode 未赋值以及目前已知其他车型判断逻辑跟东风Taxi和红旗
*/ */
if (chassisStates.hasGearSystemStates()) { //开沃任何档位都能启动自驾
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition(); if (!AutopilotAbilityManager.getInstance().isBusDriverVan()) {
if (TextUtils.isEmpty(identityMode)) { if (chassisStates.hasGearSystemStates()) {
identityMode = ""; Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
}
//开沃任何档位都能启动自驾
if (!IDENTITY_MODE.BUS_DRIVER_VAN.equalsIgnoreCase(identityMode)) {
//金旅Bus和清扫车 档位不正常 //金旅Bus和清扫车 档位不正常
if (IDENTITY_MODE.BUS_DRIVER_BASE.equalsIgnoreCase(identityMode) || IDENTITY_MODE.SWEEPER_DRIVER_FT.equalsIgnoreCase(identityMode)) { if (AutopilotAbilityManager.getInstance().isBusDriver()) {
if (gear == Chassis.GearPosition.GEAR_N || gear == Chassis.GearPosition.GEAR_R) { if (gear == Chassis.GearPosition.GEAR_N || gear == Chassis.GearPosition.GEAR_R) {
isAutopilotAbility = false; isAutopilotAbility = false;
unableAutopilotReason = "位不正常"; unableAutopilotReason = "位不正常";
}
} else if (AutopilotAbilityManager.getInstance().isSweeperDriverFutian()) {
if (gear == Chassis.GearPosition.GEAR_N) {
isAutopilotAbility = false;
unableAutopilotReason = "档位不正常";
} }
} else { } else {
//东风Taxi和红旗 司机端和乘客端 档位不正常 //东风Taxi和红旗 司机端和乘客端 档位不正常
if (gear == Chassis.GearPosition.GEAR_P || gear == Chassis.GearPosition.GEAR_R) { if (gear == Chassis.GearPosition.GEAR_P || gear == Chassis.GearPosition.GEAR_R) {
isAutopilotAbility = false; isAutopilotAbility = false;
unableAutopilotReason = "位不正常"; unableAutopilotReason = "位不正常";
} }
} }
} }
@@ -239,8 +163,8 @@ public class AutopilotAbilityManager {
// } // }
// } // }
} }
if (listener != null) { if (AutopilotAbilityManager.getInstance().getListener() != null) {
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReason); AutopilotAbilityManager.getInstance().getListener().onAutopilotAbility(isAutopilotAbility, unableAutopilotReason);
} }
} }
@@ -250,14 +174,14 @@ public class AutopilotAbilityManager {
timer.schedule(new TimerTask() { timer.schedule(new TimerTask() {
@Override @Override
public void run() { public void run() {
if (onAutopilotAbilityListener != null) { if (AutopilotAbilityManager.getInstance().getOnAutopilotAbilityListener() != null) {
onAutopilotAbilityListener.onStatusQuery(); AutopilotAbilityManager.getInstance().getOnAutopilotAbilityListener().onStatusQuery();
} }
AdasManager.getInstance().sendStatusQueryReq(); AdasManager.getInstance().sendStatusQueryReq();
if (handler != null) { if (AutopilotAbilityManager.getInstance().getHandler() != null) {
if (handler.hasMessages(WHAT_TIMEOUT)) if (AutopilotAbilityManager.getInstance().getHandler().hasMessages(WHAT_TIMEOUT))
handler.removeMessages(WHAT_TIMEOUT); AutopilotAbilityManager.getInstance().getHandler().removeMessages(WHAT_TIMEOUT);
handler.sendEmptyMessageDelayed(WHAT_TIMEOUT, DEFAULT_TIMEOUT); AutopilotAbilityManager.getInstance().getHandler().sendEmptyMessageDelayed(WHAT_TIMEOUT, DEFAULT_TIMEOUT);
} }
} }
}, 2000L, DEFAULT_DETECTION_TIME);//延迟执行避免刚连接成功后底盘信息无法及时同步 }, 2000L, DEFAULT_DETECTION_TIME);//延迟执行避免刚连接成功后底盘信息无法及时同步
@@ -269,18 +193,15 @@ public class AutopilotAbilityManager {
timer.cancel(); timer.cancel();
timer = null; timer = null;
} }
handler = null;
this.chassisStates = null; this.chassisStates = null;
} }
public void setHandler(Handler handler) {
this.handler = handler;
}
public void onHandleMessage(Message msg) { public void onHandleMessage(Message msg) {
if (msg.what == WHAT_TIMEOUT) { if (msg.what == WHAT_TIMEOUT) {
onCallback(null); onCallback(null);
} }
} }
} }

View File

@@ -0,0 +1,274 @@
package com.zhidao.support.adas.high.common.autopilot.ability;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.common.Constants;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import java.util.Timer;
import java.util.TimerTask;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import chassis.ChassisStatesOuterClass;
import mogo.telematics.pad.MessagePad;
import system_master.SystemStatusInfo;
/**
* 是否可以启动自动驾驶能力检测
* 目前监控了底盘的一些状态和查询节点状态应答的数据
* 没有使用监控事件报告的原因是因为,部分异常没进行正常恢复通知,例如收到了异常监控数据,但是异常恢复之后没有恢复的通知
* <p>
* 此定时器不能停止 鹰眼中存在UI更新依赖循环查询系统状态
*/
public class AutopilotAbilityManager {
private static final String TAG = AutopilotAbilityManager.class.getSimpleName();
private static volatile AutopilotAbilityManager INSTANCE;
private OnAdasListener listener;
private final Pattern pattern = Pattern.compile("\\d+\\.\\d+\\.\\d+");
private Handler handler;
private OnAutopilotAbilityListener onAutopilotAbilityListener;
private int dockerVersion = -1;//工控机版本
private AutopilotAbility230 autopilotAbility230;
private AutopilotAbility250 autopilotAbility250;
private Timer startTimer;
/**
* 身份/车型
*/
private String identityMode;
public interface OnAutopilotAbilityListener {
void onStatusQuery();//查询是被调用
}
/**
* 身份规则定义根据app/productFlavors/README.md
* * taxi司机屏 Taxi_Driver_Base (东风、红旗司机端)
* * taxi乘客屏 Taxi_Passenger_Base (东风、红旗乘客端)
* * bus司机屏 Bus_Driver_Base (金旅小巴司机端)
* * Bus_Driver_Van (开沃小巴司机端)
* * bus乘客屏 Bus_Passenger_Base (金旅、开沃小巴乘客端)
* * Bus_Passenger_M1 M1小巴乘客端
* * Bus_Passenger_M2 M2小巴乘客端
* * 清扫车 Sweeper_Driver_FT (福田清扫车司机端)
* <p>
* 此定义不区分角色,只区分业务线和车型
*/
private interface IDENTITY_MODE {
String TAXI_DRIVER_BASE = "Taxi_Driver_Base";//(东风、红旗司机端)
String TAXI_PASSENGER_BASE = "Taxi_Passenger_Base";//(东风、红旗乘客端)
String BUS_DRIVER_BASE = "Bus_Driver_Base";//(金旅小巴司机端)
String BUS_DRIVER_VAN = "Bus_Driver_Van";//(开沃小巴司机端)
String BUS_PASSENGER_BASE = "Bus_Passenger_Base";//(金旅、开沃小巴乘客端)
String BUS_PASSENGER_M1 = "Bus_Passenger_M1";//M1小巴乘客端
String BUS_PASSENGER_M2 = "Bus_Passenger_M2";//M2小巴乘客端
String SWEEPER_DRIVER_FT = "Sweeper_Driver_FT";//(福田清扫车司机端)
}
private AutopilotAbilityManager() {
}
public static AutopilotAbilityManager getInstance() {
if (INSTANCE == null) {
synchronized (AutopilotAbilityManager.class) {
if (INSTANCE == null) {
INSTANCE = new AutopilotAbilityManager();
}
}
}
return INSTANCE;
}
public void setIdentityMode(String identityMode) {
this.identityMode = identityMode;
}
public void setCarConfig(MessagePad.CarConfigResp carConfig) {
if (dockerVersion == -1) {
String v = carConfig.getDockVersion();
int version = parseVersion(true, v);
if (version != -1) {
stopTimer();
dockerVersion = version;
Log.i("dddd", "工控机版本=" + dockerVersion);
initAutopilotAbility();
}
}
}
public void setOnAdasListener(OnAdasListener listener) {
this.listener = listener;
}
public OnAdasListener getListener() {
return listener;
}
public void setHandler(Handler handler) {
this.handler = handler;
}
public Handler getHandler() {
return handler;
}
public void setOnAutopilotAbilityListener(OnAutopilotAbilityListener onAutopilotAbilityListener) {
this.onAutopilotAbilityListener = onAutopilotAbilityListener;
}
public OnAutopilotAbilityListener getOnAutopilotAbilityListener() {
return onAutopilotAbilityListener;
}
public void setStatusInfo(SystemStatusInfo.StatusInfo statusInfo) {
if (autopilotAbility250 != null) {
autopilotAbility250.setStatusInfo(statusInfo);
}
}
public void setChassisStates(ChassisStatesOuterClass.ChassisStates chassisStates) {
if (autopilotAbility230 != null) {
autopilotAbility230.setChassisStates(chassisStates);
}
if (autopilotAbility250 != null) {
autopilotAbility250.setChassisStates(chassisStates);
}
}
public void onHandleMessage(Message msg) {
if (autopilotAbility250 != null) {
autopilotAbility250.onHandleMessage(msg);
}
}
private void initAutopilotAbility() {
if (dockerVersion >= 250) {
stop230();
if (autopilotAbility250 == null) {
autopilotAbility250 = new AutopilotAbility250();
autopilotAbility250.start();
}
} else {
stop250();
if (autopilotAbility230 == null) {
autopilotAbility230 = new AutopilotAbility230();
autopilotAbility230.start();
}
}
}
private void stop230() {
if (autopilotAbility230 != null) {
autopilotAbility230.stop();
autopilotAbility230 = null;
}
}
private void stop250() {
if (autopilotAbility250 != null) {
autopilotAbility250.stop();
autopilotAbility250 = null;
}
}
private void stopTimer() {
if (startTimer != null) {
startTimer.cancel();
startTimer = null;
}
}
/**
* 连接工控机成功调用此函数如果dockerVersion还未获取到将启动最低版本的启动自动驾驶能力检测
* 此函数为保险措施 以防无法获取工控机版本时 也能 正常执行逻辑
*/
public synchronized void start() {
if (startTimer == null) {
startTimer = new Timer();
startTimer.schedule(new TimerTask() {
@Override
public void run() {
if (dockerVersion == -1 && AdasManager.getInstance().getIpcConnectionStatus() == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
dockerVersion = 230;
initAutopilotAbility();
}
}
}, 8000L);//延迟执行,避免刚连接成功后底盘信息无法及时同步
}
}
public synchronized void stop() {
stopTimer();
stop230();
stop250();
handler = null;
dockerVersion = -1;
}
/**
* 解析版本 格式 xxx.xxx.xxx(x的数量不固定)
*
* @param isUserAll 是否使用全部截取数据 true表示 12.34.56 截取之后 123456 false表示12.34.56 截取之后 12
* @param ver 版本字符串
* @return -1表示解析失败
*/
public int parseVersion(boolean isUserAll, String ver) {
int version = -1;
if (!TextUtils.isEmpty(ver)) {
try {
Matcher matcher = pattern.matcher(ver);
if (matcher.find()) {
String group = matcher.group();
if (!TextUtils.isEmpty(group)) {
if (isUserAll) {
group = group.replace(".", "");
} else {
group = group.split("\\.")[0];
}
version = Integer.parseInt(group);
}
}
} catch (Exception e) {
CupidLogUtils.e(TAG, "版本解析失败=" + ver, e);
}
}
return version;
}
/**
* 金旅、开沃小巴乘客端
*/
public boolean isBusPassenger() {
return IDENTITY_MODE.BUS_PASSENGER_BASE.equalsIgnoreCase(identityMode);
}
/**
* 开沃小巴司机端
*/
public boolean isBusDriverVan() {
return IDENTITY_MODE.BUS_DRIVER_VAN.equalsIgnoreCase(identityMode);
}
/**
* 金旅小巴司机端
*/
public boolean isBusDriver() {
return IDENTITY_MODE.BUS_DRIVER_BASE.equalsIgnoreCase(identityMode);
}
/**
* 福田清扫车司机端
*/
public boolean isSweeperDriverFutian() {
return IDENTITY_MODE.SWEEPER_DRIVER_FT.equalsIgnoreCase(identityMode);
}
}

View File

@@ -7,6 +7,7 @@ import com.zhidao.support.adas.high.AdasChannel;
import com.zhidao.support.adas.high.AdasManager; import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.support.adas.high.OnAdasListener; import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.common.CupidLogUtils; import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityManager;
import com.zhidao.support.adas.high.protocol.RawData; import com.zhidao.support.adas.high.protocol.RawData;
import mogo.telematics.pad.MessagePad; import mogo.telematics.pad.MessagePad;
@@ -20,6 +21,7 @@ public class CarConfigRespMessage extends MyAbstractMessageHandler {
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException { public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
MessagePad.CarConfigResp carConfigResp = MessagePad.CarConfigResp.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue()); MessagePad.CarConfigResp carConfigResp = MessagePad.CarConfigResp.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
AdasChannel.calculateTimeConsumingOnDispatchRaw("车机基础信息应答", raw.receiveTime); AdasChannel.calculateTimeConsumingOnDispatchRaw("车机基础信息应答", raw.receiveTime);
AutopilotAbilityManager.getInstance().setCarConfig(carConfigResp);
AdasManager.getInstance().setCarConfig(carConfigResp); AdasManager.getInstance().setCarConfig(carConfigResp);
long nowTime = 0; long nowTime = 0;
if (CupidLogUtils.isEnableLog()) if (CupidLogUtils.isEnableLog())

View File

@@ -2,7 +2,7 @@ package com.zhidao.support.adas.high.msg;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.OnAdasListener; import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.common.AutopilotAbilityManager; import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityManager;
import com.zhidao.support.adas.high.protocol.RawData; import com.zhidao.support.adas.high.protocol.RawData;
import chassis.ChassisStatesOuterClass; import chassis.ChassisStatesOuterClass;

View File

@@ -5,7 +5,7 @@ import android.os.SystemClock;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.AdasChannel; import com.zhidao.support.adas.high.AdasChannel;
import com.zhidao.support.adas.high.OnAdasListener; import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.common.AutopilotAbilityManager; import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityManager;
import com.zhidao.support.adas.high.common.CupidLogUtils; import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.protocol.RawData; import com.zhidao.support.adas.high.protocol.RawData;

View File

@@ -5,7 +5,7 @@ import android.os.SystemClock;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.AdasChannel; import com.zhidao.support.adas.high.AdasChannel;
import com.zhidao.support.adas.high.OnAdasListener; import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.common.AutopilotAbilityManager; import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityManager;
import com.zhidao.support.adas.high.common.CupidLogUtils; import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.protocol.RawData; import com.zhidao.support.adas.high.protocol.RawData;
@@ -141,7 +141,7 @@ public class VehicleStateMessage extends MyAbstractMessageHandler {
ChassisStatesOuterClass.GearSystemStates.Builder gearSystemStates = null; ChassisStatesOuterClass.GearSystemStates.Builder gearSystemStates = null;
if (vehicleState.hasGear()) { if (vehicleState.hasGear()) {
gearSystemStates = ChassisStatesOuterClass.GearSystemStates.newBuilder(); gearSystemStates = ChassisStatesOuterClass.GearSystemStates.newBuilder();
//挂挡档位数据 //档位数据
gearSystemStates.setGearPosition(vehicleState.getGear());//鹰眼已用 gearSystemStates.setGearPosition(vehicleState.getGear());//鹰眼已用
} }
if (vehicleState.hasGearSwitchInference()) { if (vehicleState.hasGearSwitchInference()) {

View File

@@ -13,6 +13,8 @@ import com.bytedance.apm.insight.ApmInsightInitConfig;
import com.mogo.commons.constants.SharedPrefsConstants; import com.mogo.commons.constants.SharedPrefsConstants;
import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.bindingcar.CarInfo; import com.mogo.eagle.core.data.bindingcar.CarInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.CommonUtils; import com.mogo.eagle.core.utilcode.util.CommonUtils;
@@ -96,6 +98,7 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
crash.addTags("CITYCODE", mCityCode); crash.addTags("CITYCODE", mCityCode);
crash.addTags("LATITUDE", mLat); crash.addTags("LATITUDE", mLat);
crash.addTags("LONGITUTE", mLogt); crash.addTags("LONGITUTE", mLogt);
crash.addTags("CAR_TYPE", AppIdentityModeUtils.INSTANCE.getBuildCarType(FunctionBuildConfig.appIdentityMode));
// crash.setReportUrl("www.xxx.com"); // 私有化部署:私有化部署才配置上报地址 // crash.setReportUrl("www.xxx.com"); // 私有化部署:私有化部署才配置上报地址
// crash.addTags("key", "value"); // 自定义筛选tag, 按需添加、可多次覆盖 // crash.addTags("key", "value"); // 自定义筛选tag, 按需添加、可多次覆盖