[8.1.0][adas] 车型识别增加环境变量(增加新车型),移除开沃车型

This commit is contained in:
xinfengkun
2025-06-20 18:40:05 +08:00
parent a7df4bf4ae
commit 9aae84ecc5
10 changed files with 110 additions and 66 deletions

View File

@@ -561,13 +561,25 @@ message CarConfigResp
string vinCode = 11;//车辆vin码 taxi: 420 bus: 440
reserved 12 to 100;
int32 mapVersion = 101;//dockVersion解析出版本号仅用于版本对比解析失败为-1。例如"MAP-taxi_RoboTaxi_df_2.8.0.3_20220928_test" 解析结果为20800
bool isDF = 102;//车型是否是东风
bool isHQ = 103;//车型是否是红旗
bool isJinlv = 104;//车型是否是金旅小巴
bool isJinlvM1 = 105;//车型是否是金旅M1
bool isJinlvM2 = 106;//车型是否是金旅M2
bool isFutianSweeper = 107;//车型是否是福田清扫车
bool isKaiwo = 108;//车型是否是开沃
bool isBus = 102;//是否是Bus
bool isTaxi = 103;//是否是Taxi
bool isSweeper = 104;//是否是Sweeper
bool isBusJL_B1 = 105;//车型是否是金旅B1
bool isBusJL_B2 = 106;//车型是否是金旅B2
bool isBusJL_M1 = 107;//车型是否是金旅M1
bool isBusJL_B2_2025 = 108;//车型是否是金旅B2-2025
bool isBusAUV_B3 = 109;//车型是否是福田欧辉B3
bool isBusBYD_B4 = 110;//车型是否是比亚迪B4
bool isTaxiDF_T1 = 111;//车型是否是东风T1
bool isTaxiDF_T1_2023 = 112;//车型是否是东风T1-2023
bool isTaxiDF_T1_2025 = 113;//车型是否是东风T1-2025
bool isTaxiHQ_T2 = 114;//车型是否是红旗T2
bool isSweeperFT_C1_2023 = 115;//车型是否是福田清扫车C1-2023
bool isSweeperFT_C1_2025 = 116;//车型是否是福田清扫车C1-2025
bool isSweeperC2 = 117;//车型是否是清扫车C2
bool isSweeperNWM_C3 = 118;//车型是否是NWM清扫车C3
bool isSweeperBYD_C4 = 119;//车型是否是比亚迪清扫车C4
bool isSweeperC5 = 120;//车型是否是清扫车C5
}
// message definition for MsgTypeRecordCause

View File

