[610][adas]新增故障管理(FM)接口;修改底盘数据来源字段;新增SSM来源字段
This commit is contained in:
@@ -68,6 +68,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import fault_management.FmInfo
|
||||
import function_state_management.FunctionStates
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
@@ -447,6 +448,10 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
invokeSystemStatus(statusInf)
|
||||
}
|
||||
|
||||
override fun onFaultManagementState(header: MessagePad.Header?, fmInfo: FmInfo.FaultResultMsg) {
|
||||
CallerFaultManagementStateListenerManager.invokeFaultManagementState(fmInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据采集配置应答
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot
|
||||
|
||||
import fault_management.FmInfo
|
||||
|
||||
/**
|
||||
* 故障管理(FM)接口
|
||||
*/
|
||||
interface IMoGoFaultManagementStateListener {
|
||||
|
||||
fun onFaultManagementState(fmInfo: FmInfo.FaultResultMsg)
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoFaultManagementStateListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import fault_management.FmInfo
|
||||
|
||||
/**
|
||||
* 故障管理(FM)接口
|
||||
*/
|
||||
object CallerFaultManagementStateListenerManager : CallerBase<IMoGoFaultManagementStateListener>() {
|
||||
|
||||
/**
|
||||
* 后摄像头视频数据
|
||||
*/
|
||||
fun invokeFaultManagementState(fmInfo: FmInfo.FaultResultMsg) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onFaultManagementState(fmInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
40
libraries/mogo-adas-data/src/main/proto/fm_info.proto
Normal file
40
libraries/mogo-adas-data/src/main/proto/fm_info.proto
Normal file
@@ -0,0 +1,40 @@
|
||||
syntax = "proto2";
|
||||
|
||||
package fault_management;
|
||||
|
||||
|
||||
message FaultInfo {
|
||||
required string fault_id = 1; //故障标识,每个告警有一个全域唯一的标识
|
||||
required uint64 fault_time = 2; //故障确认上报时间,毫秒单位
|
||||
optional string fault_desc = 3; //故障的补充描述,由模块补充上报信息,上报段自定义
|
||||
optional string fault_level = 4; //原有预留字段,故障上报不需要填,故障状态发布时由fm根据配置填入 故障健康等级
|
||||
repeated string fault_action = 5; //新增故障处理方法,故障上报不需要填,故障状态发布时由fm根据配置填入, 用于故障上报给pad 云控处理, 需要和产品,pad端沟通定义,罗列定义值
|
||||
repeated string fault_result = 6; //新增故障后果,故障上报不需要填,故障状态发布时由fm根据配置表填入, 用于行为上层的禁止
|
||||
optional string policy_code = 7; //新增故障策略,故障上报不需要填,故障表中所定义的故障策略
|
||||
optional string fault_name = 8; //新增故障名称,故障上报不需要填,故障表中定义的故障中文名称
|
||||
}
|
||||
|
||||
enum FaultLevel {
|
||||
NOTHING_TODO = 0; //不采用故障等级策略
|
||||
EMERGENCY_STOP = 1; //紧急停车
|
||||
COMFORTABLE_SLOW_STOP = 2; //舒适减速停车
|
||||
COMFORTABLE_PULL_OVER = 3; //舒适靠边停车
|
||||
REDUCE_SPEED = 4; //减速行驶 低于10km/小时
|
||||
WARNING_ONLY = 5; //仅告警
|
||||
STATISTICS_INFO = 6; //仅做系统后台统计
|
||||
}
|
||||
|
||||
message FaultResultMsg {
|
||||
required uint64 time = 1; //故障策略输出时间,毫秒
|
||||
required FaultLevel level = 2; //故障汇总等级 (前期按等级处理)
|
||||
required uint32 fault_sum = 3; //故障总数
|
||||
repeated FaultInfo infos = 4; //故障消息详情
|
||||
required uint32 veh_policy =5; //车端降级策略 (360及之后弃用,兼容350策略定义)
|
||||
required bool planning_exec_pilocy_must = 6; //规划需要执行降级策略
|
||||
required bool controller_exec_pilocy_must = 7; //控制需要执行降级策略(true的情况,planning可能故障)
|
||||
optional string downgrade_policy_code = 8; //唯一故障策略描述,360后建议车型按该string类型区分 (云端,pad端按该字符串,总计8种,做分析处理)
|
||||
repeated string actions = 9; //所有当前存在故障的action 并集
|
||||
repeated string results = 10; //所有当前存在故障的 result 并集
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ enum MessageType
|
||||
MsgTypeBackCameraVideo = 0x1000d; //后部摄像头视频 10hz
|
||||
MsgTypeM1StitchedVideo = 0x1000e; //m1拼接视频 10hz
|
||||
MsgTypeSSMState = 0x1000f; //ssm 系统状态 1hz hq m1 MAP350开始支持,其他车型MAP360开始支持
|
||||
MsgTypeFMState = 0x10010; //FM状态 1hz bus和清扫车是MAP370开始支持,其他车型MAP360开始支持
|
||||
|
||||
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
|
||||
MsgTypeBasicInfoResp = 0x10101; //自动驾驶设备基础信息应答
|
||||
@@ -718,3 +719,5 @@ message SessionInfo
|
||||
//message definition for MsgTypeParallelDrivingCmd
|
||||
//查看云端和鹰眼的接口
|
||||
|
||||
//message definition for MsgTypeFMState
|
||||
//refer to fm_info.proto for details
|
||||
|
||||
@@ -21,3 +21,22 @@ enum MapSystemParamType{
|
||||
FUSION_MODE = 14;//融合模式(int) 1:全融合模式 2:盲区模式 3:超视距模式 4:透传模式 5:纯路侧模式,默认1 /telematics/fusion/fusion_mode
|
||||
}
|
||||
|
||||
/**
|
||||
* 底盘数据来源
|
||||
*/
|
||||
enum ChassisSource{
|
||||
CHASSIS_UNKNOWN = 0;//未知
|
||||
CHASSIS_VER1 = 1;//版本1(老底盘)
|
||||
CHASSIS_VER2 = 2;//版本2(新底盘)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* SSM数据来源
|
||||
*/
|
||||
enum SsmSource{
|
||||
SSM_UNKNOWN = 0;//未知
|
||||
SSM_VER1 = 1;//版本1(查询方式)
|
||||
SSM_VER2 = 2;//版本2(定频回调)
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,9 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
private final Map<MessagePad.MessageType, DispatchHandler> dispatchHandlers = new HashMap<>();//其他分发线程
|
||||
private Timer checkCompatibilityTimer;//检查版本兼容性定时器 连接成功后5秒内等待工控机发送配置信息
|
||||
private int seqSpecialVehicle = 0;//特种车辆命令发送次数
|
||||
private int usedChassisType = Constants.CHASSIS_TYPE.UNKNOWN;//使用的底盘类型 新老
|
||||
private AdasConstants.ChassisSource usedChassisSource = AdasConstants.ChassisSource.CHASSIS_UNKNOWN;//使用的底盘类型 新老
|
||||
private AdasConstants.SsmSource usedSsmSource = AdasConstants.SsmSource.SSM_UNKNOWN;//使用的SSM类型
|
||||
|
||||
/**
|
||||
* 与工控机链接状态
|
||||
*/
|
||||
@@ -317,8 +319,13 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUsedChassisType() {
|
||||
return usedChassisType;
|
||||
public AdasConstants.ChassisSource getUsedChassisSource() {
|
||||
return usedChassisSource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdasConstants.SsmSource getUsedSsmSource() {
|
||||
return usedSsmSource;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -403,12 +410,23 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
if (defaultDispatchHandler != null)
|
||||
defaultDispatchHandler.sendRawMessage(raw);
|
||||
}
|
||||
if (messageType == MessagePad.MessageType.MsgTypeVehicleState) {
|
||||
//老底盘接口
|
||||
usedChassisType = Constants.CHASSIS_TYPE.OLD_CHASSIS;
|
||||
} else if (messageType == MessagePad.MessageType.MsgTypeChassisStates) {
|
||||
//新底盘接口
|
||||
usedChassisType = Constants.CHASSIS_TYPE.NEW_CHASSIS;
|
||||
if (usedChassisSource == AdasConstants.ChassisSource.CHASSIS_UNKNOWN) {
|
||||
if (messageType == MessagePad.MessageType.MsgTypeVehicleState) {
|
||||
//老底盘接口
|
||||
usedChassisSource = AdasConstants.ChassisSource.CHASSIS_VER1;
|
||||
} else if (messageType == MessagePad.MessageType.MsgTypeChassisStates) {
|
||||
//新底盘接口
|
||||
usedChassisSource = AdasConstants.ChassisSource.CHASSIS_VER2;
|
||||
}
|
||||
}
|
||||
if (usedSsmSource == AdasConstants.SsmSource.SSM_UNKNOWN) {
|
||||
if (messageType == MessagePad.MessageType.MsgTypeStatusQueryResp) {
|
||||
//老SSM(查询方式)
|
||||
usedSsmSource = AdasConstants.SsmSource.SSM_VER1;
|
||||
} else if (messageType == MessagePad.MessageType.MsgTypeSSMState) {
|
||||
//新SSM(定频回调)
|
||||
usedSsmSource = AdasConstants.SsmSource.SSM_VER2;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
callError(raw.getProtocolStatus(), byteString.toByteArray());
|
||||
@@ -554,7 +572,8 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
ipcConnectedIp = null;
|
||||
ipcConnectedPort = Constants.DEFAULT_PORT;
|
||||
subscribeInterface = null;
|
||||
usedChassisType = Constants.CHASSIS_TYPE.UNKNOWN;
|
||||
usedChassisSource = AdasConstants.ChassisSource.CHASSIS_UNKNOWN;
|
||||
usedSsmSource = AdasConstants.SsmSource.SSM_UNKNOWN;
|
||||
updateConnectStatus(Constants.IPC_CONNECTION_STATUS.DISCONNECTED, t == null ? "" : t);
|
||||
}
|
||||
|
||||
|
||||
@@ -276,13 +276,23 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取使用底盘的类型
|
||||
* 获取使用底盘的来源
|
||||
*
|
||||
* @return {@link Constants.CHASSIS_TYPE}
|
||||
* @return {@link AdasConstants.ChassisSource}
|
||||
*/
|
||||
@Override
|
||||
public int getUsedChassisType() {
|
||||
return mChannel == null ? Constants.CHASSIS_TYPE.UNKNOWN : mChannel.getUsedChassisType();
|
||||
public AdasConstants.ChassisSource getUsedChassisSource() {
|
||||
return mChannel == null ? AdasConstants.ChassisSource.CHASSIS_UNKNOWN : mChannel.getUsedChassisSource();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取使用SSM的来源
|
||||
*
|
||||
* @return {@link AdasConstants.SsmSource}
|
||||
*/
|
||||
@Override
|
||||
public AdasConstants.SsmSource getUsedSsmSource() {
|
||||
return mChannel == null ? AdasConstants.SsmSource.SSM_UNKNOWN : mChannel.getUsedSsmSource();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -70,11 +70,18 @@ public interface IAdasNetCommApi {
|
||||
int getIpcConnectedPort();
|
||||
|
||||
/**
|
||||
* 获取使用底盘的类型
|
||||
* 获取使用底盘的来源
|
||||
*
|
||||
* @return {@link Constants.CHASSIS_TYPE}
|
||||
* @return {@link AdasConstants.ChassisSource}
|
||||
*/
|
||||
int getUsedChassisType();
|
||||
AdasConstants.ChassisSource getUsedChassisSource();
|
||||
|
||||
/**
|
||||
* 获取使用SSM的来源
|
||||
*
|
||||
* @return {@link AdasConstants.SsmSource}
|
||||
*/
|
||||
AdasConstants.SsmSource getUsedSsmSource();
|
||||
|
||||
/**
|
||||
* 自动驾驶设备基础信息应答
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.util.ArrayList;
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import chassis.VehicleStateOuterClass;
|
||||
import fault_management.FmInfo;
|
||||
import function_state_management.FunctionStates;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo.v2x.MogoV2X;
|
||||
@@ -212,6 +213,14 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onSystemStatus(MessagePad.Header header, SsmInfo.SsmStatusInf statusInf);
|
||||
|
||||
/**
|
||||
* 故障管理(FM)接口
|
||||
*
|
||||
* @param header 头
|
||||
* @param fmInfo 数据
|
||||
*/
|
||||
void onFaultManagementState(MessagePad.Header header, @NonNull FmInfo.FaultResultMsg fmInfo);
|
||||
|
||||
/**
|
||||
* 数据采集配置应答
|
||||
*
|
||||
|
||||
@@ -111,16 +111,6 @@ public class Constants {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 使用底盘数据类型
|
||||
*/
|
||||
public interface CHASSIS_TYPE {
|
||||
int UNKNOWN = -1;//未知
|
||||
int NEW_CHASSIS = 0;//新底盘
|
||||
int OLD_CHASSIS = 1;//老底盘
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 启动自动驾驶-Source类型
|
||||
*/
|
||||
|
||||
@@ -31,6 +31,7 @@ public enum MessageType {
|
||||
TYPE_RECEIVE_BACK_CAMERA_VIDEO(MessagePad.MessageType.MsgTypeBackCameraVideo, "后摄像头"),
|
||||
TYPE_RECEIVE_M1_STITCHED_VIDEO(MessagePad.MessageType.MsgTypeM1StitchedVideo, "M1拼接视频"),
|
||||
TYPE_RECEIVE_SSM(MessagePad.MessageType.MsgTypeSSMState, "SSM系统状态"),
|
||||
TYPE_RECEIVE_FM_STATE(MessagePad.MessageType.MsgTypeFMState, "FM状态"),
|
||||
|
||||
TYPE_RECEIVE_BASIC_INFO_REQ(MessagePad.MessageType.MsgTypeBasicInfoReq, "自动驾驶设备基础信息请求"),
|
||||
TYPE_SEND_BASIC_INFO_RESP(MessagePad.MessageType.MsgTypeBasicInfoResp, "自动驾驶设备基础信息应答"),
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
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.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import fault_management.FmInfo;
|
||||
|
||||
/**
|
||||
* 故障管理(FM)接口
|
||||
*/
|
||||
public class FaultManagementMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
FmInfo.FaultResultMsg fmInfo = FmInfo.FaultResultMsg.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("FM状态", raw.receiveTime);
|
||||
long nowTime = 0;
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
adasListener.onFaultManagementState(raw.getHeader(), fmInfo);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("FM状态", nowTime);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,6 +31,7 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg arrivalNotificationMessage;//到站提醒
|
||||
private IMsg statusQueryRespMessage;//状态查询应答
|
||||
private IMsg systemStatusMessage;//定频SSM
|
||||
private IMsg faultManagementMessage;//FM状态
|
||||
private IMsg recordDataConfigRespMessage;//数据采集配置应答
|
||||
private IMsg planningDecisionStateMessage;//planning决策状态
|
||||
private IMsg obuWarningDataMessage;//工控机透传OBU V2I数据
|
||||
@@ -168,6 +169,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
systemStatusMessage = new SystemStatusMessage();
|
||||
}
|
||||
return systemStatusMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_FM_STATE.typeCode) {
|
||||
//FM状态
|
||||
if (faultManagementMessage == null) {
|
||||
faultManagementMessage = new FaultManagementMessage();
|
||||
}
|
||||
return faultManagementMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP.typeCode) {
|
||||
//数据采集配置应答
|
||||
if (recordDataConfigRespMessage == null) {
|
||||
|
||||
Reference in New Issue
Block a user