Merge remote-tracking branch 'origin/feature/feature_mogo_obu' into feature/feature_mogo_obu

This commit is contained in:
董宏宇
2021-08-05 21:08:40 +08:00
2 changed files with 101 additions and 61 deletions

View File

@@ -13,7 +13,7 @@ public class MogoObuConst {
public static final String TAG_MOGO_OBU = "MogoObu";
/**
* 前碰撞预警,暂时不知道是干啥的
* 前碰撞预警
*/
public static final int TYPE_FRONT_COLLISION_WARNING = 101;
@@ -22,66 +22,82 @@ public class MogoObuConst {
*/
public static final int TYPE_CROSS_COLLISION_WARNING = 102;
/**
* 左转辅助
*/
public static final int TYPE_TURN_LEFT_WARN = 103;
/**
* 盲区预警
*/
public static final int TYPE_BLIND_ASSIST_WARN = 104;
/**
* 变道预警
*/
public static final int TYPE_CHANGE_LANES_WARN = 105;
/**
* 逆向超车预警
*/
public static final int TYPE_REVERSE_OVERTAKING_WARN = 106;
/**
* 紧急制动预警
*/
public static final int TYPE_URGENCY_COLLISION_WARNING = 105;
public static final int TYPE_URGENCY_COLLISION_WARNING = 107;
/**
* 绿波车速引导
*/
public static final int TYPE_OPTIMAL_SPEED_ADVISORY = 109;
/**
* 行人碰撞预警
*/
public static final int TYPE_ROAD_USER_COLLISION_WARNING = 115;
/**
* 为vip车辆变灯提醒
*/
public static final int TYPE_CHANGE_LIGHT_FOR_VIP = 116;
/**
* 闯红灯预警
*/
public static final int TYPE_RUSH_RED_LIGHT = 117;
/**
* 盲区辅助
*/
public static final int TYPE_BLIND_ASSIST_WARN = 118;
/**
* 异常车辆预警
*/
public static final int TYPE_UNUSUAL_CAR_WARN = 119;
public static final int TYPE_UNUSUAL_CAR_WARN = 108;
/**
* 道路危险情况预警
* 车辆失控预警
*/
public static final int TYPE_UNUSUAL_ROAD_WARN = 120;
/**
* 交通标牌提示
*/
public static final int TYPE_TRAFFIC_SIGN_INFO = 121;
/**
* 前方拥堵提醒
*/
public static final int TYPE_BLOCK_WARN = 122;
/**
* 紧急车辆提示预警
*/
public static final int TYPE_PRESSING_CAR_WARN = 123;
/**
* 已闯红灯提示
*/
public static final int TYPE_HAS_RUSH_RED_LIGHT = 124;
/**
* 车道汇合预警
*/
public static final int TYPE_LANE_CONVERGE_WARN = 125;
public static final int TYPE_CAR_OUT_OF_CONTROL_WARN = 109;
/**
* 限速预警
*/
public static final int TYPE_LIMIT_SPEED_WARN = 126;
public static final int TYPE_LIMIT_SPEED_WARN = 110;
/**
* 闯红灯预警
*/
public static final int TYPE_RUSH_RED_LIGHT = 111;
/**
* 行人碰撞预警
*/
public static final int TYPE_ROAD_USER_COLLISION_WARNING = 112;
/**
* 绿波车速引导
*/
public static final int TYPE_OPTIMAL_SPEED_ADVISORY = 113;
/**
* 道路危险情况预警
*/
public static final int TYPE_UNUSUAL_ROAD_WARN = 114;
/**
* 交通标牌提示
*/
public static final int TYPE_TRAFFIC_SIGN_INFO = 115;
/**
* 前方拥堵提醒
*/
public static final int TYPE_BLOCK_WARN = 116;
/**
* 紧急车辆提示预警
*/
public static final int TYPE_PRESSING_CAR_WARN = 117;
}

View File

@@ -28,9 +28,7 @@ import static com.mogo.module.obu.mogo.MogoObuConst.TAG_MOGO_OBU;
* @author lixiaopeng
*/
public class MogoSelfObuManager {
private static final String TAG = MogoSelfObuManager.class.getSimpleName();
private static final long DEFAULT_INTERVAL_TIME = 30_000L;
final String icw_data = "02000114010000000000001effd7892b11a4440af70100142a03000907e506100e2917019000005662010a45000b0000220847162c000037970010000a17f6215c459478b6010347ac045000090a0006012c01f4009600080073007300730073000b000000000000000000000000000000002b000037780000247300003261000000000000426c827f47001200100000000000000000000021220000349a006c0010000a17f63ecb45947ba301030000332c0010000a17f642e945947bea010300004d580010000a17f6435545947e4e0103000054c40010000a17f6413a45947f96010300005c300010000a17f62c2845947d140103000070e40010000a17f5fdb14594786001030000992000060004ffec2710";
private List<ADASRecognizedResult> resultList = null;
@@ -50,10 +48,6 @@ public class MogoSelfObuManager {
return instance;
}
private static final int MSG_HIDE_TRAFFIC_LIGHT = 1001;
final String icw_data = "02000114010000000000001effd7892b11a4440af70100142a03000907e506100e2917019000005662010a45000b0000220847162c000037970010000a17f6215c459478b6010347ac045000090a0006012c01f4009600080073007300730073000b000000000000000000000000000000002b000037780000247300003261000000000000426c827f47001200100000000000000000000021220000349a006c0010000a17f63ecb45947ba301030000332c0010000a17f642e945947bea010300004d580010000a17f6435545947e4e0103000054c40010000a17f6413a45947f96010300005c300010000a17f62c2845947d140103000070e40010000a17f5fdb14594786001030000992000060004ffec2710";
public void init(Context context) {
Logger.d(TAG_MOGO_OBU, "obuManager初始化--");
@@ -142,17 +136,17 @@ public class MogoSelfObuManager {
if (info != null) {
Logger.e(TAG_MOGO_OBU, "onCvxV2vThreatIndInfo ------> " + info.toString());
if (info.getThreat_info() != null) {
if (info.getThreat_info().getThreat_level() == 2 &&
info.getThreat_info().getThreat_level() == 3) { //看看2的情况
if (info.getThreat_info().getThreat_level() == 2 ||
info.getThreat_info().getThreat_level() == 3) {
//预警方位
int direction = info.getExt_info().getTarget_classification();
Logger.d(TAG_MOGO_OBU, "direction = " + direction + "----" + getMessage(direction));
//显示警告弹框 TODO
// MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(getMessage(direction), MogoReceiver.ACTION_V2X_FRONT_WARNING);
//处理预警类型
int appId = info.getThreat_info().getApp_id();
Logger.d(TAG_MOGO_OBU, "direction = " + direction + "----" + getMessage(direction) + "--appId = " + appId);
handleSdkObu(getEventType(appId));
}
@@ -200,10 +194,40 @@ public class MogoSelfObuManager {
}
private int getEventType(int appid) {
if (appid == ObuConstants.USE_CASE_ID.EBW) {
if (appid == ObuConstants.USE_CASE_ID.EBW) { //紧急制动
return MogoObuConst.TYPE_URGENCY_COLLISION_WARNING;
} else if (appid == ObuConstants.USE_CASE_ID.ICW) {
} else if (appid == ObuConstants.USE_CASE_ID.ICW) { //交叉路口碰撞预警
return MogoObuConst.TYPE_CROSS_COLLISION_WARNING;
} else if (appid == ObuConstants.USE_CASE_ID.LTA) {//左转辅助
return MogoObuConst.TYPE_TURN_LEFT_WARN;
} else if (appid == ObuConstants.USE_CASE_ID.BSW) { //盲区预警
return MogoObuConst.TYPE_BLIND_ASSIST_WARN;
} else if (appid == ObuConstants.USE_CASE_ID.LCW) { //变道预警
return MogoObuConst.TYPE_CHANGE_LANES_WARN;
} else if (appid == ObuConstants.USE_CASE_ID.DNPW) { //逆向超车预警
return MogoObuConst.TYPE_REVERSE_OVERTAKING_WARN;
} else if (appid == ObuConstants.USE_CASE_ID.FCW) { //前向碰撞预警
return MogoObuConst.TYPE_FRONT_COLLISION_WARNING;
} else if (appid == ObuConstants.USE_CASE_ID.AVW) { //异常车辆预警
return MogoObuConst.TYPE_UNUSUAL_CAR_WARN;
} else if (appid == ObuConstants.USE_CASE_ID.CLW) { //车辆失控预警
return MogoObuConst.TYPE_CAR_OUT_OF_CONTROL_WARN;
} else if (appid == ObuConstants.USE_CASE_ID.SLW) { //限速预警
return MogoObuConst.TYPE_LIMIT_SPEED_WARN;
} else if (appid == ObuConstants.USE_CASE_ID.LTA) { //闯红灯预警 ---
return MogoObuConst.TYPE_RUSH_RED_LIGHT;
} else if (appid == ObuConstants.USE_CASE_ID.VRUCW) { //行人碰撞预警
return MogoObuConst.TYPE_ROAD_USER_COLLISION_WARNING;
} else if (appid == ObuConstants.USE_CASE_ID.LTA) { //绿波车速引导 ---
return MogoObuConst.TYPE_OPTIMAL_SPEED_ADVISORY;
} else if (appid == ObuConstants.USE_CASE_ID.HLW) { //道路危险情况预警
return MogoObuConst.TYPE_UNUSUAL_ROAD_WARN;
} else if (appid == ObuConstants.USE_CASE_ID.IVS) { //交通标牌提示
return MogoObuConst.TYPE_TRAFFIC_SIGN_INFO;
} else if (appid == ObuConstants.USE_CASE_ID.TJW) { //前方拥堵提醒
return MogoObuConst.TYPE_BLOCK_WARN;
} else if (appid == ObuConstants.USE_CASE_ID.EVW) { //紧急车辆提示预警
return MogoObuConst.TYPE_PRESSING_CAR_WARN;
}
return 0;