[minibus320][adas]添加SSM3.0版本兼容,增加MAP版本条件判断用于判断使用那个SSM版本
This commit is contained in:
@@ -54,11 +54,14 @@ message StatusInfo {
|
||||
optional DropTopic topic_drop_info=3; // topic 掉频信息, 如有掉频添加没有不添加
|
||||
optional string reserved = 4; // 用于表示idle模式,'idle' 表示idle模式 'work' 表示正常工作
|
||||
// add by liyl 20220907
|
||||
optional int32 pilot_mode = 5; // 0: manaul 1: autopilot 2: RemotePilot
|
||||
optional int32 pilot_mode = 5; // 0: manaul 1: autopilot 6: RemotePilot
|
||||
optional string map_version = 6; // MAP 版本信息
|
||||
optional string master_version = 7; // system_master 版本信息
|
||||
optional bool auto_pilot_ready = 8; // 自动驾驶状态就绪, 20221111增加
|
||||
optional bool remote_pilot_ready = 9; // 平行驾驶状态就绪
|
||||
optional NodeFaultList auto_pilot_unready_list = 10; //20221128 增加
|
||||
optional NodeFaultList remote_pilot_unready_list = 11; //20221128 增加
|
||||
optional NodeFaultList auto_pilot_unready_list = 10; //自驾未就绪节点列表, 20221128 增加
|
||||
optional NodeFaultList remote_pilot_unready_list = 11; //平行驾驶未就绪列表, 20221128 增加
|
||||
optional string auto_pilot_unready_reason = 12; //自动驾驶状态未就绪原因描述
|
||||
optional string remote_pilot_unready_reason = 13; //平行驾驶状态未就绪原因描述
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import chassis.ChassisStatesOuterClass;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
/**
|
||||
* 是否可以启动自动驾驶能力检测 工控机版本>=250使用此类
|
||||
* 是否可以启动自动驾驶能力检测 非清扫车MAP版本>=250使用此类 清扫车MAP版本>=250&& <330使用此类
|
||||
* 目前监控了底盘的一些状态和查询节点状态应答的数据
|
||||
* 没有使用监控事件报告的原因是因为,部分异常没进行正常恢复通知,例如收到了异常监控数据,但是异常恢复之后没有恢复的通知
|
||||
* <p>
|
||||
@@ -27,8 +27,10 @@ public class AutopilotAbility250 {
|
||||
private static final String[] NODE_INFO_STATE = {"未知状态 ", "依赖未就绪 ", "启动中 ", "运行 ", "停止 ", "无法启动状态 ", "人为启动状态 ", "人为关闭状态 "};
|
||||
private volatile Timer timer;
|
||||
private ChassisStatesOuterClass.ChassisStates chassisStates;
|
||||
private int mapVersion = -1;//工控机版本
|
||||
|
||||
public AutopilotAbility250() {
|
||||
public AutopilotAbility250(int mapVersion) {
|
||||
this.mapVersion = mapVersion;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,8 +57,13 @@ public class AutopilotAbility250 {
|
||||
String masterVersion = statusInfo.getMasterVersion();
|
||||
version = AdasManager.getInstance().parseVersion(false, masterVersion);
|
||||
}
|
||||
//如果 maser version 大于1,还需要判断AutoPilotReady字段是否存在,以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
|
||||
if (version > 1 && statusInfo.hasAutoPilotReady()) {
|
||||
//SSM 3版本兼容
|
||||
if (mapVersion >= 30400 && version > 2 && statusInfo.hasAutoPilotReady() && statusInfo.hasAutoPilotUnreadyReason()) {
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
if (!isAutopilotAbility) {
|
||||
unableAutopilotReason = statusInfo.getAutoPilotUnreadyReason();
|
||||
}
|
||||
} else if (mapVersion >= 21000 && version > 1 && statusInfo.hasAutoPilotReady()) {//如果 maser version 大于1,还需要判断AutoPilotReady字段是否存在,以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
if (!isAutopilotAbility) {
|
||||
SystemStatusInfo.NodeFaultList nodeFaultList = statusInfo.getAutoPilotUnreadyList();
|
||||
|
||||
@@ -30,7 +30,8 @@ public class AutopilotAbilityManager {
|
||||
private OnAdasListener listener;
|
||||
private Handler handler;
|
||||
private OnAutopilotAbilityListener onAutopilotAbilityListener;
|
||||
private int dockerVersion = -1;//工控机版本
|
||||
private int mapVersion = -1;//工控机版本
|
||||
private boolean isFutianSweeper = false;//是否是福田清扫车
|
||||
private AutopilotAbility230 autopilotAbility230;
|
||||
private AutopilotAbility250 autopilotAbility250;
|
||||
private Timer startTimer;
|
||||
@@ -77,15 +78,12 @@ public class AutopilotAbilityManager {
|
||||
}
|
||||
|
||||
public void setCarConfig(MessagePad.CarConfigResp carConfig) {
|
||||
if (dockerVersion == -1) {
|
||||
String v = carConfig.getDockVersion();
|
||||
int version = AdasManager.getInstance().parseVersion(v);
|
||||
if (version != -1) {
|
||||
stopTimer();
|
||||
dockerVersion = version;
|
||||
CupidLogUtils.i(TAG, "工控机版本=" + dockerVersion);
|
||||
initAutopilotAbility();
|
||||
}
|
||||
mapVersion = carConfig.getMapVersion();
|
||||
isFutianSweeper = carConfig.getIsFutianSweeper();
|
||||
if (mapVersion != -1) {
|
||||
stopTimer();
|
||||
CupidLogUtils.i(TAG, "工控机版本=" + mapVersion);
|
||||
initAutopilotAbility();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,13 +136,15 @@ public class AutopilotAbilityManager {
|
||||
}
|
||||
|
||||
private void initAutopilotAbility() {
|
||||
if (dockerVersion >= 20500) {
|
||||
if (mapVersion >= 20500) {
|
||||
CupidLogUtils.i(TAG, "是否可以启动自动驾驶能力检测使用250版本");
|
||||
stop230();
|
||||
if (autopilotAbility250 == null) {
|
||||
autopilotAbility250 = new AutopilotAbility250();
|
||||
autopilotAbility250 = new AutopilotAbility250(mapVersion);
|
||||
autopilotAbility250.start();
|
||||
}
|
||||
} else {
|
||||
CupidLogUtils.i(TAG, "是否可以启动自动驾驶能力检测使用230版本");
|
||||
stop250();
|
||||
if (autopilotAbility230 == null) {
|
||||
autopilotAbility230 = new AutopilotAbility230();
|
||||
@@ -185,8 +185,8 @@ public class AutopilotAbilityManager {
|
||||
startTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (dockerVersion == -1 && AdasManager.getInstance().getIpcConnectionStatus() == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
dockerVersion = 20300;
|
||||
if (mapVersion == -1 && AdasManager.getInstance().getIpcConnectionStatus() == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
mapVersion = 20300;
|
||||
initAutopilotAbility();
|
||||
}
|
||||
}
|
||||
@@ -200,7 +200,8 @@ public class AutopilotAbilityManager {
|
||||
stop230();
|
||||
stop250();
|
||||
handler = null;
|
||||
dockerVersion = -1;
|
||||
mapVersion = -1;
|
||||
isFutianSweeper = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user