[610][adas]不能启动自驾或平行驾驶原因添加具体消息类型

This commit is contained in:
xinfengkun
2023-09-18 12:29:11 +08:00
parent 5cb034ff3e
commit 930d79f6fa
10 changed files with 72 additions and 51 deletions

View File

@@ -25,6 +25,7 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
list.add(
UnableLaunchReason(
UnableLaunchReason.SourceType.LIB,
UnableLaunchReason.UnableType.DISCONNECTED,
"未连接自动驾驶系统"
)
)

View File

@@ -26,6 +26,7 @@ object CallerParallelDrivingActionsListenerManager :
list.add(
UnableLaunchReason(
UnableLaunchReason.SourceType.LIB,
UnableLaunchReason.UnableType.DISCONNECTED,
"未连接自动驾驶系统"
)
)

View File

@@ -16,19 +16,38 @@ public class UnableLaunchReason {
FSM,
}
/**
* 影响启动自驾或启动平行驾驶的具体类型
*/
public enum UnableType {
DISCONNECTED,//未连接
INCOMPATIBLE,//版本不匹配,版本不兼容
SSM_ERROR,//SSM异常
FSM_ERROR,//FSM异常
BRAKE,//刹车
GEAR,//档位
PARKING_BRAKE,//制动系统,手刹,电子驻车制动系统
SSM_OFFER,//SSM提供的原因
FSM_OFFER//FSM提供的原因
}
/**
* 來源
*/
public final SourceType source;
/**
* 影响启动自驾或启动平行驾驶的具体类型
*/
public final UnableType unableType;
/**
* 具體原因
*/
public final String unableAutopilotReason;
public final String unableLaunchReason;
public UnableLaunchReason(SourceType source, String unableAutopilotReason) {
public UnableLaunchReason(SourceType source, UnableType unableType, String unableLaunchReason) {
this.source = source;
this.unableAutopilotReason = unableAutopilotReason;
this.unableType = unableType;
this.unableLaunchReason = unableLaunchReason;
}
@Override
@@ -36,16 +55,16 @@ public class UnableLaunchReason {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UnableLaunchReason that = (UnableLaunchReason) o;
return source == that.source && TextUtils.equals(unableAutopilotReason, that.unableAutopilotReason);
return source == that.source && TextUtils.equals(unableLaunchReason, that.unableLaunchReason);
}
@Override
public int hashCode() {
return Objects.hash(source, unableAutopilotReason);
return Objects.hash(source, unableLaunchReason);
}
@Override
public String toString() {
return "{原因:" + unableAutopilotReason + " 来源:" + source + "}";
return "{原因:" + unableLaunchReason + " 来源:" + source + "}";
}
}

View File

@@ -101,11 +101,11 @@ public class ParallelDrivingManager {
* @param unableParallelDrivingReason 云隐
* @return 原因列表
*/
public static ArrayList<UnableLaunchReason> addUnableParallelDrivingReason(ArrayList<UnableLaunchReason> unableParallelDrivingReasons, UnableLaunchReason.SourceType source, String unableParallelDrivingReason) {
public static ArrayList<UnableLaunchReason> addUnableParallelDrivingReason(ArrayList<UnableLaunchReason> unableParallelDrivingReasons, UnableLaunchReason.SourceType source, UnableLaunchReason.UnableType unableType, String unableParallelDrivingReason) {
if (unableParallelDrivingReasons == null) {
unableParallelDrivingReasons = new ArrayList<>();
}
unableParallelDrivingReasons.add(new UnableLaunchReason(source, unableParallelDrivingReason));
unableParallelDrivingReasons.add(new UnableLaunchReason(source, unableType, unableParallelDrivingReason));
return unableParallelDrivingReasons;
}
@@ -118,14 +118,14 @@ public class ParallelDrivingManager {
float brake = chassisStates.getBrakeSystemStates().getBrakePedalResponsePosition();
if (brake > 0) {
isParallelDrivingAbility = false;
unableParallelDrivingReasons = addUnableParallelDrivingReason(unableParallelDrivingReasons, UnableLaunchReason.SourceType.CHASSIS, "制动踏板被踩下");
unableParallelDrivingReasons = addUnableParallelDrivingReason(unableParallelDrivingReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.BRAKE, "制动踏板被踩下");
}
}
if (chassisStates.hasGearSystemStates()) {
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
if (!isLaunchAutopilot(gear)) {
isParallelDrivingAbility = false;
unableParallelDrivingReasons = addUnableParallelDrivingReason(unableParallelDrivingReasons, UnableLaunchReason.SourceType.CHASSIS, "档位异常");
unableParallelDrivingReasons = addUnableParallelDrivingReason(unableParallelDrivingReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.GEAR, "档位异常");
}
}
}
@@ -136,7 +136,7 @@ public class ParallelDrivingManager {
boolean isBrake = vehicleState.getParkingBrake();
if (isBrake) {
isParallelDrivingAbility = false;
unableParallelDrivingReasons = addUnableParallelDrivingReason(unableParallelDrivingReasons, UnableLaunchReason.SourceType.CHASSIS, "施加驻车");
unableParallelDrivingReasons = addUnableParallelDrivingReason(unableParallelDrivingReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.PARKING_BRAKE, "施加驻车");
}
}
}
@@ -166,7 +166,7 @@ public class ParallelDrivingManager {
}, 2000L, 1000L);//延迟执行,避免刚连接成功后底盘信息无法及时同步
}
} else {
callListener(false, addUnableParallelDrivingReason(null, UnableLaunchReason.SourceType.LIB, "当前域控版本无法通过鹰眼启动平行驾驶"));
callListener(false, addUnableParallelDrivingReason(null, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.INCOMPATIBLE, "当前域控版本无法通过鹰眼启动平行驾驶"));
}
}

