[车门、安全带、站点停车]
This commit is contained in:
yangyakun
2026-04-20 16:57:30 +08:00
parent e47fcfcd10
commit 83dd65eb8d
14 changed files with 415 additions and 9 deletions

View File

@@ -50,6 +50,8 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateAutoPilotDockerInfo
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateAutoPilotStatus
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateAutoPilotStatusFromCan
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateMiddleDoorOpen
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateSeatedMenSafetyBeltNotFasten
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager.invokeAutopilotAbility
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager.invokeAutopilotCarConfigData
@@ -159,6 +161,7 @@ import prediction2025.Prediction2025
import record_cache.RecordPanelOuterClass
import system_master.SsmInfo
import system_master.SystemStatusInfo
import taskmgr.TmInfo
import vllm.Vlm
import java.io.PrintWriter
import java.io.StringWriter
@@ -344,6 +347,8 @@ class MoGoAdasListenerImpl : OnAdasListener {
) {
if (autopilotState != null) {
updateAutoPilotStatusFromCan(autopilotState.state)
updateMiddleDoorOpen(autopilotState.middleDoorOpen)
updateSeatedMenSafetyBeltNotFasten(autopilotState.seatedMenSafetyBeltNotFasten)
if (AdasManager.getInstance()
.getNodeStateInfo(AdasConstants.NodeName.FSM2024).existState != NodeExistState.NODE_EXIST_NORMAL
) {
@@ -1689,6 +1694,10 @@ class MoGoAdasListenerImpl : OnAdasListener {
taskManagerOriginal(header, data)
}
override fun onAdasTaskManagerStationStopOriginal(header: MessagePad.Header, data: String) {
taskManagerOriginal(header, data)
}
@ChainLog(
linkChainLog = CHAIN_TYPE_SOCKET_AUTOPILOT,
linkCode = CHAIN_SOURCE_ADAS,
@@ -1717,6 +1726,13 @@ class MoGoAdasListenerImpl : OnAdasListener {
CallerTaskListenerManager.invokeRunningTaskInfo(taskId,lineId,taskLocationQueryResponse)
}
/**
* 站点停车消息
*/
override fun onAdasTaskManagerStationStop(stationStopInfo: TmInfo.StationStopInfo?) {
CallerAutoPilotStatusListenerManager.taskmanagerStationStop(stationStopInfo)
}
/**
* 是否可以启动自动驾驶
* 使用方法查看app_ipc_monitoring/uiMainActivity/onAutopilotAbility

View File

@@ -4,6 +4,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.zhjt.mogo.adas.data.AdasConstants
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskArrivalNotification
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskStartNotification
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskStationStop
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
import system_master.*
@@ -29,6 +30,22 @@ interface IMoGoAutopilotStatusListener {
*/
fun onAutopilotStatusResponseFromCan(state: Int) {}
/**
* 自动驾驶状态信息 中门开启状态
*
* @param state 状态信息
*/
fun onMiddleDoorOpenState(state: Boolean) {}
/**
* 自动驾驶状态信息 是否有人没有系安全带
*
* @param state 状态信息
*/
fun onSeatedMenSafetyBeltNotFasten(state: Boolean) {}
fun onTaskStationStop(newValue: TaskStationStop?) {}
/**
* 自动驾驶docker信息
*

View File

@@ -14,10 +14,12 @@ import com.mogo.eagle.core.utilcode.util.ParseVersionUtils
import com.zhjt.mogo.adas.data.AdasConstants
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskArrivalNotification
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskStartNotification
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskStationStop
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
import system_master.SsmInfo
import system_master.SystemStatusInfo
import taskmgr.TmInfo
import java.util.concurrent.atomic.AtomicInteger
import kotlin.properties.Delegates
@@ -187,10 +189,72 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
}
}
private var middleDoorState: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
if (oldValue != newValue) {
CallerTrace.write("MiddleDoorStateFromState", mapOf("MiddleDoorStateFromState" to newValue))
M_LISTENERS.forEach {
val listener = it.value
listener.onMiddleDoorOpenState(newValue)
}
}
}
private var seatedMenSafetyBeltNotFasten: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
if (oldValue != newValue) {
CallerTrace.write("seatedMenSafetyBeltNotFasten", mapOf("seatedMenSafetyBeltNotFasten" to newValue))
M_LISTENERS.forEach {
val listener = it.value
listener.onSeatedMenSafetyBeltNotFasten(newValue)
}
}
}
private var taskStationStop: TaskStationStop? by Delegates.observable(null) { _, oldValue, newValue ->
if (oldValue != newValue) {
CallerTrace.write("taskStationStop", mapOf("taskStationStop" to newValue))
M_LISTENERS.forEach {
val listener = it.value
listener.onTaskStationStop(newValue)
}
}
}
fun updateAutoPilotStatusFromCan(autopilotState: Int) {
this.autopilotStateFromCan = autopilotState
}
fun updateSeatedMenSafetyBeltNotFasten(seatedMenSafetyBeltNotFasten: Boolean) {
this.seatedMenSafetyBeltNotFasten = seatedMenSafetyBeltNotFasten
}
fun updateMiddleDoorOpen(middleDoorOpen: Boolean) {
this.middleDoorState = middleDoorOpen
}
fun taskmanagerStationStop(stationStopInfo: TmInfo.StationStopInfo?) {
if(this.taskStationStop==null){
if(stationStopInfo!=null) {
this.taskStationStop = TaskStationStop.toTaskStationStop(stationStopInfo)
}
}else{
if(stationStopInfo==null){
this.taskStationStop = null
}else{
taskStationStop?.let {
if ((it.isStop!=stationStopInfo.stop
|| it.stopStation.stationId!=it.stopStation.stationId)
) {
this.taskStationStop = TaskStationStop.toTaskStationStop(stationStopInfo)
}
}
}
}
}
fun updateAutoPilotStatus(autopilotStateSource: Int, autopilotState: Int, autopilotMode: Int) {
mAutopilotStatusInfo.state = autopilotState
mAutopilotStatusInfo.autopilotStateSource = autopilotStateSource