@@ -45,8 +45,6 @@ android {
it.buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'LAUNCH_AUTOPILOT_GEAR_M2', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_D);}}'
//福田清扫车 C1
it.buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'LAUNCH_AUTOPILOT_GEAR_SWEEPER', 'null'
//开沃
it.buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'LAUNCH_AUTOPILOT_GEAR_KAIWO', 'null'
}
sourceSets {

View File

@@ -1743,7 +1743,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
MessagePad.CarConfigResp config = AdasManager.getInstance().getCarConfig();
if (config != null) {
//HQ和M1 MAP>=350开始走定频SSM其他车型360开始
if ((config.getMapVersion() >= 30500 && (config.getIsJinlvM1() || config.getIsHQ())) || config.getMapVersion() >= 30600) {
if ((config.getMapVersion() >= 30500 && (config.getIsBusJLM1() || config.getIsTaxiHQT2())) || config.getMapVersion() >= 30600) {
return -1L;
}
}

View File

@@ -53,8 +53,8 @@ public class ParallelDrivingManager {
public void setCarConfig(MessagePad.CarConfigResp carConfig) {
mapVersion = carConfig.getMapVersion();
isHQ = carConfig.getIsHQ();
isDF = carConfig.getIsDF();
isHQ = carConfig.getIsTaxiHQT2();
isDF = carConfig.getIsTaxiDFT1() || carConfig.getIsTaxiDFT12023() || carConfig.getIsTaxiDFT12025();
if (mapVersion != -1) {
stopBootTimer();
startCallback();

View File

@@ -37,9 +37,9 @@ public class AutopilotAbility350And360 {
private volatile ChassisStatesOuterClass.ChassisStates chassisStates;
private OnAutopilotAbilityListener listener;
private int mapVersion = -1;//工控机版本
private boolean isJinlv = false;//是否是金旅小巴
private boolean isJinlvM1 = false;//是否是M1
private boolean isJinlvM2 = false;//是否是M2
private boolean isJLB1 = false;//是否是金旅小巴
private boolean isJLM1 = false;//是否是M1
private boolean isJLB2 = false;//是否是M2
private boolean isHQ = false;//是否是HQ
private boolean isDF = false;//是否是DF
private volatile Timer turningTimer;//方向盘检测timer
@@ -61,11 +61,11 @@ public class AutopilotAbility350And360 {
public void setCarConfig(@NonNull MessagePad.CarConfigResp carConfig) {
mapVersion = carConfig.getMapVersion();
isJinlv = carConfig.getIsJinlv();
isJinlvM1 = carConfig.getIsJinlvM1();
isJinlvM2 = carConfig.getIsJinlvM2();
isHQ = carConfig.getIsHQ();
isDF = carConfig.getIsDF();
isJLB1 = carConfig.getIsBusJLB1();
isJLM1 = carConfig.getIsBusJLM1();
isJLB2 = carConfig.getIsBusJLB2() || carConfig.getIsBusJLB22025();
isHQ = carConfig.getIsTaxiHQT2();
isDF = carConfig.getIsTaxiDFT1() || carConfig.getIsTaxiDFT12023() || carConfig.getIsTaxiDFT12025();
taxiUnmanned();
}
@@ -124,7 +124,7 @@ public class AutopilotAbility350And360 {
* @return 是否能启动自驾
*/
private boolean isLaunchAutopilotLight(Chassis.LightSwitch currentLight) {
if (isJinlv || isJinlvM1 || isJinlvM2) {
if (isJLB1 || isJLM1 || isJLB2) {
return currentLight != Chassis.LightSwitch.LIGHT_FLASH;
}
return true;
@@ -310,9 +310,9 @@ public class AutopilotAbility350And360 {
masterVersion = -1;
seqNum = -1;
isHQ = false;
isJinlv = false;
isJinlvM1 = false;
isJinlvM2 = false;
isJLB1 = false;
isJLM1 = false;
isJLB2 = false;
isTurning.set(false);
}

View File

@@ -52,12 +52,11 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
private OnAdasListener listener;
private int mapVersion = -1;//工控机版本
private boolean isFutianSweeper = false;//是否是福田清扫车
private boolean isJinlv = false;//是否是小巴
private boolean isJinlvM1 = false;//是否是M1
private boolean isJinlvM2 = false;//是否是M2
private boolean isJLB1 = false;//是否是小巴
private boolean isJLM1 = false;//是否是M1
private boolean isJLB2 = false;//是否是M2
private boolean isHQ = false;//是否是HQ
private boolean isDF = false;//是否是DF
private boolean isKaiwo = false;//是否是开沃
private AutopilotAbility230 autopilotAbility230;
private AutopilotAbility250 autopilotAbility250;
private AutopilotAbility330 autopilotAbility330;
@@ -151,13 +150,12 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
if (version != 0) {
isInitCarConfig.set(true);
mapVersion = version;
isFutianSweeper = carConfig.getIsFutianSweeper();
isJinlv = carConfig.getIsJinlv();
isJinlvM1 = carConfig.getIsJinlvM1();
isJinlvM2 = carConfig.getIsJinlvM2();
isHQ = carConfig.getIsHQ();
isDF = carConfig.getIsDF();
isKaiwo = carConfig.getIsKaiwo();
isFutianSweeper = carConfig.getIsSweeperFTC12023() || carConfig.getIsSweeperFTC12025();
isJLB1 = carConfig.getIsBusJLB1();
isJLM1 = carConfig.getIsBusJLM1();
isJLB2 = carConfig.getIsBusJLB2() || carConfig.getIsBusJLB22025();
isHQ = carConfig.getIsTaxiHQT2();
isDF = carConfig.getIsTaxiDFT1() || carConfig.getIsTaxiDFT12023() || carConfig.getIsTaxiDFT12025();
initAutopilotAbility();
if (autopilotAbility230 != null) {
autopilotAbility230.setCarConfig(carConfig);
@@ -314,7 +312,7 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
autopilotAbility360 = new AutopilotAbility360(this);
autopilotAbility360.start(this);
}
} else if ((mapVersion >= 30500 && (isJinlvM1 || isHQ)) || mapVersion >= 30600) {
} else if ((mapVersion >= 30500 && (isJLM1 || isHQ)) || mapVersion >= 30600) {
CupidLogUtils.log(TAG, "能否启动自驾能力检测使用版本350和360共用");
if (autopilotAbility350And360 == null) {
autopilotAbility350And360 = new AutopilotAbility350And360(this);
@@ -358,16 +356,14 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
launchAutopilotGear = BuildConfig.LAUNCH_AUTOPILOT_GEAR_DF;
} else if (isHQ) {
launchAutopilotGear = BuildConfig.LAUNCH_AUTOPILOT_GEAR_HQ;
} else if (isJinlv) {
} else if (isJLB1) {
launchAutopilotGear = BuildConfig.LAUNCH_AUTOPILOT_GEAR_BUS;
} else if (isJinlvM1) {
} else if (isJLM1) {
launchAutopilotGear = BuildConfig.LAUNCH_AUTOPILOT_GEAR_M1;
} else if (isJinlvM2) {
} else if (isJLB2) {
launchAutopilotGear = BuildConfig.LAUNCH_AUTOPILOT_GEAR_M2;
} else if (isFutianSweeper) {
launchAutopilotGear = BuildConfig.LAUNCH_AUTOPILOT_GEAR_SWEEPER;
} else if (isKaiwo) {
launchAutopilotGear = BuildConfig.LAUNCH_AUTOPILOT_GEAR_KAIWO;
}
}
return launchAutopilotGear;
@@ -586,10 +582,9 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
isFutianSweeper = false;
isDF = false;
isHQ = false;
isJinlv = false;
isJinlvM1 = false;
isJinlvM2 = false;
isKaiwo = false;
isJLB1 = false;
isJLM1 = false;
isJLB2 = false;
}
}

View File

@@ -27,9 +27,9 @@ public abstract class BaseAutopilotAbilityChassis {
protected ChassisStatesOuterClass.ChassisStates chassisStates;
protected OnAutopilotAbilityListener listener;
protected int mapVersion = -1;//工控机版本
protected boolean isJinlv = false;//是否是金旅小巴
protected boolean isJinlvM1 = false;//是否是M1
protected boolean isJinlvM2 = false;//是否是M2
protected boolean isJLb1 = false;//是否是金旅小巴
protected boolean isJLM1 = false;//是否是M1
protected boolean isJLB2 = false;//是否是M2
protected boolean isHQ = false;//是否是HQ
protected boolean isDF = false;//是否是DF
@@ -47,11 +47,11 @@ public abstract class BaseAutopilotAbilityChassis {
public void setCarConfig(@NonNull MessagePad.CarConfigResp carConfig) {
mapVersion = carConfig.getMapVersion();
isJinlv = carConfig.getIsJinlv();
isJinlvM1 = carConfig.getIsJinlvM1();
isJinlvM2 = carConfig.getIsJinlvM2();
isHQ = carConfig.getIsHQ();
isDF = carConfig.getIsDF();
isJLb1 = carConfig.getIsBusJLB1();
isJLM1 = carConfig.getIsBusJLM1();
isJLB2 = carConfig.getIsBusJLB2() || carConfig.getIsBusJLB22025();
isHQ = carConfig.getIsTaxiHQT2();
isDF = carConfig.getIsTaxiDFT1() || carConfig.getIsTaxiDFT12023() || carConfig.getIsTaxiDFT12025();
taxiUnmanned();
}
@@ -102,7 +102,7 @@ public abstract class BaseAutopilotAbilityChassis {
* @return 是否能启动自驾
*/
public boolean isLaunchAutopilotLight() {
if (isJinlv || isJinlvM1 || isJinlvM2) {
if (isJLb1 || isJLM1 || isJLB2) {
return currentLight.get() != Chassis.LightSwitch.LIGHT_FLASH;
}
return true;
@@ -169,9 +169,9 @@ public abstract class BaseAutopilotAbilityChassis {
this.listener = null;
mapVersion = -1;
isHQ = false;
isJinlv = false;
isJinlvM1 = false;
isJinlvM2 = false;
isJLb1 = false;
isJLM1 = false;
isJLB2 = false;
}
}

View File

@@ -28,7 +28,7 @@ public class AutopilotStateMessage extends MyAbstractMessageHandler {
@Override
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
//判断当前工控机非清扫车330及以上将进行解析清扫车330及以上使用FSM此接口将被兼容调用
if (AdasManager.getInstance().getCarConfig() == null || !(AdasManager.getInstance().getCarConfig().getMapVersion() >= 330 && AdasManager.getInstance().getCarConfig().getIsFutianSweeper())) {
if (AdasManager.getInstance().getCarConfig() == null || !(AdasManager.getInstance().getCarConfig().getMapVersion() >= 330 && (AdasManager.getInstance().getCarConfig().getIsSweeperFTC12023() || AdasManager.getInstance().getCarConfig().getIsSweeperFTC12025()))) {
MessagePad.AutopilotState autopilotState = MessagePad.AutopilotState.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
AdasChannel.calculateTimeConsumingOnDispatchRaw("自动驾驶状态", raw.receiveTime);
long nowTime = 0;

View File

@@ -46,13 +46,52 @@ public class CarConfigRespMessage extends MyAbstractMessageHandler {
String subCarType = carConfigResp.getSubCarType().toLowerCase();
MessagePad.CarConfigResp.Builder builder = carConfigResp.toBuilder();
builder.setMapVersion(AdasManager.getInstance().parseVersion(dockVersion));
builder.setIsDF("df".equals(carType))//是否是东风
.setIsHQ("hq".equals(carType))//是否是红旗
.setIsJinlv("jinlv".equals(carType) && TextUtils.isEmpty(subCarType))//是否是金旅小巴
.setIsJinlvM1("jinlv".equals(carType) && "m1".equals(subCarType))//是否是金旅M1
.setIsJinlvM2("jinlv".equals(carType) && "m2".equals(subCarType))//是否是金旅M2
.setIsFutianSweeper("sweeper".equals(carType))//是否是福田清扫车
.setIsKaiwo("kaiwo".equals(carType));//是否是开沃
if ("jinlv".equals(carType)) {
if (TextUtils.isEmpty(subCarType) || "b1".equalsIgnoreCase(subCarType)) {
builder.setIsBusJLB1(true).setIsBus(true);//是否是金旅B1
} else if ("m2".equalsIgnoreCase(subCarType) || "b2".equalsIgnoreCase(subCarType)) {
builder.setIsBusJLB2(true).setIsBus(true);//是否是金旅B2
} else if ("m1".equalsIgnoreCase(subCarType)) {
builder.setIsBusJLM1(true).setIsBus(true);//是否是金旅M1
} else if ("b2-2025".equalsIgnoreCase(subCarType)) {
builder.setIsBusJLB22025(true).setIsBus(true);//是否是金旅B2-2025
}
} else if ("b3".equalsIgnoreCase(subCarType)) {
builder.setIsBusAUVB3(true).setIsBus(true);//是否是福田欧辉B3
} else if ("b4".equalsIgnoreCase(subCarType)) {
builder.setIsBusBYDB4(true).setIsBus(true);//是否是比亚迪B4
} else if ("df".equalsIgnoreCase(carType)) {
if (TextUtils.isEmpty(subCarType) || "t1".equalsIgnoreCase(subCarType)) {
builder.setIsTaxiDFT1(true).setIsTaxi(true);//是否是东风T1
} else if ("t1-2023".equalsIgnoreCase(subCarType)) {
builder.setIsTaxiDFT12023(true).setIsTaxi(true);//是否是东风T1-2023
} else if ("t1-2025".equalsIgnoreCase(subCarType)) {
builder.setIsTaxiDFT12025(true).setIsTaxi(true);//是否是东风T1-2025
}
} else if ("t2".equalsIgnoreCase(subCarType)) {
builder.setIsTaxiHQT2(true).setIsTaxi(true);//是否是红旗T2
} else if ("sweeper".equalsIgnoreCase(carType) && (TextUtils.isEmpty(subCarType) || "c1-2023".equalsIgnoreCase(subCarType))) {
builder.setIsSweeperFTC12023(true).setIsSweeper(true);//是否是福田清扫车C1-2023
} else if ("c1-2025".equalsIgnoreCase(subCarType)) {
builder.setIsSweeperFTC12025(true).setIsSweeper(true);//是否是福田清扫车C1-2025
} else if ("c2".equalsIgnoreCase(subCarType)) {
builder.setIsSweeperC2(true).setIsSweeper(true);//是否是清扫车C2
} else if ("c3".equalsIgnoreCase(subCarType)) {
builder.setIsSweeperNWMC3(true).setIsSweeper(true);//是否是NWM清扫车C3
} else if ("c4".equalsIgnoreCase(subCarType)) {
builder.setIsSweeperBYDC4(true).setIsSweeper(true);//是否是比亚迪清扫车C4
} else if ("c5".equalsIgnoreCase(subCarType)) {
builder.setIsSweeperC5(true).setIsSweeper(true);//车型是否是清扫车C5
}
//
// builder.setIsBusJLB1("jinlv".equals(carType) && TextUtils.isEmpty(subCarType))//是否是金旅小巴
// .setIsBusJLM1("jinlv".equals(carType) && "m1".equals(subCarType))//是否是金旅M1
// .setIsBusJLB2("jinlv".equals(carType) && "m2".equals(subCarType))//是否是金旅M2
// .setIsSweeperFTC12023("sweeper".equals(carType))//是否是福田清扫车
// ;
return builder.build();
}

View File

@@ -49,7 +49,7 @@ public class FunctionStatesMessage extends MyAbstractMessageHandler {
MessagePad.Header header = raw.getHeader();
adasListener.onFunctionStates(header, functionStates);
AdasManager manager = AdasManager.getInstance();
if (manager.getCarConfig() != null && manager.getCarConfig().getMapVersion() >= 330 && manager.getCarConfig().getIsFutianSweeper()) {//判断当前MAP版本>=330并且是清扫车才调用兼容方法
if (manager.getCarConfig() != null && manager.getCarConfig().getMapVersion() >= 330 && (manager.getCarConfig().getIsSweeperFTC12023() || manager.getCarConfig().getIsSweeperFTC12025())) {//判断当前MAP版本>=330并且是清扫车才调用兼容方法
compatibility(header, functionStates, adasListener);
}
}