View File

@@ -46,14 +46,14 @@ public class AutopilotAbility230 {
float brake = chassisStates.getBrakeSystemStates().getBrakePedalResponsePosition();
if (brake > 0) {
isAutopilotAbility = false;
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, "制动踏板被踩下");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.BRAKE, "制动踏板被踩下");
}
}
if (chassisStates.hasGearSystemStates()) {
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
if (!AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear)) {
isAutopilotAbility = false;
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, "档位异常");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.GEAR, "档位异常");
}
}
//TODO 关于手刹:不同车型的实现不同所以目前没法使用此字段

View File

@@ -81,7 +81,7 @@ public class AutopilotAbility250 {
if (mapVersion >= 30400 && masterVersion > 2 && statusInfo.hasAutoPilotReady() && statusInfo.hasAutoPilotUnreadyReason()) {
isAutopilotAbility = statusInfo.getAutoPilotReady();
if (!isAutopilotAbility) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, statusInfo.getAutoPilotUnreadyReason());
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_OFFER, statusInfo.getAutoPilotUnreadyReason());
}
} else if (mapVersion >= 21000 && masterVersion > 1 && statusInfo.hasAutoPilotReady()) {//如果 maser version 大于1还需要判断AutoPilotReady字段是否存在以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
isAutopilotAbility = statusInfo.getAutoPilotReady();
@@ -93,13 +93,13 @@ public class AutopilotAbility250 {
String nodeName = info.getNodeName();
int state = info.getState();
if (state < AutopilotAbilityManager.NODE_INFO_STATE.length) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, nodeName + AutopilotAbilityManager.NODE_INFO_STATE[state]);
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_OFFER, nodeName + AutopilotAbilityManager.NODE_INFO_STATE[state]);
} else {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, nodeName + "未知异常");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_ERROR, nodeName + "未知异常");
}
}
} else {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, "未知异常节点");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_ERROR, "未知异常节点");
}
}
} else {
@@ -130,13 +130,13 @@ public class AutopilotAbility250 {
unableAutopilotReason = "未知系统状态";
}
if (!isAutopilotAbility) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, unableAutopilotReason);
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_OFFER, unableAutopilotReason);
}
}
}
} else {
isAutopilotAbility = false;//是否能启动自动驾驶
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, "SSM状态查询超时无响应");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.SSM_ERROR, "SSM状态查询超时无响应");
}
//检测底盘相关
if (chassisStates != null) {
@@ -144,14 +144,14 @@ public class AutopilotAbility250 {
float brake = chassisStates.getBrakeSystemStates().getBrakePedalResponsePosition();
if (brake > 0) {
isAutopilotAbility = false;
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, "制动踏板被踩下");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.BRAKE, "制动踏板被踩下");
}
}
if (chassisStates.hasGearSystemStates()) {
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
if (!AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear)) {
isAutopilotAbility = false;
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, "档位异常");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.GEAR, "档位异常");
}
}
}
@@ -163,7 +163,7 @@ public class AutopilotAbility250 {
boolean isBrake = vehicleState.getParkingBrake();
if (isBrake) {
isAutopilotAbility = false;
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, "施加驻车");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.PARKING_BRAKE, "施加驻车");
}
}
}

