From d8c0cf095a68088bd6808f73f00d6c12e60bd9f3 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Thu, 16 Nov 2023 14:39:33 +0800 Subject: [PATCH] =?UTF-8?q?[620][adas]=20=E6=9B=B4=E6=8D=A2=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=90=AF=E5=8A=A8=E8=87=AA=E9=A9=BE=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../high/common/autopilot/ability/AutopilotAbility230.java | 4 ++-- .../high/common/autopilot/ability/AutopilotAbility250.java | 6 +++--- .../common/autopilot/ability/AutopilotAbility350And360.java | 6 +++--- .../common/autopilot/ability/AutopilotAbilityManager.java | 3 +++ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility230.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility230.java index 3b049f2374..8414533e3c 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility230.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility230.java @@ -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, UnableLaunchReason.UnableType.BRAKE, "制动踏板被踩下"); + unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.BRAKE, AutopilotAbilityManager.REASON_CHASSIS_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, UnableLaunchReason.UnableType.GEAR, "档位异常"); + unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.GEAR, AutopilotAbilityManager.REASON_CHASSIS_GEAR); } } //TODO 关于手刹:不同车型的实现不同所以目前没法使用此字段 diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java index f2eaa0d3dc..d818fedbaf 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java @@ -146,14 +146,14 @@ public class AutopilotAbility250 { float brake = chassisStates.getBrakeSystemStates().getBrakePedalResponsePosition(); if (brake > 0) { isAutopilotAbility = false; - unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.BRAKE, "制动踏板被踩下"); + unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.BRAKE, AutopilotAbilityManager.REASON_CHASSIS_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, UnableLaunchReason.UnableType.GEAR, "档位异常"); + unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.GEAR, AutopilotAbilityManager.REASON_CHASSIS_GEAR); } } } @@ -165,7 +165,7 @@ public class AutopilotAbility250 { boolean isBrake = vehicleState.getParkingBrake(); if (isBrake) { isAutopilotAbility = false; - unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.PARKING_BRAKE, "施加驻车"); + unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.PARKING_BRAKE, AutopilotAbilityManager.REASON_CHASSIS_PARKING_BRAKE); } } } diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility350And360.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility350And360.java index fdce5ae4c0..c139b59ca2 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility350And360.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility350And360.java @@ -121,14 +121,14 @@ public class AutopilotAbility350And360 { float brake = chassisStates.getBrakeSystemStates().getBrakePedalResponsePosition(); if (brake > 0) { isAutopilotAbility = false; - unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.BRAKE, "制动踏板被踩下"); + unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.BRAKE, AutopilotAbilityManager.REASON_CHASSIS_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, UnableLaunchReason.UnableType.GEAR, "档位异常"); + unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.GEAR, AutopilotAbilityManager.REASON_CHASSIS_GEAR); } } } @@ -140,7 +140,7 @@ public class AutopilotAbility350And360 { boolean isBrake = vehicleState.getParkingBrake(); if (isBrake) { isAutopilotAbility = false; - unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.PARKING_BRAKE, "施加驻车"); + unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.PARKING_BRAKE, AutopilotAbilityManager.REASON_CHASSIS_PARKING_BRAKE); } } } diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbilityManager.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbilityManager.java index d5b55c37d3..8f0c11c4f7 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbilityManager.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbilityManager.java @@ -40,6 +40,9 @@ public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotA protected static final long DEFAULT_DETECTION_TIME = 3 * 1000L;//默认检测周期 protected static final String[] NODE_INFO_STATE = {"未知状态", "依赖未就绪", "启动中", "运行", "停止", "无法启动状态", "人为启动状态", "人为关闭状态"}; protected static final String[] NODE_INFO_STATE_FIXED_FREQUENCY = {"未知状态", "依赖未就绪", "启动中", "运行", "停止", "无法启动状态", "非自动启动状态", "非自动关闭状态"}; + protected static final String REASON_CHASSIS_BRAKE = "请检查刹车踏板"; + protected static final String REASON_CHASSIS_GEAR = "当前档位无法启动"; + protected static final String REASON_CHASSIS_PARKING_BRAKE = "请检查手刹"; private static volatile AutopilotAbilityManager INSTANCE; private OnAdasListener listener; private Handler handler;