From 83dd65eb8d664dbaff6a18ac8bae8bde683b39ce Mon Sep 17 00:00:00 2001 From: yangyakun Date: Mon, 20 Apr 2026 16:57:30 +0800 Subject: [PATCH] =?UTF-8?q?[8.5.0]=20[=E8=BD=A6=E9=97=A8=E3=80=81=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E5=B8=A6=E3=80=81=E7=AB=99=E7=82=B9=E5=81=9C=E8=BD=A6?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OchAutoPilotStatusListenerManager.kt | 13 ++ .../logchainanalytic/OchChainLogManager.kt | 9 ++ .../cloud/model/SweeperCloudTaskModel.java | 15 +++ .../presenter/SweeperOperatePresenter.java | 16 +++ .../autopilot/adapter/MoGoAdasListenerImpl.kt | 16 +++ .../autopilot/IMoGoAutopilotStatusListener.kt | 17 +++ .../CallerAutoPilotStatusListenerManager.kt | 64 +++++++++ .../zhjt/mogo/adas/common/MessageType.java | 1 + .../task/dto/cmd/TaskStationStop.java | 78 +++++++++++ .../src/main/proto/message_pad.proto | 1 + .../src/main/proto/tm_info.proto | 124 ++++++++++++++++++ .../support/adas/high/OnAdasListener.java | 27 ++-- .../adas/high/msg/MyMessageFactory.java | 7 + .../msg/TaskManagerStationStopMessage.java | 36 +++++ 14 files changed, 415 insertions(+), 9 deletions(-) create mode 100644 libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/unmanned/task/dto/cmd/TaskStationStop.java create mode 100644 libraries/mogo-adas-data/src/main/proto/tm_info.proto create mode 100644 libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/TaskManagerStationStopMessage.java diff --git a/OCH/common/bridge/src/main/java/com/mogo/och/bridge/autopilot/autopilot/OchAutoPilotStatusListenerManager.kt b/OCH/common/bridge/src/main/java/com/mogo/och/bridge/autopilot/autopilot/OchAutoPilotStatusListenerManager.kt index ff6854b42e..1e4adca1e4 100644 --- a/OCH/common/bridge/src/main/java/com/mogo/och/bridge/autopilot/autopilot/OchAutoPilotStatusListenerManager.kt +++ b/OCH/common/bridge/src/main/java/com/mogo/och/bridge/autopilot/autopilot/OchAutoPilotStatusListenerManager.kt @@ -25,6 +25,7 @@ import com.zhjt.mogo.adas.data.bean.ReceivedAck import com.zhjt.mogo.adas.data.bean.ReceivedAck.Status 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 fsm.Fsm2024 import mogo.telematics.pad.MessagePad import mogo_msg.MogoReportMsg @@ -291,6 +292,18 @@ object OchAutoPilotStatusListenerManager : CallerBase public void onArriveAtStationByTaskManager(@Nullable Long taskId, @Nullable TaskArrivalNotification taskArrivalNotification) { } + + @Override + public void onMiddleDoorOpenState(boolean state) { + + } + + @Override + public void onSeatedMenSafetyBeltNotFasten(boolean state) { + + } + + @Override + public void onTaskStationStop(@Nullable TaskStationStop newValue) { + + } } diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt index c6ecaea77b..dbacc44d84 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt @@ -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 diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt index a6ea2e62a1..daeecfda7e 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt @@ -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信息 * diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt index cc1cf8c4e6..8b14c3f09f 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt @@ -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 + 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 diff --git a/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/common/MessageType.java b/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/common/MessageType.java index 326c0c7a2a..9ef1390149 100644 --- a/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/common/MessageType.java +++ b/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/common/MessageType.java @@ -121,6 +121,7 @@ public enum MessageType { TYPE_RECEIVE_FSM_EVENT(MessagePad.MessageType.MsgTypeFsmEvent, R.string.adas_data_MsgTypeFsmEvent), TYPE_SEND_TASK_MANAGER(MessagePad.MessageType.MsgTypeTaskMgrAndPad, R.string.adas_data_MsgTypeTaskMgrAndPad_SEND), TYPE_RECEIVE_TASK_MANAGER(MessagePad.MessageType.MsgTypeTaskMgrAndPad, R.string.adas_data_MsgTypeTaskMgrAndPad_RECEIVE), + TYPE_RECEIVE_TASK_MANAGER_StationStop(MessagePad.MessageType.MsgTypeTaskMgrAndPad, R.string.adas_data_MsgTypeTaskMgrAndPad_RECEIVE), //TODO 透传原始pb文件中不存在以下type。由于Java中无法强转,所以在mogo-adas-data/message_pad.proto中放开注释 TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, R.string.adas_data_MsgTypePlanningDecisionState), diff --git a/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/unmanned/task/dto/cmd/TaskStationStop.java b/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/unmanned/task/dto/cmd/TaskStationStop.java new file mode 100644 index 0000000000..3ef9a4a93c --- /dev/null +++ b/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/unmanned/task/dto/cmd/TaskStationStop.java @@ -0,0 +1,78 @@ +package com.zhjt.mogo.adas.unmanned.task.dto.cmd; + +import taskmgr.TmInfo; + +public class TaskStationStop { + /** + * 停靠站信息, 仅stop=true时候有效, 否则会变更 + */ + private VehicleSite stopStation; + /** + * 下一站是否停车, true 停车,false 不停车 + */ + private boolean stop; + /** + * 停车原因,0:未定义原因,1:底盘stop信号,2:站点挥手拦停 + */ + private int stopReason; + /** + * 到停靠站的距离,单位m + */ + private Double stopDistance; + + public VehicleSite getStopStation() { + return stopStation; + } + + public void setStopStation(VehicleSite stopStation) { + this.stopStation = stopStation; + } + + public boolean isStop() { + return stop; + } + + public void setStop(boolean stop) { + this.stop = stop; + } + + public int getStopReason() { + return stopReason; + } + + public void setStopReason(int stopReason) { + this.stopReason = stopReason; + } + + public Double getStopDistance() { + return stopDistance; + } + + public void setStopDistance(Double stopDistance) { + this.stopDistance = stopDistance; + } + + public static TaskStationStop toTaskStationStop(TmInfo.StationStopInfo stationStopInfo){ + if(stationStopInfo==null){ + return null; + } + TaskStationStop taskStationStop = new TaskStationStop(); + taskStationStop.setStop(stationStopInfo.getStop()); + taskStationStop.setStopReason(stationStopInfo.getStopReason()); + taskStationStop.setStopDistance(stationStopInfo.getStopDistance()); + TmInfo.Location stopStation = stationStopInfo.getStopStation(); + if(stopStation!=null){ + VehicleSite vehicleSite = VehicleSite.builder() + .coordinateType(stopStation.getCoordinateType()) + .point(new AutopilotPoint(stopStation.getPoint().getX(), stopStation.getPoint().getY())) + .station(stopStation.getStation()) + .stationId(stopStation.getStationId()) + .stationName(stopStation.getStationName()) + .stationSeq(Math.toIntExact(stopStation.getStationSeq())) + .build(); + taskStationStop.setStopStation(vehicleSite); + } + return taskStationStop; + + } +} diff --git a/libraries/mogo-adas-data/src/main/proto/message_pad.proto b/libraries/mogo-adas-data/src/main/proto/message_pad.proto index f335ea5e7d..9ed858d551 100644 --- a/libraries/mogo-adas-data/src/main/proto/message_pad.proto +++ b/libraries/mogo-adas-data/src/main/proto/message_pad.proto @@ -51,6 +51,7 @@ enum MessageType MsgTypePredictionObjects2025 = 0x10015; //自车他车轨迹预测2025 定频10hz MsgTypevllm = 0x10016; //vllm 定频 5秒一条 T1-2025(东风Taxi),map是在5.1.0routing MsgTypeVllmImage60 = 0x10017; //vllm图像 定频 5秒一条 T1-2025(东风Taxi),map是在5.1.0routing + MsgTypeTaskMgrAndPadStationStop = 0x10018; //是否有人按停车 //### 以下消息全部不定频 ### MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求 diff --git a/libraries/mogo-adas-data/src/main/proto/tm_info.proto b/libraries/mogo-adas-data/src/main/proto/tm_info.proto new file mode 100644 index 0000000000..63e5ff69db --- /dev/null +++ b/libraries/mogo-adas-data/src/main/proto/tm_info.proto @@ -0,0 +1,124 @@ +syntax = "proto2"; +package taskmgr; + +import "geometry.proto"; +import "header.proto"; + +message TaskQueryRequest { + required uint32 taskId = 1; //任务ID + required uint32 lineId = 2; //轨迹id +} +message Location { + optional uint32 coordinateType = 1 [default = 0]; //坐标类型 0:WGS84 1:GCJ02 2:UTM + optional geometry.Point point = 2; //经纬度 + optional uint32 station = 3; // 判断此点是站点还是途径点 ------- 0:站点, 1:简单的途径点 + optional uint64 stationId = 4; //站点编号,对应云平台数据库固定值 + optional string stationName = 5; //站点名称 + optional uint64 stationSeq = 6; //站点序号,对应列表里站点流程,从1开始,1为起始点,途径点填写0 +} +message TaskQueryResponse { + required Location curLocation = 1; +// required Location preStation = 2; //前一站站点信息,用于过站同步 +// required Location nextStation = 3; //下一站站点信息 + required double accumulatedStationDis = 4; //从前一站点到目前的总距离(单位m) + required double reversedAccumulatedStationDis = 5; //从当前到下一站点的距离(单位m) + required double stationTimeLeft = 6; //到达下一站需要的时间(单位s) +// optional double velocity = 7; //速度, m/s +// optional double acceleration = 8; //加速度, m/s^2 +// optional double theta = 9; //速度方向 +// optional double kappa = 10; //曲率 + optional double accumulatedTaskDis = 11; //任务全程的行进里程 + optional double reversedAccumulatedTaskDis = 12; //任务全程的剩余里程 + optional double taskTimeLeft = 13; //到达终点需要的时间(单位s) +} + +enum TaskState { + NONE = 0; //无任务 + WAITING = 10; //任务待执行Waiting, 轨迹下载完成,算路请求完成,等待发车 + RUNNING = 20; //任务行进中running,收到发车名称,自驾成功,多站点多次进入该状态 + STOPED = 30; //到站停车,到达中间站点站点,上报了到站提醒 + FINISH = 40; //任务结束,收到任务结束指令或者到达终点后5秒,要主动发出停止自驾 + ABORT = 50; //任务中止,存在故障或者异常,无法自驾 + CANCEL = 60; //任务取消,收到取消指令 +} + + +message TaskStationsQueryRequest { + optional string src = 1; //查询来源,建议填写为rosnode名称 +} + +message TaskStationsQueryResponse { + required TaskState state = 1; //任务状态 + repeated Location stations = 2; //站点列表 +} + + +message StationStopInfo { //2Hz定频上报 + required bool stop = 1; //下一站是否停车, true 停车,false 不停车 + optional uint32 stopReason = 2; //停车原因,0:未定义原因,1:底盘stop信号,2:站点挥手拦停 + optional Location stopStation = 3; //停靠站信息, 仅stop=true时候有效, 否则会变更 + optional double stopDistance = 4; //到停靠站的距离,单位m +} + +message TaskInfo { + required uint64 taskId = 1; //任务ID, 同原接口的orderid + required TaskState task_state = 2; //任务状态 + required uint64 lineId = 3; //轨迹id + required Location curLocation = 4; + required Location preStation = 5; //前一站站点信息 + required Location nextStation = 6; //下一站站点信息 + optional uint64 taskStartTime = 7; //任务开始时间 + optional double taskTimeLeft = 8; //任务结束剩余时间, 可用于升级提示 +} + +message TaskEndNotify { //任务结束通知 + required bool normal= 1; //true:正常结束 false: 异常中止 + optional string order_id = 2; //订单号 +} + +message TaskStartOrContinueNotify { //任务开始或继续通知,给规划 + optional common.Header header = 1; + optional string order_id = 2; //任务ID, 同原接口的orderid + optional geometry.Point start_pos = 3; //起始站点utm坐标 + required geometry.Point end_pos = 4; //结束站点utm坐标 + optional geometry.Point end_pos_lon_lat = 5; //结束站点信息, 经纬度坐标 +} + +message TaskStopNotify { //任务停止通知,给规划,当前用于站点停止发车 + optional common.Header header = 1; + optional string order_id = 2; //任务ID, 同原接口的orderid + optional uint32 stop_reason = 3; //停止原因, 1: 底盘stop信号 2: 站点挥手拦停,0:未定义原因 +} + + + +enum VoiceEvent { + UNKNOWN = 0; + //这里只罗列目前需要收集的语音事件,后续扩展按需增加 + ENTER_STATION = 3001; //进站 + LEAVE_STATION = 3002; //出站 + AVOIDANCE = 3103; //绕障 + TURN_LEFT = 3204; //左转 + TURN_RIGHT = 3205; //右转 + + PEDESTRIAN_AVOIDANCE = 2001; //行人避让 + CROSSWALK_AVOIDANCE = 2002; //过人行横道,礼让 + STUCK = 2101; //陷入困境 + CROSSROAD = 2102; //路口通行\ + + COLLISION = 1001; //碰撞事故 +} + +message VoiceEventItems { + required uint32 event = 1; //语音事件码, 同产品语音播发类型需求,定义uint32 便于扩展。 目前定义参考VoiceEvent + optional string action = 2; //自驾行为或者环境示警描述,目前主要有:进出站,绕障,左/右转,行人避让,路口通信 + optional string extra = 3; //额外信息补充,如进站时候站点名称,开门操作对应得门的信息等,便于语音播报准确扩展 +} + +message VoiceEventReport { + required string src = 1; //语音事件来源,填写模块名称,rosnode 填写node名称即可 + repeated VoiceEventItems items = 2; //语音事件列表,当前模块的需要播报的行为列表 + optional Location curLocation = 3; //事件上报时候,车辆当前位置 + optional uint64 millisecond = 4; //毫秒时间戳 +} + diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java index 853b0f0bff..497be10369 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java @@ -63,6 +63,7 @@ import prediction2025.Prediction2025; import record_cache.RecordPanelOuterClass; import system_master.SsmInfo; import system_master.SystemStatusInfo; +import taskmgr.TmInfo; import vllm.Vlm; /** @@ -809,16 +810,20 @@ public interface OnAdasListener { */ void onAdasTaskManagerOriginal(@NonNull MessagePad.Header header, @NonNull String data); + /** + * 域控任务管理站点停车原始数据 + * + * @param header 头 + * @param data 数据 + */ + void onAdasTaskManagerStationStopOriginal(@NonNull MessagePad.Header header, @NonNull String data); + + /** * 域控任务管理离站通知 * * @param taskId - * @param siteId - * @param sequence - * @param ack - * @param reason - * @param stationTimeLeft - * @param closeDoorStartAuto + * @param taskStartNotification */ void onAdasTaskManagerDeparture(Long taskId, TaskStartNotification taskStartNotification); @@ -826,9 +831,7 @@ public interface OnAdasListener { * 域控任务管理到站通知 * * @param taskId 任务ID, 同原接口的orderid, 首次和头部校验 - * @param siteId 站点编号,对应云平台固定值 - * @param sequence 站点序号,对应顺序列表里站点流程,从1开始,1为起始点,最大值为终点。 途径点填写0 - * @param mileage 任务全程的已经行进的里程 + * @param taskArrivalNotification 到站信息 */ void onAdasTaskManagerArrival(Long taskId, TaskArrivalNotification taskArrivalNotification); @@ -852,6 +855,12 @@ public interface OnAdasListener { */ void onAdasTaskManagerRunning(Long taskId, Long lineId, TaskLocationQueryResponse taskLocationQueryResponse); + + /** + * + * @param stationStopInfo 到站的信息 + */ + void onAdasTaskManagerStationStop(TmInfo.StationStopInfo stationStopInfo); /** * 是否有能力启动自动驾驶 * diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/MyMessageFactory.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/MyMessageFactory.java index 9816fc518a..bcd69b9715 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/MyMessageFactory.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/MyMessageFactory.java @@ -66,6 +66,7 @@ public class MyMessageFactory implements IMyMessageFactory { private IMsg planningStopLineMessage;//决策停止线 private IMsg fSMEventMessage;//FSM事件 private IMsg taskMgrAndPadMessage;//任务管理消息 + private IMsg taskMgrAndPadStationStopMessage;//任务管理消息 private final AutopilotReview autopilotReview; private final TurnLightState lightLeft = new TurnLightState(); @@ -388,6 +389,12 @@ public class MyMessageFactory implements IMyMessageFactory { fSMEventMessage = new FSMEventMessage(); } return fSMEventMessage; + } else if (messageType == MessageType.TYPE_RECEIVE_TASK_MANAGER_StationStop.typeCode) { + //任务管理消息发出的站点停车 + if (taskMgrAndPadStationStopMessage == null) { + taskMgrAndPadStationStopMessage = new TaskManagerStationStopMessage(); + } + return taskMgrAndPadStationStopMessage; } else if (messageType == MessageType.TYPE_RECEIVE_TASK_MANAGER.typeCode) { //任务管理消息 if (taskMgrAndPadMessage == null) { diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/TaskManagerStationStopMessage.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/TaskManagerStationStopMessage.java new file mode 100644 index 0000000000..699602a9ce --- /dev/null +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/TaskManagerStationStopMessage.java @@ -0,0 +1,36 @@ +package com.zhidao.support.adas.high.msg; + +import android.util.Log; + +import com.google.protobuf.InvalidProtocolBufferException; +import com.zhidao.support.adas.high.AdasChannel; +import com.zhidao.support.adas.high.OnAdasListener; +import com.zhidao.support.adas.high.protocol.RawData; + +import taskmgr.TmInfo; + +/** + * 任务管理消息 + */ +public class TaskManagerStationStopMessage extends MyAbstractMessageHandler { + private static final String TAG = TaskManagerStationStopMessage.class.getSimpleName(); + + public TaskManagerStationStopMessage() { + } + + @Override + public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException { + TmInfo.StationStopInfo stationStopInfo = TmInfo.StationStopInfo.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue()); + AdasChannel.calculateTimeConsumingOnDispatchRaw("底盘信息", raw.receiveTime); + long nowTime = 0; + adasListener.onAdasTaskManagerStationStop(stationStopInfo); + AdasChannel.calculateTimeConsumingBusiness("底盘信息", nowTime); + } + + private void parse(OnAdasListener adasListener, String data) { + Log.i(TAG, "任务管理接收原始数据=" + data); + + } + + +}