View File

@@ -74,7 +74,7 @@ public class AutopilotAbility330 {
if (mapVersion >= 30400 && masterVersion > 2 && statusInfo.hasAutoPilotReady() && statusInfo.hasAutoPilotUnreadyReason()) {
isAutopilotAbility = statusInfo.getAutoPilotReady();
if (!isAutopilotAbility) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, statusInfo.getAutoPilotUnreadyReason());
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_OFFER, statusInfo.getAutoPilotUnreadyReason());
}
} else if (mapVersion >= 21000 && masterVersion > 1 && statusInfo.hasAutoPilotReady()) {//如果 maser version 大于1还需要判断AutoPilotReady字段是否存在以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
isAutopilotAbility = statusInfo.getAutoPilotReady();
@@ -86,13 +86,13 @@ public class AutopilotAbility330 {
String nodeName = info.getNodeName();
int state = info.getState();
if (state < AutopilotAbilityManager.NODE_INFO_STATE.length) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, nodeName + AutopilotAbilityManager.NODE_INFO_STATE[state]);
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_OFFER, nodeName + AutopilotAbilityManager.NODE_INFO_STATE[state]);
} else {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, nodeName + "未知异常");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_ERROR, nodeName + "未知异常");
}
}
} else {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, "未知异常节点");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_ERROR, "未知异常节点");
}
}
} else {
@@ -123,13 +123,13 @@ public class AutopilotAbility330 {
unableAutopilotReason = "未知系统状态";
}
if (!isAutopilotAbility) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, unableAutopilotReason);
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_OFFER, unableAutopilotReason);
}
}
}
} else {
isAutopilotAbility = false;//是否能启动自动驾驶
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, "SSM状态查询超时无响应");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.SSM_ERROR, "SSM状态查询超时无响应");
}
if (fsmStatusReasonRespond != null) {
int count = fsmStatusReasonRespond.getFsmStatusReasonRespondCount();
@@ -138,11 +138,11 @@ public class AutopilotAbility330 {
for (int i = 0; i < count; i++) {
String respond = fsmStatusReasonRespond.getFsmStatusReasonRespond(i);
if (!TextUtils.isEmpty(respond)) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.FSM, respond);
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.FSM, UnableLaunchReason.UnableType.FSM_OFFER, respond);
}
}
if (unableAutopilotReasons == null || unableAutopilotReasons.isEmpty()) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, "FSM数据异常");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.FSM_ERROR, "FSM数据异常");
}
}
}

View File

@@ -69,7 +69,7 @@ public class AutopilotAbility350And360 {
if (masterVersion > 2 && statusInfo.hasAutoPilotReady() && statusInfo.hasAutoPilotUnreadyReason()) {
isAutopilotAbility = statusInfo.getAutoPilotReady();
if (!isAutopilotAbility) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, statusInfo.getAutoPilotUnreadyReason());
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_OFFER, statusInfo.getAutoPilotUnreadyReason());
}
} else if (masterVersion > 1 && statusInfo.hasAutoPilotReady()) {//如果 maser version 大于1还需要判断AutoPilotReady字段是否存在以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
isAutopilotAbility = statusInfo.getAutoPilotReady();
@@ -81,13 +81,13 @@ public class AutopilotAbility350And360 {
String nodeName = info.getNodeName();
int state = info.getState().getNumber();
if (state < AutopilotAbilityManager.NODE_INFO_STATE_FIXED_FREQUENCY.length) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, nodeName + AutopilotAbilityManager.NODE_INFO_STATE_FIXED_FREQUENCY[state]);
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_OFFER, nodeName + AutopilotAbilityManager.NODE_INFO_STATE_FIXED_FREQUENCY[state]);
} else {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, nodeName + "未知异常");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_ERROR, nodeName + "未知异常");
}
}
} else {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, "未知异常节点");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_ERROR, "未知异常节点");
}
}
} else {
@@ -106,12 +106,12 @@ public class AutopilotAbility350And360 {
} else {
unableAutopilotReason = "未知系统模式";
}
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, unableAutopilotReason);
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_OFFER, unableAutopilotReason);
}
}
} else {
isAutopilotAbility = false;//是否能启动自动驾驶
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, "SSM数据异常");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.SSM_ERROR, "SSM状态查询超时无响应");
}
//检测底盘相关
if (chassisStates != null) {
@@ -119,14 +119,14 @@ public class AutopilotAbility350And360 {
float brake = chassisStates.getBrakeSystemStates().getBrakePedalResponsePosition();
if (brake > 0) {
isAutopilotAbility = false;
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, "制动踏板被踩下");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.BRAKE, "制动踏板被踩下");
}
}
if (chassisStates.hasGearSystemStates()) {
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
if (!AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear)) {
isAutopilotAbility = false;
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, "档位异常");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.GEAR, "档位异常");
}
}
}
@@ -138,7 +138,7 @@ public class AutopilotAbility350And360 {
boolean isBrake = vehicleState.getParkingBrake();
if (isBrake) {
isAutopilotAbility = false;
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, "施加驻车");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.PARKING_BRAKE, "施加驻车");
}
}
}

