Merge remote-tracking branch 'origin/dev_robotaxi-d_240912_6.7.0' into dev_robotaxi-d_240912_6.7.0

This commit is contained in:
yangyakun
2024-10-11 09:50:19 +08:00
2 changed files with 61 additions and 37 deletions

View File

@@ -215,7 +215,11 @@ class CarInfoTabView @JvmOverloads constructor(
private fun updateAdHdMapVersion() {
if (AppConfigInfo.adHdMapVersion.isNotEmpty()) {
CallerLogger.i(SceneConstant.M_HMI + TAG, "updateAdHdMapVersion, adHdMapVersion:${AppConfigInfo.adHdMapVersion} , text:${tvADMapVersion.text}")
UiThreadHandler.post {
if(tvADMapVersion.text.contains(AppConfigInfo.adHdMapVersion)){
return@post
}
tvADMapVersion.text = tvADMapVersion.text.toString() + AppConfigInfo.adHdMapVersion
}
}
@@ -223,15 +227,7 @@ class CarInfoTabView @JvmOverloads constructor(
override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {
CallerLogger.i(SceneConstant.M_HMI + TAG, "hdMapVer=" + status.hdMapVer)
//hdMapVer返回示例/home/mogo/autopilot/share/hadmap_engine/data/hadmap_data/db.sqlite|bj|2.2.7|对bus路线上的junction进行修改对原609场景修改为6091、6092、6201、 6202四种细分场景并对通往园区路口改为619
if (status.hdMapVer != null && status.hdMapVer.isNotEmpty()) {
//对地图版本进行截取
val city = status.hdMapVer.substringAfter(".sqlite|").substringBefore("|")
val version = status.hdMapVer.substringAfter("$city|").substringBefore("|")
AppConfigInfo.adHdMapVersion = "${city}_${version}"
updateAdHdMapVersion()
}
updateAdHdMapVersion()
}
/**
@@ -242,14 +238,7 @@ class CarInfoTabView @JvmOverloads constructor(
*/
override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {
CallerLogger.i(SceneConstant.M_HMI + TAG, "hdMapVer=" + statusInf.hdMapVer)
//hdMapVer返回示例/home/mogo/autopilot/share/hadmap_engine/data/hadmap_data/db.sqlite|bj|2.2.7|对bus路线上的junction进行修改对原609场景修改为6091、6092、6201、 6202四种细分场景并对通往园区路口改为619
if (statusInf.hdMapVer != null && statusInf.hdMapVer.isNotEmpty()) {
//对地图版本进行截取
val city = statusInf.hdMapVer.substringAfter(".sqlite|").substringBefore("|")
val version = statusInf.hdMapVer.substringAfter("$city|").substringBefore("|")
AppConfigInfo.adHdMapVersion = "${city}_${version}"
updateAdHdMapVersion()
}
updateAdHdMapVersion()
}
}

View File

@@ -1,14 +1,11 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLine
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.SSMMsg
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.trace.CallerTrace
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.zhjt.mogo.adas.data.AdasConstants
@@ -36,7 +33,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
if (newValue == null) {
return@observable
}
if(newValue == 0L){
if (newValue == 0L) {
mAutopilotStatusInfo.isArriveAtStation = false
}
CallerTrace.write("AutoPilotStatus", mapOf("AutoPilotStatusLineId" to newValue))
@@ -71,16 +68,29 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
@Volatile
private var autoPilotMessageContent: String = ""
@Volatile
private var status: AdasConstants.IpcConnectionStatus? = null
@Volatile
private var statusInfo: SystemStatusInfo.StatusInfo? = null
@Volatile
private var statusInf: SsmInfo.SsmStatusInf? = null
override fun doSomeAfterAddListener(tag: String, listener: IMoGoAutopilotStatusListener) {
listener.onAutopilotStatusResponse(autopilotState)
if(dockerV.isNotEmpty()){
if (dockerV.isNotEmpty()) {
listener.onAutopilotDockerInfo(dockerV)
}
if (status != null) {
listener.onAutopilotIpcConnectStatusChanged(status!!, "")
}
if(statusInfo != null){
listener.onAutopilotStatusRespByQuery(statusInfo!!)
}
if(statusInf != null){
listener.onSystemStatus(statusInf!!)
}
}
/**
@@ -98,19 +108,19 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
return lineId ?: 0L
}
fun getLineStartName(): String?{
fun getLineStartName(): String? {
return mAutopilotStatusInfo.autopilotControlParameters?.startName
}
fun getLineEndName(): String?{
fun getLineEndName(): String? {
return mAutopilotStatusInfo.autopilotControlParameters?.endName
}
fun getDockerVersion():String?{
fun getDockerVersion(): String? {
return mAutopilotStatusInfo.dockVersion
}
fun isConnect():Boolean{
fun isConnect(): Boolean {
return mAutopilotStatusInfo.connectStatus
}
@@ -137,7 +147,12 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
/**
* 通过Gnss定位更新来同步更新自动驾驶状态
*/
fun updateAutoPilotLocAndTime(satelliteTime: Double, lon: Double, lat: Double, heading: Double) {
fun updateAutoPilotLocAndTime(
satelliteTime: Double,
lon: Double,
lat: Double,
heading: Double
) {
mAutopilotStatusInfo.locationLat = lat
mAutopilotStatusInfo.locationLon = lon
mAutopilotStatusInfo.locationHeading = heading
@@ -145,6 +160,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
mAutopilotStatusInfo.locationStatus = true
invokeAutoPilotStatus()
}
private var autopilotStateFromCan: Int by Delegates.observable(0) { _, oldValue, newValue ->
if (oldValue != newValue) {
CallerTrace.write("AutoPilotStatusFromCan", mapOf("AutoPilotStatusFromCan" to newValue))
@@ -159,7 +175,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
this.autopilotStateFromCan = autopilotState
}
fun updateAutoPilotStatus(autopilotStateSource: Int,autopilotState: Int, autopilotMode: Int) {
fun updateAutoPilotStatus(autopilotStateSource: Int, autopilotState: Int, autopilotMode: Int) {
mAutopilotStatusInfo.state = autopilotState
mAutopilotStatusInfo.autopilotStateSource = autopilotStateSource
this.autopilotState = autopilotState
@@ -216,9 +232,11 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
* @param autoPilotStation 数据 null表示 PadSsmMsg中的消息体为null
*/
@Synchronized
fun invokeAutoPilotStation(token: Long,
timestamp: Long,
autoPilotStation: SsmInfo.AutoPilotStation?) {
fun invokeAutoPilotStation(
token: Long,
timestamp: Long,
autoPilotStation: SsmInfo.AutoPilotStation?
) {
mAutopilotStatusInfo.isArriveAtStation = true
M_LISTENERS.forEach {
val listener = it.value
@@ -266,7 +284,10 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
/**
* 工控机与车机连接状态回调
*/
fun invokeAutoPilotIPCStatusChanged(status: AdasConstants.IpcConnectionStatus, reason: String?) {
fun invokeAutoPilotIPCStatusChanged(
status: AdasConstants.IpcConnectionStatus,
reason: String?
) {
this.status = status
M_LISTENERS.forEach {
val listener = it.value
@@ -279,10 +300,17 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
* 主动调查询接口AdasManager#sendStatusQueryReq(), 会收到以下回调
*/
fun invokeAutopilotStatusRespByQuery(statusInfo: SystemStatusInfo.StatusInfo?) {
statusInfo?.also {
statusInfo?.also { status ->
this.statusInfo = status
if (AppConfigInfo.adHdMapVersion.isEmpty() && status.hdMapVer != null && status.hdMapVer.isNotEmpty()) {
//对地图版本进行截取
val city = status.hdMapVer.substringAfter(".sqlite|").substringBefore("|")
val version = status.hdMapVer.substringAfter("$city|").substringBefore("|")
AppConfigInfo.adHdMapVersion = "${city}_${version}"
}
M_LISTENERS.forEach { itx ->
val listener = itx.value
listener.onAutopilotStatusRespByQuery(it)
listener.onAutopilotStatusRespByQuery(status)
}
}
}
@@ -293,6 +321,13 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
*/
fun invokeSystemStatus(statusInf: SsmInfo.SsmStatusInf?) {
statusInf?.also {
this.statusInf = statusInf
if (AppConfigInfo.adHdMapVersion.isEmpty() && statusInf.hdMapVer != null && statusInf.hdMapVer.isNotEmpty()) {
//对地图版本进行截取
val city = statusInf.hdMapVer.substringAfter(".sqlite|").substringBefore("|")
val version = statusInf.hdMapVer.substringAfter("$city|").substringBefore("|")
AppConfigInfo.adHdMapVersion = "${city}_${version}"
}
M_LISTENERS.forEach { itx ->
val listener = itx.value
listener.onSystemStatus(it)
@@ -315,7 +350,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
}
}
fun updateRoadCount(){
fun updateRoadCount() {
val roadCount = atomicCountRoad.addAndGet(1)
CallerTrace.write("updateRoadCount", mapOf("roadCount" to roadCount))
}
@@ -326,7 +361,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
return count
}
fun resetRoadCount(){
fun resetRoadCount() {
atomicCountRoad.set(0)
}
}