Merge branch 'refs/heads/dev_robotaxi-d_240925_6.6.1' into dev_robotaxi-d_240912_6.7.0

# Conflicts:
#	OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutopilotAnalytics.kt
#	gradle.properties
This commit is contained in:
donghongyu-pc
2024-10-12 12:16:30 +08:00
6 changed files with 84 additions and 52 deletions

View File

@@ -14,19 +14,22 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
import com.mogo.och.common.module.manager.autopilot.autopilot.bean.SessionWithTime
import com.mogo.och.common.module.manager.autopilot.line.LineManager
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
import com.zhjt.mogo.adas.common.MessageType
import com.zhjt.mogo.adas.data.bean.ReceivedAck
import com.zhjt.mogo.adas.data.bean.ReceivedAck.Status
import fsm.Fsm2024
import java.util.concurrent.atomic.AtomicLong
import java.util.concurrent.atomic.AtomicReference
object OchAutoPilotManager : IMoGoReceiveReceivedAckListener, IMoGoFsm2024Listener {
const val TAG = "OchAutoPilotManager"
private val globalSessionId = AtomicLong(-1)
private val globalSessionId = AtomicReference<SessionWithTime>()
private val fsmBackSessionId = AtomicLong(-1L)
init {
@@ -51,18 +54,27 @@ object OchAutoPilotManager : IMoGoReceiveReceivedAckListener, IMoGoFsm2024Listen
* 启动自驾中禁止再次启动自驾
*/
@JvmStatic
fun canStartAutopilotBySessionId():Boolean{
return (globalSessionId.get()==-1L).apply {
if(!this) {
fun canStartAutopilotBySessionId(): Boolean {
val sessionInfo = globalSessionId.get()
val currentTimeMillis = System.currentTimeMillis()
if(sessionInfo==null){
return true
}else{
if(currentTimeMillis-sessionInfo.setTime>=OchAutopilotAnalytics.LOOP_PERIOD_16S){
clearGlobalSessionId("检测session 自带的时间 ${currentTimeMillis}_${sessionInfo.setTime}_${sessionInfo.sessionId}")
return true
}else{
ToastUtils.showLong("自驾启动中,请勿重复点击")
OchAutopilotAnalytics.triggerCanStartAutopilotBySessionId(globalSessionId.get())
return false
}
}
}
@JvmStatic
fun canStartAutopilotBySessionIdInner():Boolean{
return (globalSessionId.get()==-1L)
OchChainLogManager.writeChainLogAutopilot("自驾流程","清理SessiongId")
return (globalSessionId.get()==null)
}
@JvmStatic
@@ -88,14 +100,15 @@ object OchAutoPilotManager : IMoGoReceiveReceivedAckListener, IMoGoFsm2024Listen
return true
}
fun clearGlobalSessionId(){
globalSessionId.set(-1)
fun clearGlobalSessionId(log:String){
OchChainLogManager.writeChainLogAutopilot("自驾流程","清理SessiongId${globalSessionId}_${fsmBackSessionId}_${log}")
globalSessionId.set(null)
}
@JvmStatic
fun startAutoPilot(controlParameters: AutopilotControlParameters?): Long {
val sessionId = CallerAutoPilotControlManager.startAutoPilot(controlParameters)
globalSessionId.set(sessionId)
globalSessionId.set(SessionWithTime(sessionId,System.currentTimeMillis()))
fsmBackSessionId.set(-1L)
OchAutopilotAnalytics.triggerStartAutopilotParameters(controlParameters, sessionId)
return sessionId
@@ -120,9 +133,14 @@ object OchAutoPilotManager : IMoGoReceiveReceivedAckListener, IMoGoFsm2024Listen
* 启动自驾失败切 FSM返回的Session和启动SessionId 不同
*/
fun checkStartSessionAndFailSessionId(){
if(globalSessionId.get() != fsmBackSessionId.get()){
OchAutopilotAnalytics.triggerStartAutopilotFailCheckSessionDiff(globalSessionId.get(),
fsmBackSessionId.get())
val sessionInfo = globalSessionId.get()
if(sessionInfo!=null) {
if (sessionInfo.sessionId != fsmBackSessionId.get()) {
OchAutopilotAnalytics.triggerStartAutopilotFailCheckSessionDiff(
sessionInfo,
fsmBackSessionId.get()
)
}
}
}
}

View File

@@ -11,9 +11,11 @@ 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.util.DateTimeUtils
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
import com.mogo.och.common.module.manager.autopilot.line.LineManager
import com.mogo.och.common.module.manager.autopilot.autopilot.bean.SessionWithTime
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
import com.mogo.och.common.module.manager.loop.BizLoopManager
import com.mogo.och.common.module.utils.RxUtils
import io.reactivex.disposables.Disposable
object OchAutopilotAnalytics {
@@ -50,6 +52,7 @@ object OchAutopilotAnalytics {
private const val EVENT_PARAM_VEHICLE_START_AUTOPILOT_CMD_SESSION_ID_FSM_RETURN = "cmd_session_id_fsm_return"
private val LOOP_PERIOD_15S = 15 * 1000L
val LOOP_PERIOD_16S = 16 * 1000L
private var mStartAutopilotKey: String? = null
@@ -95,35 +98,36 @@ object OchAutopilotAnalytics {
/**
* 等待底盘返回的间隙 重复启动自驾
*/
fun triggerCanStartAutopilotBySessionId(globalSessionId : Long){
fun triggerCanStartAutopilotBySessionId(globalSessionId : SessionWithTime){
val map = hashMapOf<String, Any>()
map[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
OchChainLogManager.writeChainLog("启动自驾Session判断","已有globalSessionId:${globalSessionId}", eventID = EVENT_KEY_VEHICLE_START_AUTOPILOT_CMD_SESSION_DUPLICATED, patch = map)
OchChainLogManager.writeChainLog("启动自驾Session判断","已有globalSessionId:${globalSessionId.sessionId}_创建时间${globalSessionId.setTime}", eventID = EVENT_KEY_VEHICLE_START_AUTOPILOT_CMD_SESSION_DUPLICATED, patch = map)
}
/**
* 启动失败后 对比两个session是否相同
*/
fun triggerStartAutopilotFailCheckSessionDiff(globalSessionId: Long, fsmBackSessionId: Long){
fun triggerStartAutopilotFailCheckSessionDiff(globalSessionId: SessionWithTime, fsmBackSessionId: Long){
val map = hashMapOf<String, Any>()
map[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
map[EVENT_PARAM_VEHICLE_START_AUTOPILOT_CMD_SESSION_ID_START] = globalSessionId
map[EVENT_PARAM_VEHICLE_START_AUTOPILOT_CMD_SESSION_ID_START] = "${globalSessionId.sessionId}_${globalSessionId.setTime}"
map[EVENT_PARAM_VEHICLE_START_AUTOPILOT_CMD_SESSION_ID_FSM_RETURN] = fsmBackSessionId
OchChainLogManager.writeChainLog("启动自驾失败且SessionId不同","globalSessionId:${globalSessionId}——————fsmBackSessionId:${fsmBackSessionId}", eventID = EVENT_KEY_VEHICLE_START_AUTOPILOT_CMD_SESSION_DIFF, patch = map)
}
private val timeOutRunnable = Runnable {
// 15s内未开启上报失败埋点
triggerStartAutopilotFailureEvent("", "15s后app等待超时", System.currentTimeMillis())
LineManager.invokeStartAutopilotTimeOut()
}
private var timeOutDisposable: Disposable?=null
/**
* 底盘明确告知启动自驾失败
*/
fun triggerStartAutopilotFailureEventByAdas(failCode: String, failMsg: String, startFailDate: Long) {
BizLoopManager.removeCallback(timeOutRunnable)
OchChainLogManager.writeChainLogAutopilot("自驾流程","启动自驾失败回调${failCode}_${failMsg}")
if(OchAutoPilotManager.canStartAutopilotBySessionIdInner()){
CallerLogger.e(SceneConstant.M_OCHCOMMON + "triggerStartAutopilotFailureEvent canStartAutopilotBySessionIdInner == false")
OchChainLogManager.writeChainLogAutopilot("自驾流程","异常情况 启动自驾失败回调${failCode}_${failMsg}_sessiong为空")
return
}
RxUtils.disposeSubscribe(timeOutDisposable)
// 判断Session 是否相同
OchAutoPilotManager.checkStartSessionAndFailSessionId()
triggerStartAutopilotFailureEvent(failCode, failMsg, startFailDate)
@@ -134,12 +138,10 @@ object OchAutopilotAnalytics {
}
private fun triggerStartAutopilotFailureEvent(failCode: String, failMsg: String, startFailDate: Long) {
if(OchAutoPilotManager.canStartAutopilotBySessionIdInner()){
CallerLogger.e(SceneConstant.M_OCHCOMMON + "triggerStartAutopilotFailureEvent canStartAutopilotBySessionIdInner == false")
OchAutoPilotManager.clearGlobalSessionId("$failMsg _ ${failCode}")
if (mStartAutopilotParams.isEmpty()) {
return
}
OchAutoPilotManager.clearGlobalSessionId()
if (mStartAutopilotParams.isEmpty()) return
CallerLogger.e(SceneConstant.M_OCHCOMMON + "triggerStartAutopilotFailureEvent", failMsg)
if (CallerAutoPilotStatusListenerManager.getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
mStartAutopilotParams[EVENT_PARAM_START_FAILURE_CODE] = failCode
@@ -172,15 +174,19 @@ object OchAutopilotAnalytics {
triggerDate: Long,
source:Int = 0
) {
OchChainLogManager.writeChainLogAutopilot("自驾流程","send:${send}_${restart}_${startName}_${endName}_${lineId}_${orderId}_${source}_${triggerDate}")
mStartAutopilotKey = if (restart) getEventKeyRestartService() else getEventKeyStartService()
if (send) {
if(OchAutoPilotManager.canStartAutopilotBySessionIdInner()){
CallerLogger.e(SceneConstant.M_OCHCOMMON + "triggerStartAutopilotEvent canStartAutopilotBySessionIdInner == false")
OchChainLogManager.writeChainLogAutopilot("自驾流程","异常情况 启动自驾成功_sessiong为空")
return
}
OchAutoPilotManager.clearGlobalSessionId("启动自驾成功")
RxUtils.disposeSubscribe(timeOutDisposable)
if (mStartAutopilotParams.isEmpty()) {
return
}
OchAutoPilotManager.clearGlobalSessionId()
BizLoopManager.removeCallback(timeOutRunnable)
if (mStartAutopilotParams.isEmpty()) return
// 开启成功,上报埋点
mStartAutopilotParams[EVENT_PARAM_START_FAILURE_CODE] = ""
mStartAutopilotParams[EVENT_PARAM_START_FAILURE_MSG] = ""
@@ -200,8 +206,10 @@ object OchAutopilotAnalytics {
mStartAutopilotParams[EVENT_PARAM_END_NAME] = endName
mStartAutopilotParams[EVENT_PARAM_LINE_ID] = lineId
mStartAutopilotParams[EVENT_PARAM_ORDER_NUMBER] = orderId?:""
BizLoopManager.removeCallback(timeOutRunnable)
BizLoopManager.postDelayed(timeOutRunnable,LOOP_PERIOD_15S)
RxUtils.disposeSubscribe(timeOutDisposable)
timeOutDisposable = RxUtils.createSubscribe(LOOP_PERIOD_15S) {
triggerStartAutopilotFailureEvent("", "15s后app等待超时", System.currentTimeMillis())
}
}
}

View File

@@ -0,0 +1,3 @@
package com.mogo.och.common.module.manager.autopilot.autopilot.bean
data class SessionWithTime(val sessionId:Long,val setTime:Long)

View File

@@ -23,6 +23,7 @@ import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandl
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
import com.mogo.eagle.function.biz.v2x.trafficlight.network.TrafficLightNetWorkModel
import com.zhidaoauto.map.data.road.RoadCross
import java.lang.Exception
class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener,
IMoGoMapRoadListener {
@@ -70,15 +71,17 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener,
}
// CallerLogger.i("$M_BIZ$TAG", "红绿灯路口请求 : $stopLineDis")
mLocation?.let { it ->
trafficLightNetWorkModel.requestRoadID(
it.latitude, it.longitude, it.heading,
{
mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_CROSS_ROAD)
roadIDResult = it
},
{
//CallerLogger.w(M_V2X + TAG, "request road id error : $it")
})
try {
trafficLightNetWorkModel.requestRoadID(
it.latitude, it.longitude, it.heading,
{
mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_CROSS_ROAD)
roadIDResult = it
},
{
//CallerLogger.w(M_V2X + TAG, "request road id error : $it")
})
}catch (_: Exception){}
}
}, {
//stop loop search road id

View File

@@ -47,7 +47,7 @@ class TakeOverListAdapter(private val context: Context): RecyclerView.Adapter<Ta
fun notifyRecordItemChanged(info: TakeOverRecordInfo){
val pos = data?.indexOf(info)
pos?.let {
data!![pos] = info
data?.set(pos, info)
notifyItemChanged(pos)
}
}

View File

@@ -64,21 +64,21 @@ bytex.ASM_API=ASM7
LOGLIB_VERSION=1.10.18
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.7.40
MOGO_NETWORK_VERSION=1.4.7.42
# 鉴权
MOGO_PASSPORT_VERSION=1.4.7.40
MOGO_PASSPORT_VERSION=1.4.7.42
# 长链接
MOGO_SOCKET_VERSION=1.4.7.40
MOGO_SOCKET_VERSION=1.4.7.42
# 数据采集
MOGO_REALTIME_VERSION=1.4.7.40
MOGO_REALTIME_VERSION=1.4.7.42
# 直播推流
MOGO_LIVE_VERSION=1.4.7.40
MOGO_LIVE_VERSION=1.4.7.42
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.7.40
MOGO_TRAFFICLIVE_VERSION=1.4.7.42
# 定位服务
MOGO_LOCATION_VERSION=1.4.7.40
MOGO_LOCATION_VERSION=1.4.7.42
# 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.7.40
MOGO_TELEMATIC_VERSION=1.4.7.42
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=3.4.1.2
@@ -90,8 +90,8 @@ WEBSOCKET_VERSION=1.1.7
applicationId=com.mogo.launcer
applicationName=IntelligentPilot
# RoboBus司机端2.5.1RoboTaxi司机端2.5.1RoboTaxi乘客端1.0.0
versionCode=6006000
versionName=6.6.0
versionCode=6007000
versionName=6.7.0
################# 新架构模块Maven版本管理 #################
MOGO_CORE_FUNCTION_HMI_VERSION=0.0.58.10