View File

@@ -59,7 +59,7 @@ public class AutopilotAbility360 {
if (masterVersion > 2 && statusInfo.hasAutoPilotReady() && statusInfo.hasAutoPilotUnreadyReason()) {
isAutopilotAbility = statusInfo.getAutoPilotReady();
if (!isAutopilotAbility) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, statusInfo.getAutoPilotUnreadyReason());
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_OFFER, statusInfo.getAutoPilotUnreadyReason());
}
} else if (masterVersion > 1 && statusInfo.hasAutoPilotReady()) {//如果 maser version 大于1还需要判断AutoPilotReady字段是否存在以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
isAutopilotAbility = statusInfo.getAutoPilotReady();
@@ -71,13 +71,13 @@ public class AutopilotAbility360 {
String nodeName = info.getNodeName();
int state = info.getState().getNumber();
if (state < AutopilotAbilityManager.NODE_INFO_STATE_FIXED_FREQUENCY.length) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, nodeName + AutopilotAbilityManager.NODE_INFO_STATE_FIXED_FREQUENCY[state]);
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_OFFER, nodeName + AutopilotAbilityManager.NODE_INFO_STATE_FIXED_FREQUENCY[state]);
} else {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, nodeName + "未知异常");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_ERROR, nodeName + "未知异常");
}
}
} else {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, "未知异常节点");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_ERROR, "未知异常节点");
}
}
} else {
@@ -96,12 +96,12 @@ public class AutopilotAbility360 {
} else {
unableAutopilotReason = "未知系统模式";
}
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, unableAutopilotReason);
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.SSM, UnableLaunchReason.UnableType.SSM_OFFER, unableAutopilotReason);
}
}
} else {
isAutopilotAbility = false;//是否能启动自动驾驶
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, "SSM数据异常");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.SSM_ERROR, "SSM状态查询超时无响应");
}
if (fsmStatusReasonRespond != null) {
int count = fsmStatusReasonRespond.getFsmStatusReasonRespondCount();
@@ -110,11 +110,11 @@ public class AutopilotAbility360 {
for (int i = 0; i < count; i++) {
String respond = fsmStatusReasonRespond.getFsmStatusReasonRespond(i);
if (!TextUtils.isEmpty(respond)) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.FSM, respond);
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.FSM, UnableLaunchReason.UnableType.FSM_OFFER, respond);
}
}
if (unableAutopilotReasons == null || unableAutopilotReasons.isEmpty()) {
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, "FSM数据异常");
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.LIB, UnableLaunchReason.UnableType.FSM_ERROR, "FSM数据异常");
}
}
}

View File

@@ -108,11 +108,11 @@ public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotA
* @param unableAutopilotReason 云隐
* @return 原因列表
*/
protected ArrayList<UnableLaunchReason> addUnableAutopilotReason(ArrayList<UnableLaunchReason> unableAutopilotReasons, UnableLaunchReason.SourceType source, String unableAutopilotReason) {
protected ArrayList<UnableLaunchReason> addUnableAutopilotReason(ArrayList<UnableLaunchReason> unableAutopilotReasons, UnableLaunchReason.SourceType source, UnableLaunchReason.UnableType unableType, String unableAutopilotReason) {
if (unableAutopilotReasons == null) {
unableAutopilotReasons = new ArrayList<>();
}
unableAutopilotReasons.add(new UnableLaunchReason(source, unableAutopilotReason));
unableAutopilotReasons.add(new UnableLaunchReason(source, unableType, unableAutopilotReason));
return unableAutopilotReasons;
}