[3.3.0][mogo-adas]修复Maser版本解析引起的崩溃异常
This commit is contained in:
@@ -3,6 +3,7 @@ package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
import android.os.Message;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
@@ -27,10 +28,12 @@ public class AutopilotAbility250 {
|
||||
private static final String[] NODE_INFO_STATE = {"未知状态 ", "依赖未就绪 ", "启动中 ", "运行 ", "停止 ", "无法启动状态 ", "人为启动状态 ", "人为关闭状态 "};
|
||||
private volatile Timer timer;
|
||||
private ChassisStatesOuterClass.ChassisStates chassisStates;
|
||||
private int mapVersion = -1;//工控机版本
|
||||
private int mapVersion = -1;//MAP版本
|
||||
private int masterVersion = -1;//Master版本
|
||||
|
||||
public AutopilotAbility250(int mapVersion) {
|
||||
this.mapVersion = mapVersion;
|
||||
this.masterVersion = -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,19 +54,18 @@ public class AutopilotAbility250 {
|
||||
String unableAutopilotReason = null;//不能启动自动驾驶原因
|
||||
//检测节点状态相关
|
||||
if (statusInfo != null) {
|
||||
int version = -1;
|
||||
if (statusInfo.hasMasterVersion()) {
|
||||
if (masterVersion == -1 && statusInfo.hasMasterVersion()) {
|
||||
//截取Master Version
|
||||
String masterVersion = statusInfo.getMasterVersion();
|
||||
version = AdasManager.getInstance().parseVersion(false, masterVersion);
|
||||
masterVersion = AdasManager.getInstance().parseVersion(false, statusInfo.getMasterVersion());
|
||||
}
|
||||
CupidLogUtils.i(TAG, "MasterVersion=" + masterVersion);
|
||||
//SSM 3版本兼容
|
||||
if (mapVersion >= 30400 && version > 2 && statusInfo.hasAutoPilotReady() && statusInfo.hasAutoPilotUnreadyReason()) {
|
||||
if (mapVersion >= 30400 && masterVersion > 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版本不陪配情况逻辑能正常执行
|
||||
} else if (mapVersion >= 21000 && masterVersion > 1 && statusInfo.hasAutoPilotReady()) {//如果 maser version 大于1,还需要判断AutoPilotReady字段是否存在,以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
if (!isAutopilotAbility) {
|
||||
SystemStatusInfo.NodeFaultList nodeFaultList = statusInfo.getAutoPilotUnreadyList();
|
||||
@@ -176,6 +178,7 @@ public class AutopilotAbility250 {
|
||||
timer = null;
|
||||
}
|
||||
this.chassisStates = null;
|
||||
this.masterVersion = -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import android.os.Message;
|
||||
|
||||
import com.google.protobuf.TextFormat;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
@@ -29,8 +29,12 @@ public class AutopilotAbility330 {
|
||||
private volatile Timer timer;
|
||||
|
||||
private volatile FSMStatusReasonQueryOuterClass.FSMStatusReasonRespond fsmStatusReasonRespond;//自动驾驶状态为OFF的原因
|
||||
private int mapVersion = -1;//MAP版本
|
||||
private int masterVersion = -1;//Master版本
|
||||
|
||||
public AutopilotAbility330() {
|
||||
public AutopilotAbility330(int mapVersion) {
|
||||
this.mapVersion = mapVersion;
|
||||
this.masterVersion = -1;
|
||||
}
|
||||
|
||||
public synchronized void setFsmStatusReasonRespond(FSMStatusReasonQueryOuterClass.FSMStatusReasonRespond fsmStatusReasonRespond) {
|
||||
@@ -51,19 +55,18 @@ public class AutopilotAbility330 {
|
||||
String unableAutopilotReason = null;//不能启动自动驾驶原因
|
||||
//检测节点状态相关
|
||||
if (statusInfo != null) {
|
||||
int version = -1;
|
||||
if (statusInfo.hasMasterVersion()) {
|
||||
if (masterVersion == -1 && statusInfo.hasMasterVersion()) {
|
||||
//截取Master Version
|
||||
String masterVersion = statusInfo.getMasterVersion();
|
||||
version = AdasManager.getInstance().parseVersion(false, masterVersion);
|
||||
masterVersion = AdasManager.getInstance().parseVersion(false, statusInfo.getMasterVersion());
|
||||
}
|
||||
CupidLogUtils.i(TAG, "MasterVersion=" + masterVersion);
|
||||
//SSM 3版本兼容
|
||||
if (version > 2 && statusInfo.hasAutoPilotReady() && statusInfo.hasAutoPilotUnreadyReason()) {
|
||||
if (mapVersion >= 30400 && masterVersion > 2 && statusInfo.hasAutoPilotReady() && statusInfo.hasAutoPilotUnreadyReason()) {
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
if (!isAutopilotAbility) {
|
||||
unableAutopilotReason = statusInfo.getAutoPilotUnreadyReason();
|
||||
}
|
||||
} else if (version > 1 && statusInfo.hasAutoPilotReady()) {//如果 maser version 大于1,还需要判断AutoPilotReady字段是否存在,以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
|
||||
} else if (mapVersion >= 21000 && masterVersion > 1 && statusInfo.hasAutoPilotReady()) {//如果 maser version 大于1,还需要判断AutoPilotReady字段是否存在,以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
if (!isAutopilotAbility) {
|
||||
SystemStatusInfo.NodeFaultList nodeFaultList = statusInfo.getAutoPilotUnreadyList();
|
||||
@@ -162,6 +165,7 @@ public class AutopilotAbility330 {
|
||||
timer.cancel();
|
||||
timer = null;
|
||||
}
|
||||
this.masterVersion = -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ public class AutopilotAbilityManager {
|
||||
stop230();
|
||||
stop250();
|
||||
if (autopilotAbility330 == null) {
|
||||
autopilotAbility330 = new AutopilotAbility330();
|
||||
autopilotAbility330 = new AutopilotAbility330(mapVersion);
|
||||
autopilotAbility330.start();
|
||||
}
|
||||
} else if (mapVersion >= 20500) {
|
||||
@@ -243,6 +243,7 @@ public class AutopilotAbilityManager {
|
||||
stopTimer();
|
||||
stop230();
|
||||
stop250();
|
||||
stop330();
|
||||
handler = null;
|
||||
mapVersion = -1;
|
||||
isFutianSweeper = false;
|
||||
|
||||
Reference in New Issue
Block a user