Merge branch 'dev_robotaxi-d_230809_6.0.0' into 6.0.0merge2master
# Conflicts: # OCH/sweeper/sweeper-cloud/src/main/java/com/mogo/och/sweepercloud/model/SweeperTaskModel.java # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java
This commit is contained in:
@@ -65,6 +65,31 @@ public class AdasParam {
|
||||
* 为空的原因:未查询此数据、工控机不存在此数据、解析失败
|
||||
*/
|
||||
public final M1StitchedVideoSelfVehicleParam m1StitchedVideoSelfVehicleParamParse;
|
||||
/**
|
||||
* 故障减速停车策路开关
|
||||
* -1:未知 0:关闭故障减速停车策略 1(默认):使用故障减速停车策略
|
||||
*/
|
||||
public final int breakdownSlowDown;
|
||||
/**
|
||||
* 盲区开关
|
||||
* 0: off 1:on
|
||||
*/
|
||||
public final int blindArea;
|
||||
/**
|
||||
* 融合v2n开关
|
||||
* 0:不发给PnC 1:发给Pnc
|
||||
*/
|
||||
public final int v2nToPnc;
|
||||
/**
|
||||
* 融合v2i开关
|
||||
* 0:不发给PnC和鹰眼 1:发给Pnc和鹰眼,默认0
|
||||
*/
|
||||
public final int v2iToPnc;
|
||||
/**
|
||||
* 融合模式
|
||||
* 1:全融合模式 2:盲区模式 3:超视距模式 4:透传模式 5:纯路侧模式,默认1
|
||||
*/
|
||||
public final int fusionMode;
|
||||
|
||||
public AdasParam(MessagePad.SetParamReq param) {
|
||||
int detouringCmd = -1;
|
||||
@@ -77,6 +102,12 @@ public class AdasParam {
|
||||
int weakNetSlowDown = -1;
|
||||
String m1StitchedVideoSelfVehicleParam = null;
|
||||
M1StitchedVideoSelfVehicleParam m1StitchedVideoSelfVehicleParamParse = null;
|
||||
int breakdownSlowDown = -1;
|
||||
int blindArea = -1;
|
||||
int v2nToPnc = -1;
|
||||
int v2iToPnc = -1;
|
||||
int fusionMode = -1;
|
||||
|
||||
if (param != null) {
|
||||
int size = param.getReqsCount();
|
||||
if (size > 0) {
|
||||
@@ -127,6 +158,26 @@ public class AdasParam {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} else if (type == AdasConstants.MapSystemParamType.BREAKDOWN_SLOW_DOWN_VALUE) {
|
||||
if (!TextUtils.isEmpty(value)) {
|
||||
breakdownSlowDown = Integer.parseInt(value);
|
||||
}
|
||||
} else if (type == AdasConstants.MapSystemParamType.BLIND_AREA_VALUE) {
|
||||
if (!TextUtils.isEmpty(value)) {
|
||||
blindArea = Integer.parseInt(value);
|
||||
}
|
||||
} else if (type == AdasConstants.MapSystemParamType.V2N_TO_PNC_VALUE) {
|
||||
if (!TextUtils.isEmpty(value)) {
|
||||
v2nToPnc = Integer.parseInt(value);
|
||||
}
|
||||
} else if (type == AdasConstants.MapSystemParamType.V2I_TO_PNC_VALUE) {
|
||||
if (!TextUtils.isEmpty(value)) {
|
||||
v2iToPnc = Integer.parseInt(value);
|
||||
}
|
||||
} else if (type == AdasConstants.MapSystemParamType.FUSION_MODE_VALUE) {
|
||||
if (!TextUtils.isEmpty(value)) {
|
||||
fusionMode = Integer.parseInt(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,6 +192,11 @@ public class AdasParam {
|
||||
this.weakNetSlowDown = weakNetSlowDown;
|
||||
this.m1StitchedVideoSelfVehicleParam = m1StitchedVideoSelfVehicleParam;
|
||||
this.m1StitchedVideoSelfVehicleParamParse = m1StitchedVideoSelfVehicleParamParse;
|
||||
this.breakdownSlowDown = breakdownSlowDown;
|
||||
this.blindArea = blindArea;
|
||||
this.v2nToPnc = v2nToPnc;
|
||||
this.v2iToPnc = v2iToPnc;
|
||||
this.fusionMode = fusionMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -149,11 +205,17 @@ public class AdasParam {
|
||||
"\n变道绕障的目标障碍物速度阈值=" + (detouringSpeed == -1 ? "未知" : detouringSpeed + "m/s") +
|
||||
"\nAEB开关=" + (aebCmd == -1 ? "未知" : aebCmd == 0 ? "关" : "开") +
|
||||
"\n限制绕障开关=" + (laneChangeRestrainValid == -1 ? "未知" : laneChangeRestrainValid == 0 ? "正常绕障" : "限制绕障") +
|
||||
"\n停车让行线前避让等待开关=" + (stopYieldValid == -1 ? "未知" : stopYieldValid == 0 ? "无需等待" : "等待") +
|
||||
"\n地图限速功能开关=" + (hadmapSpeedLimitValid == -1 ? "未知" : hadmapSpeedLimitValid == 0 ? "不使用" : "使用") +
|
||||
"\n停车让行线前避让等待开关=" + (stopYieldValid == -1 ? "未知" : stopYieldValid == 0 ? "停车让行线前无需避让等待" : "停车让行线前需要避让等待") +
|
||||
"\n地图限速功能开关=" + (hadmapSpeedLimitValid == -1 ? "未知" : hadmapSpeedLimitValid == 0 ? "不使用地图限速功能" : "使用地图限速功能") +
|
||||
"\n环岛模式开关=" + (rampThetaValid == -1 ? "未知" : rampThetaValid == 0 ? "普通模式" : "环岛模式") +
|
||||
"\n弱网减速停车策略开关=" + (weakNetSlowDown == -1 ? "未知" : weakNetSlowDown == 0 ? "关闭" : "使用") +
|
||||
"\nm1拼接视频自车位置参数=" + (m1StitchedVideoSelfVehicleParam == null ? "未知" : m1StitchedVideoSelfVehicleParam);
|
||||
"\n弱网减速停车策略开关=" + (weakNetSlowDown == -1 ? "未知" : weakNetSlowDown == 0 ? "关闭弱网减速停车策略" : "使用弱网减速停车策略") +
|
||||
"\nm1拼接视频自车位置参数=" + (m1StitchedVideoSelfVehicleParam == null ? "未知" : m1StitchedVideoSelfVehicleParam) +
|
||||
"\n故障减速停车策路开关=" + (breakdownSlowDown == -1 ? "未知" : breakdownSlowDown == 0 ? "关闭故障减速停车策略" : "使用故障减速停车策略") +
|
||||
"\n盲区开关=" + (blindArea == -1 ? "未知" : blindArea == 0 ? "关" : "开") +
|
||||
"\n融合V2N开关=" + (v2nToPnc == -1 ? "未知" : v2nToPnc == 0 ? "不发给PnC" : "发给PnC") +
|
||||
"\n融合V2I开关=" + (v2iToPnc == -1 ? "未知" : v2iToPnc == 0 ? "不发给PnC和鹰眼" : "发给Pnc和鹰眼") +
|
||||
"\n融合模式=" + (fusionMode == -1 ? "未知" : fusionMode == 5 ? "纯路侧模式" : fusionMode == 4 ? "透传模式" : fusionMode == 3 ? "超视距模式" : fusionMode == 2 ? "盲区模式" : "全融合模式")
|
||||
;
|
||||
}
|
||||
|
||||
public static class M1StitchedVideoSelfVehicleParam {
|
||||
|
||||
@@ -2,15 +2,16 @@ package com.zhjt.mogo.adas.data.bean;
|
||||
|
||||
/**
|
||||
* 监控事件报告中定义的事件以及解释
|
||||
* 根据MAP3.3.1事件定义编写
|
||||
* 根据MAP3.5.0事件定义编写
|
||||
* http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=113713916 最后修改于2023-07-27
|
||||
*/
|
||||
public class MogoReport {
|
||||
public static final String RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED";
|
||||
public static final String RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE";
|
||||
public static final String RESULT_AUTOPILOT_INFERIOR = "RESULT_AUTOPILOT_INFERIOR";
|
||||
public static final String RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE";
|
||||
public static final String RESULT_REMOTEPILOT_INFERIOR = "RESULT_REMOTEPILOT_INFERIOR";
|
||||
public static final String RESULT_SHOW_WARNING = "RESULT_SHOW_WARNING";
|
||||
public static final String RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED";//自动驾驶系统启动失败
|
||||
public static final String RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE";//无法启动自动驾驶
|
||||
public static final String RESULT_AUTOPILOT_INFERIOR = "RESULT_AUTOPILOT_INFERIOR";//自动驾驶效果受影响
|
||||
public static final String RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE";//无法启动远程驾驶
|
||||
public static final String RESULT_REMOTEPILOT_INFERIOR = "RESULT_REMOTEPILOT_INFERIOR";//远程驾驶效果受影响
|
||||
public static final String RESULT_SHOW_WARNING = "RESULT_SHOW_WARNING";//存在不确定因素
|
||||
|
||||
|
||||
public enum Result {
|
||||
@@ -159,12 +160,11 @@ public class MogoReport {
|
||||
String TRA_NOT_EXIST = "EMAP_TRA_NOT_EXIST";//无法找到轨迹文件
|
||||
String TRA_LOAD_FAILED = "EMAP_TRA_LOAD_FAILED";//加载轨迹文件失败
|
||||
String ENGINE_INIT_FAILED = "EMAP_ENGINE_INIT_FAILED";//引擎初始化失败,包括轨迹路径不存在;vehicle_config.txt加载失败
|
||||
String ATTITUDE_INIT_FAILED = "EMAP_ATTITUDE_INIT_FAILED";//当前位置距离轨迹距离大于15m
|
||||
String EXIT_AUTOPILOT_FOR_PLANNING = "EMAP_EXIT_AUTOPILOT_FOR_PLANNING";//因planning掉帧强退自动驾驶
|
||||
String EXIT_AUTOPILOT_FOR_LOCATION = "EMAP_EXIT_AUTOPILOT_FOR_LOCATION";//因location掉帧强退自动驾驶
|
||||
String EXIT_AUTOPILOT_FOR_CHASSIS = "EMAP_EXIT_AUTOPILOT_FOR_CHASSIS";//因底盘消息掉帧强退自动驾驶
|
||||
String EXIT_AUTOPILOT_FOR_DISTANCE = "EMAP_EXIT_AUTOPILOT_FOR_DISTANCE";//因planning起点距离当前过远强退自动驾驶
|
||||
String EPARALLEL_AICLOUD_CONNECTION_ERROR = "EPARALLEL_AICLOUD_CONNECTION_ERROR";//断网(此时不符合平行驾驶条件) 平行驾驶退出到自驾,同时减速停车
|
||||
String EPARALLEL_AICLOUD_NETWORK_WEAK = "EPARALLEL_AICLOUD_NETWORK_WEAK";//弱网,平行驾驶退出到自驾,同时减速停车
|
||||
String EXIT_AUTOPILOT_FOR_BRAKE = "EMAP_EXIT_AUTOPILOT_FOR_BRAKE";//制动踏板干预而强退自动驾驶
|
||||
String EXIT_AUTOPILOT_FOR_ACCEL = "EMAP_EXIT_AUTOPILOT_FOR_ACCEL";//加速踏板干预而强退自动驾驶
|
||||
String EXIT_AUTOPILOT_FOR_STEER = "EMAP_EXIT_AUTOPILOT_FOR_STEER";//方向盘干预而强退自动驾驶
|
||||
@@ -189,6 +189,9 @@ public class MogoReport {
|
||||
String CONTROL_ABNORMAL_COMMAND = "EMAP_CONTROL_ABNORMAL_COMMAND";//controller发布的控制指令异常
|
||||
String CAN_ADAPTER_NO_CHASSIS_INFO = "EMAP_CAN_ADAPTER_NO_CHASSIS_INFO";//can_adapter未成功转发地盘信息
|
||||
String TRAJECTORY_LOST_WHEN_AUTOPILOT = "EMAP_TRAJECTORY_LOST_WHEN_AUTOPILOT";//自驾状态,但是全局轨迹丢失超过1.5s
|
||||
String PLANNING_FOR_PERCEPTION_TIMEOUT = "EMAP_PLANNING_FOR_PERCEPTION_TIMEOUT";//鹰眼下发进入自驾指令,自车还未进入自驾,感知延迟超过1s
|
||||
String PLANNING_FOR_HADMAP_ENGINE_LANES_MSG_TIMEOUT = "EMAP_PLANNING_FOR_HADMAP_ENGINE_LANES_MSG_TIMEOUT";//鹰眼下发进入自驾指令,自车还未进入自驾,地图车道数据延迟超过1s
|
||||
String PLANNING_FOR_PREDICTION_TIMEOUT = "EMAP_PLANNING_FOR_PREDICTION_TIMEOUT";//鹰眼下发进入自驾指令,自车还未进入自驾,预测数据延迟超过1s
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -208,6 +211,7 @@ public class MogoReport {
|
||||
String ACCEL_INFERENCE = "EVHC_ACCEL_INFERENCE";//由于油门干预退出自动驾驶或无法进入自动驾驶
|
||||
String CSS = "EVHC_CSS";//底盘不允许进入自动驾驶
|
||||
String GEAR = "EVHC_GEAR";//档位不是D或N档
|
||||
String EPB = "EVHC_EPB";//驻车(手刹)不是锁止(拉起)状态
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -227,6 +231,8 @@ public class MogoReport {
|
||||
String ROUTING_REQ_TIMEOUT = "ESYS_ROUTING_REQ_TIMEOUT";//自动驾驶开始前,routing请求无响应
|
||||
String PLANNING_CHANGE_FAILIED = "ESYS_PLANNING_CHANGE_FAILIED";//planning版本切换启动失败
|
||||
String CHECK_TRAJECTORY_FAILURE = "ESYS_CHECK_TRAJECTORY_FAILURE";//轨迹文件检查超时或检查结果无可用轨迹
|
||||
String TRAJECTORY_AGENT_NOT_READY = "ESYS_TRAJECTORY_AGENT_NOT_READY";//轨迹下载客户端未就绪拒绝轨迹下载请求
|
||||
String MAP_ENGINE_NOT_READY = "ESYS_MAP_ENGINE_NOT_READY";//地图引擎未就绪拒绝自驾
|
||||
String FAULT = "ESYS_FAULT";//master启动10分钟,仍有agent未连接
|
||||
String REBOOT_WARNING = "ESYS_REBOOT_WARNING";//命令重启不完全提示(部分模块没有关闭成功)
|
||||
String CAN_MSG_LOST = "ESYS_CAN_MSG_LOST";//master接收底盘消息超时
|
||||
@@ -238,6 +244,7 @@ public class MogoReport {
|
||||
String CONFIG_UPDATING_URL_NOT_ARRIVED = "ESYS_CONFIG_UPDATING_URL_NOT_ARRIVED";//url不可达
|
||||
String CONFIG_UPDATING_MD5_CHECK_ERROR = "ESYS_CONFIG_UPDATING_MD5_CHECK_ERROR";//md5检查失败
|
||||
String CONFIG_UPDATING_REJECT_SAME_TRAJ_TASK = "ESYS_CONFIG_UPDATING_REJECT_SAME_TRAJ_TASK";//拒绝同名轨迹任务
|
||||
String CONFIG_UPDATING_HTTP_FAILED = "ESYS_CONFIG_UPDATING_HTTP_FAILED";//获取下载列表失败
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,6 +275,7 @@ public class MogoReport {
|
||||
String INIT = "ECAM_INIT";//相机初始化失败
|
||||
String CALIB = "ECAM_CALIB";//标定信息读取失败
|
||||
String GRAB_FATAL = "ECAM_GRAB_FATAL";//相机数据采集异常
|
||||
String TS_ERROR = "ECAM_TS_ERROR";//图像时间戳异常
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -310,6 +318,14 @@ public class MogoReport {
|
||||
interface EVEHICLE {
|
||||
String IN_TROUBLE = "EVEHICLE_IN_TROUBLE";//planning 检测到车处于困境,把困境状态汇报给 SSM,ssm 发出该事件,等待驾舱端开始平行驾驶
|
||||
}
|
||||
|
||||
/**
|
||||
* EFM(FM故障)
|
||||
*/
|
||||
interface EFM {
|
||||
String ERROR3_STOP_PILOT = "EFM_ERROR3_STOP_PILOT";//触发降级停车策略
|
||||
String ERROR2_FUNC_FORBID = "EFM_ERROR2_FUNC_FORBID";//禁止车辆部分功能
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -337,6 +353,16 @@ public class MogoReport {
|
||||
String TRA_ROUTING = "IMAP_TRA_ROUTING";//算路成功
|
||||
String TRA_TYPE = "IMAP_TRA_TYPE";//加载轨迹类型通知
|
||||
String ENTRY_AUTOPILOT = "IMAP_ENTRY_AUTOPILOT";//控制进入自动驾驶成功
|
||||
String PLANNING_FOR_PREDICTION_RECEIVED = "IMAP_PLANNING_FOR_PREDICTION_RECEIVED";//自车进入车自驾,收到预测消息时解除预测数据超时警报
|
||||
String PLANNING_FOR_HADMAP_ENGINE_LANES_MSG_RECEIVED = "IMAP_PLANNING_FOR_HADMAP_ENGINE_LANES_MSG_RECEIVED";//自车进入车自驾,收到地图车道消息时解除地图数据超时警报
|
||||
String PLANNING_FOR_PERCEPTION_RECEIVED = "IMAP_PLANNING_FOR_PERCEPTION_RECEIVED";//自车进入车自驾,收到感知消息时解除感知数据超时警报
|
||||
String START_AUTOPILOT = "IMAP_START_AUTOPILOT";//控制侧开始自驾
|
||||
String EXIT_AUTOPILOT = "IMAP_EXIT_AUTOPILOT";//控制侧正常退出自驾
|
||||
String START_REMOTEPILOT = "IMAP_START_REMOTEPILOT";//控制侧开始平行驾驶
|
||||
String ENTRY_REMOTEPILOT = "IMAP_ENTRY_REMOTEPILOT";//控制侧进入平行驾驶
|
||||
String EXIT_REMOTEPILOT = "IMAP_EXIT_REMOTEPILOT";//控制侧退出平行驾驶
|
||||
String CONTROLLER_START_FM_COMMAND = "IMAP_CONTROLLER_START_FM_COMMAND";//控制侧开始故障处理命令
|
||||
String CONTROLLER_FINISH_FM_COMMAND = "IMAP_CONTROLLER_FINISH_FM_COMMAND";//控制侧完成故障处理命令
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -370,6 +396,7 @@ public class MogoReport {
|
||||
String SYSTEM_IN_IDLE = "ISYS_SYSTEM_IN_IDLE";//系统进入空闲状态
|
||||
String SYSTEM_OUT_IDLE = "ISYS_SYSTEM_OUT_IDLE";//系统退出空闲状态
|
||||
String ALREADY_AUTOPILOT_STATE = "ISYS_ALREADY_AUTOPILOT_STATE";//已经在自驾状态驾驶,忽略自驾命令
|
||||
String AUTOPILOT_TAKEN_OVER_BY_REMOTE = "ISYS_AUTOPILOT_TAKEN_OVER_BY_REMOTE";//自动驾驶被远程驾驶接管
|
||||
|
||||
/*******轨迹下载相关*******/
|
||||
String INIT_TRAJECTORY_START = "ISYS_INIT_TRAJECTORY_START";//轨迹管理_轨迹开始下载
|
||||
@@ -386,6 +413,7 @@ public class MogoReport {
|
||||
String CONFIG_UPDATING_SLAM_MAP = "ISYS_CONFIG_UPDATING_SLAM_MAP";//slam 地图更新中
|
||||
String CONFIG_UPDATING_AI_MODEL = "ISYS_CONFIG_UPDATING_AI_MODEL";//AI模型更新中
|
||||
String CONFIG_UPDATING_GRID_MAP = "ISYS_CONFIG_UPDATING_GRID_MAP";//珊格地图更新中
|
||||
String TRAJECTORY_AGENT_READY = "ISYS_TRAJECTORY_AGENT_READY ";//配置下载客户端已就绪
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -394,10 +422,14 @@ public class MogoReport {
|
||||
interface ISSM {
|
||||
String INIT = "ISSM_INIT";//SSM系统上电初始化
|
||||
String RESTARTED = "ISSM_RESTARTED";//SSM系统发生重启
|
||||
String AUTO_PILOT_STATE_CHANGE = "ISSM_AUTO_PILOT_STATE_CHANGE";//自驾状态变化,msg填写 1 to 0
|
||||
String REMOTE_PILOT_STATE_CHANGE = "ISSM_REMOTE_PILOT_STATE_CHANGE";//平行驾驶状态变化, msg填写 1 to 6
|
||||
String AUTO_PILOT_FINISH = "ISSM_AUTO_PILOT_FINISH";//一次自驾请求处理结束
|
||||
String REMOTE_PILOT_FINISH = "ISSM_REMOTE_PILOT_FINISH";//一次平行驾驶处理结束
|
||||
String HAVE_AGENT_CONNECTED = "ISSM_HAVE_AGENT_CONNECTED";//agent已连接成功
|
||||
|
||||
// String MODE_XX_START = "ISSM_MODE_XX_START";//SSM变更模式开始
|
||||
// String MODE_XX_FINISH = "ISSM_MODE_XX_FINISH";//SSM变更模式完成(第一次ready
|
||||
// String MODE_XX_FINISH = "ISSM_MODE_XX_FINISH";//SSM变更模式完成(第一次ready)
|
||||
// String MODE_XX_ABORT = "ISSM_MODE_XX_ABORT";//SSM变更模式中止
|
||||
// String MODE_XX_TIMEOUT = "ISSM_MODE_XX_TIMEOUT";//SSM变更模式超时
|
||||
// String MODE_XX_READY = "ISSM_MODE_XX_READY";//SSM模式就绪
|
||||
@@ -406,21 +438,21 @@ public class MogoReport {
|
||||
//以上6组被注释掉的字段 中的MODE_XX分别替换成MODE_RUN、MODE_IDLE、MODE_STOP
|
||||
|
||||
String MODE_RUN_START = "ISSM_MODE_RUN_START";//SSM变更模式开始
|
||||
String MODE_RUN_FINISH = "ISSM_MODE_RUN_FINISH";//SSM变更模式完成(第一次ready
|
||||
String MODE_RUN_FINISH = "ISSM_MODE_RUN_FINISH";//SSM变更模式完成(第一次ready)
|
||||
String MODE_RUN_ABORT = "ISSM_MODE_RUN_ABORT";//SSM变更模式中止
|
||||
String MODE_RUN_TIMEOUT = "ISSM_MODE_RUN_TIMEOUT";//SSM变更模式超时
|
||||
String MODE_RUN_READY = "ISSM_MODE_RUN_READY";//SSM模式就绪
|
||||
String MODE_RUN_UNREADY = "ISSM_MODE_RUN_UNREADY";//SSM未就绪
|
||||
|
||||
String MODE_IDLE_START = "ISSM_MODE_IDLE_START";//SSM变更模式开始
|
||||
String MODE_IDLE_FINISH = "ISSM_MODE_IDLE_FINISH";//SSM变更模式完成(第一次ready
|
||||
String MODE_IDLE_FINISH = "ISSM_MODE_IDLE_FINISH";//SSM变更模式完成(第一次ready)
|
||||
String MODE_IDLE_ABORT = "ISSM_MODE_IDLE_ABORT";//SSM变更模式中止
|
||||
String MODE_IDLE_TIMEOUT = "ISSM_MODE_IDLE_TIMEOUT";//SSM变更模式超时
|
||||
String MODE_IDLE_READY = "ISSM_MODE_IDLE_READY";//SSM模式就绪
|
||||
String MODE_IDLE_UNREADY = "ISSM_MODE_IDLE_UNREADY";//SSM未就绪
|
||||
|
||||
String MODE_STOP_START = "ISSM_MODE_STOP_START";//SSM变更模式开始
|
||||
String MODE_STOP_FINISH = "ISSM_MODE_STOP_FINISH";//SSM变更模式完成(第一次ready
|
||||
String MODE_STOP_FINISH = "ISSM_MODE_STOP_FINISH";//SSM变更模式完成(第一次ready)
|
||||
String MODE_STOP_ABORT = "ISSM_MODE_STOP_ABORT";//SSM变更模式中止
|
||||
String MODE_STOP_TIMEOUT = "ISSM_MODE_STOP_TIMEOUT";//SSM变更模式超时
|
||||
String MODE_STOP_READY = "ISSM_MODE_STOP_READY";//SSM模式就绪
|
||||
@@ -498,6 +530,26 @@ public class MogoReport {
|
||||
interface IVEHICLE {
|
||||
String NOT_IN_TROUBLE = "IVEHICLE_NOT_IN_TROUBLE";//车辆脱离困境,恢复正常,可继续开始自动驾驶了 触发频率:处于困境中,触发一次; 脱困后,触发一次 云端驾舱会接入该事件 建议鹰眼也接入,展示困境状态/脱困状态
|
||||
}
|
||||
|
||||
/**
|
||||
* IFSM(功能状态管理)
|
||||
*/
|
||||
interface IFSM {
|
||||
String AUTO_PILOT_STATE_CHANGED = "IFSM_AUTO_PILOT_STATE_CHANGED";//自动驾驶状态机变化 (msg 填写如 standby to active )
|
||||
String REMOTE_PILOT_STATE_CHANGED = "IFSM_REMOTE_PILOT_STATE_CHANGED";//平行驾驶状态机变化
|
||||
String TELECTRL_PILOT_STATE_CHANGED = "IFSM_TELECTRL_PILOT_STATE_CHANGED";//遥感驾驶状态机变化
|
||||
}
|
||||
|
||||
/**
|
||||
* IFM (故障管理)
|
||||
*/
|
||||
interface IFM {
|
||||
String HANDLE_FAULTS_START = "IFM_HANDLE_FAULTS_START";//FM开始处理故障
|
||||
String HANDLE_FAULTS_STOP = "IFM_HANDLE_FAULTS_STOP";//FM停止处理故障
|
||||
String ALL_FAULTS_RECOVER = "IFM_ALL_FAULTS_RECOVER";//FM当前已无故障 (只有有故障到全都消失时候上报)
|
||||
String ONLY_WARNING_FAULTS = "IFM_ONLY_WARNING_FAULTS";//FM仅存在警示故障
|
||||
String ERROR1_SLOW_SPEED = "IFM_ERROR1_SLOW_SPEED";//存在故障触发减速策略
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.zhjt.mogo.adas.data.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 自动驾驶能力 能否启动自动驾驶
|
||||
*/
|
||||
public class UnableAutopilotReason {
|
||||
|
||||
public enum SourceType {
|
||||
LIB,//ADAS庫
|
||||
CHASSIS,//底盤
|
||||
SSM,
|
||||
FSM,
|
||||
}
|
||||
|
||||
/**
|
||||
* 來源
|
||||
*/
|
||||
public final SourceType source;
|
||||
/**
|
||||
* 具體原因
|
||||
*/
|
||||
public final String unableAutopilotReason;
|
||||
|
||||
|
||||
public UnableAutopilotReason(SourceType source, String unableAutopilotReason) {
|
||||
this.source = source;
|
||||
this.unableAutopilotReason = unableAutopilotReason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
UnableAutopilotReason that = (UnableAutopilotReason) o;
|
||||
return source == that.source && TextUtils.equals(unableAutopilotReason, that.unableAutopilotReason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(source, unableAutopilotReason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{原因:" + unableAutopilotReason + " 来源:" + source + "}";
|
||||
}
|
||||
}
|
||||
@@ -100,3 +100,13 @@ enum CleanSystemControlMode {
|
||||
Clean_PureWash_Left_Work = 13;
|
||||
Clean_PureWash_Right_Work = 14;
|
||||
}
|
||||
|
||||
enum DoorNumber {
|
||||
NONE = 0;
|
||||
FRONT_LEFT = 1;
|
||||
FRONT_RIGHT = 2;
|
||||
REAR_LEFT = 3;
|
||||
REAR_RIGHT = 4;
|
||||
MIDDLE = 5;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,9 @@ enum MessageType
|
||||
MsgTypeOBU = 0x1000a; //OBU
|
||||
MsgTypeChassisStates = 0x1000b; //重构后的底盘状态, 透传
|
||||
MsgTypeFunctionStates = 0x1000c; //重构后的功能状态, 透传
|
||||
MsgTypeBackCameraVideo = 0x1000d; //清扫车后部摄像头视频 10hz
|
||||
MsgTypeBackCameraVideo = 0x1000d; //后部摄像头视频 10hz
|
||||
MsgTypeM1StitchedVideo = 0x1000e; //m1拼接视频 10hz
|
||||
MsgTypeSSMState = 0x1000f; //ssm 系统状态 1hz hq m1 MAP350开始支持,其他车型MAP360开始支持
|
||||
|
||||
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
|
||||
MsgTypeBasicInfoResp = 0x10101; //自动驾驶设备基础信息应答
|
||||
@@ -247,17 +248,20 @@ message Line
|
||||
string stopUrl_dpqp = 10; //打点文件下载的cos url,默认“”
|
||||
string stopMd5_dpqp = 11; //轨迹文件md5,默认“”
|
||||
uint64 timestamp_dpqp = 12; //上传轨迹完成时间戳(ms):用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
|
||||
string lineName = 13; //路线名
|
||||
}
|
||||
|
||||
message TrajectoryDownloadReq
|
||||
{
|
||||
Line line = 1; //路线
|
||||
uint32 source = 2; //指令来源: 0: default, 1:pad, 2:aicloud
|
||||
uint32 downloadType = 3; //下载类型: 0:正常下载 1:预下载
|
||||
}
|
||||
|
||||
// message definition for MessageType: MsgTypeBasicInfoReq
|
||||
message BasicInfoReq
|
||||
{
|
||||
bytes certification = 1;//域控ssl证书
|
||||
}
|
||||
|
||||
// message definition for MessageType: MsgTypeBasicInfoResp
|
||||
@@ -267,6 +271,7 @@ message BasicInfoResp
|
||||
uint32 environment = 2; //1: 研发环境, 2:测试环境, 3:生产环境 4:演示环境
|
||||
uint32 role = 3; //客户端角色:0: 司机屏,1: 乘客屏,2: 调试屏
|
||||
string version = 4; //鹰眼版本
|
||||
bytes certification = 5; //鹰眼ssl证书
|
||||
}
|
||||
|
||||
// message definition for MsgTypeSetAutopilotModeReq
|
||||
@@ -603,8 +608,13 @@ message SetOneParam
|
||||
// 5:停车让行线前避让等待开关(bool) 0:停车让行线前无需等待 1:停车让行线前需要等待 默认0
|
||||
// 6:地图限速功能开关(bool) 0:不使用地图限速功能 1:使用地图限速功能 默认0
|
||||
// 7:环岛模式开关(bool) 0:普通模式 1:环岛模式 默认0
|
||||
// 8:弱网减速停车策略开关(bool) 0:关闭弱网减速停车策略 1:使用弱网减速停车策略
|
||||
// 8:弱网减速停车策略开关(bool) 0:关闭弱网减速停车策略 1:使用弱网减速停车策略 默认1
|
||||
// 9:m1拼接视频自车位置参数(string), 格式:x,y,width,height
|
||||
// 10:故障减速停车策略开关(bool) 0:关闭故障减速停车策略 1:使用故障减速停车策略 默认1
|
||||
// 11: 盲区开关(bool) 0: off 1:on /telematics/sensor/blindarea_flag
|
||||
// 12: 融合v2n开关(bool) 0:不发给PnC 1:发给Pnc /telematics/fusion/v2n_flag
|
||||
// 13: 融合v2i开关(bool) 0:不发给PnC和鹰眼 1:发给Pnc和鹰眼,默认0 /telematics/fusion/v2i_flag
|
||||
// 14: 融合模式(int) 1:全融合模式 2:盲区模式 3:超视距模式 4:透传模式 5:纯路侧模式,默认1 /telematics/fusion/fusion_mode
|
||||
string value = 2; // 转成字符串的值
|
||||
}
|
||||
|
||||
@@ -700,3 +710,6 @@ message SessionInfo
|
||||
uint64 connectedTimeStamp = 4;
|
||||
string version = 5;
|
||||
}
|
||||
|
||||
//message definition for MsgTypeSSMState
|
||||
//refer to ssm_info.proto for details
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
syntax = "proto3";
|
||||
package mogo.telematics;
|
||||
|
||||
enum ParamSetType
|
||||
enum ParamSetType
|
||||
{
|
||||
ParamSetTypeNone = 0;
|
||||
ParamSetTypeBlindArea = 1; //bool, 0:off 1:on
|
||||
ParamSetTypeV2N = 2; //bool, 0:不发给PnC 1:发给Pnc
|
||||
ParamSetTypeV2I = 3; //bool, 0:不发给PnC和鹰眼 1:发给Pnc和鹰眼,默认0
|
||||
}
|
||||
|
||||
message ParamSetCmd
|
||||
|
||||
@@ -14,5 +14,10 @@ enum MapSystemParamType{
|
||||
RAMP_THETA_VALID = 7;//环岛模式开关
|
||||
WEAK_NET_SLOW_DOWN = 8;//弱网减速停车策略开关
|
||||
M1_STITCHED_VIDEO_SELF_VEHICLE_PARAM = 9;//m1拼接视频自车位置参数(string), 格式:x,y,width,height
|
||||
BREAKDOWN_SLOW_DOWN = 10;//故障减速停车策路开关
|
||||
BLIND_AREA = 11;//盲区开关(bool) 0: off 1:on /telematics/sensor/blindarea_flag
|
||||
V2N_TO_PNC = 12;//融合v2n开关(bool) 0:不发给PnC 1:发给Pnc /telematics/fusion/v2n_flag
|
||||
V2I_TO_PNC = 13;//融合v2i开关(bool) 0:不发给PnC和鹰眼 1:发给Pnc和鹰眼,默认0 /telematics/fusion/v2i_flag
|
||||
FUSION_MODE = 14;//融合模式(int) 1:全融合模式 2:盲区模式 3:超视距模式 4:透传模式 5:纯路侧模式,默认1 /telematics/fusion/fusion_mode
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
syntax = "proto2";
|
||||
|
||||
package system_master;
|
||||
|
||||
|
||||
enum HealthState {
|
||||
NORMAL = 0;
|
||||
FAULT = 1;
|
||||
UNKNOW = 2;
|
||||
}
|
||||
|
||||
message HealthInfo{
|
||||
required string name = 1; //node name
|
||||
required HealthState state = 2; //health state
|
||||
optional string code = 3; //code 与系统事件错误码对应,如有该错误填写,没有不填
|
||||
optional string desc = 4; //补充描述,用于未知情况
|
||||
}
|
||||
|
||||
54
libraries/mogo-adas-data/src/main/proto/ssm_info.proto
Normal file
54
libraries/mogo-adas-data/src/main/proto/ssm_info.proto
Normal file
@@ -0,0 +1,54 @@
|
||||
syntax = "proto2";
|
||||
|
||||
package system_master;
|
||||
import "personal/ssm_base.proto";
|
||||
|
||||
enum NodeState {
|
||||
NONE = 0; //未知状态None
|
||||
WAITING = 1; //依赖未就绪Waiting
|
||||
STARTING = 2; //启动中Starting
|
||||
RUNNING = 3; //运行running
|
||||
STOPPING = 4; //停止stopping
|
||||
BROKEN = 5; //无法启动状态
|
||||
MAN_RUN = 6; //非自动启动状态
|
||||
MAN_STOP = 7; //非自动关闭状态
|
||||
}
|
||||
|
||||
enum AgentState {
|
||||
DISCONNECT = 0; //未连接或断开连接
|
||||
CONNECTED = 1; //连接状态
|
||||
}
|
||||
|
||||
enum ModeState {
|
||||
MODE_STOP_UNREADY = 0; //停止模式-未就绪
|
||||
MODE_STOP_READY = 1; //运行模式-就绪 (所有节点关闭)
|
||||
MODE_RUN_UNREADY = 2; //运行模式-未就绪
|
||||
MODE_RUN_READY = 3; //运行模式-就绪 (所有节点启动)
|
||||
MODE_IDLE_UNREADY = 4; //空闲模式-未就绪
|
||||
MODE_IDLE_READY = 5; //空闲模式-就绪 (非驾驶状态)
|
||||
}
|
||||
|
||||
|
||||
message NodeInf {
|
||||
optional string node_name = 1; //node name
|
||||
optional string launch_name = 2; //launch name
|
||||
optional NodeState state = 3;
|
||||
}
|
||||
|
||||
message SsmStatusInf {
|
||||
required ModeState mode_state = 1; // 当前系统模式状态
|
||||
optional string map_version = 2; // MAP 版本信息
|
||||
optional string master_version = 3; // SSM 版本信息
|
||||
required bool auto_pilot_ready = 4; // 自动驾驶状态就绪
|
||||
required bool remote_pilot_ready = 5; // 平行驾驶状态就绪
|
||||
repeated NodeInf auto_pilot_unready_list = 6; //自驾未就绪节点列表
|
||||
repeated NodeInf remote_pilot_unready_list = 7; //平行驾驶未就绪列表
|
||||
optional string auto_pilot_unready_reason = 8; //自动驾驶状态未就绪原因描述
|
||||
optional string remote_pilot_unready_reason = 9; //平行驾驶状态未就绪原因描述
|
||||
repeated HealthInfo health_info=10; // 健康检查状态信息
|
||||
|
||||
optional uint64 cur_used_lineid = 20 [default = 0]; //0:当前无可用轨迹,需要下单,other: 可用轨迹id
|
||||
optional string hd_map_ver = 21; //高精地图版本
|
||||
optional string slam_map_ver = 22; //slam地图版本
|
||||
optional string grid_map_ver = 23; //栅格地图版本
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
syntax = "proto2";
|
||||
|
||||
package system_master;
|
||||
import "personal/ssm_base.proto";
|
||||
|
||||
enum SystemState {
|
||||
SYS_STARTING = 0; //系统正在启动
|
||||
@@ -14,19 +15,6 @@ enum SystemState {
|
||||
REMOTE_PILOT_RUNNING = 8; //平行驾驶运行中
|
||||
}
|
||||
|
||||
enum HealthState {
|
||||
NORMAL = 0;//正常
|
||||
FAULT = 1;//异常
|
||||
UNKNOW = 2;//未知
|
||||
}
|
||||
|
||||
message HealthInfo{
|
||||
required string name = 1; //node name
|
||||
required HealthState state = 2; //health state
|
||||
optional string code = 3; //code 与系统事件错误码对应,如有该错误填写,没有不填
|
||||
optional string desc = 4; //补充描述,用于未知情况
|
||||
}
|
||||
|
||||
message TopicInfo{
|
||||
optional string name = 1; //topic name
|
||||
optional int32 hz = 2; //Topic发送的频率
|
||||
@@ -50,7 +38,7 @@ message NodeFaultList{
|
||||
|
||||
message StatusInfo {
|
||||
required SystemState sys_state=1; // 当前系统状态
|
||||
repeated HealthInfo health_info=2; // 健康检查状态信息
|
||||
repeated HealthInfo health_info=2; // 健康检查状态信息
|
||||
optional DropTopic topic_drop_info=3; // topic 掉频信息, 如有掉频添加没有不添加
|
||||
optional string reserved = 4; // 用于表示idle模式,'idle' 表示idle模式 'work' 表示正常工作
|
||||
// add by liyl 20220907
|
||||
@@ -63,5 +51,9 @@ message StatusInfo {
|
||||
optional NodeFaultList remote_pilot_unready_list = 11; //平行驾驶未就绪列表, 20221128 增加
|
||||
optional string auto_pilot_unready_reason = 12; //自动驾驶状态未就绪原因描述
|
||||
optional string remote_pilot_unready_reason = 13; //平行驾驶状态未就绪原因描述
|
||||
}
|
||||
|
||||
optional uint64 cur_used_lineid = 20 [default = 0]; //0:当前无可用轨迹,需要下单,other: 可用轨迹id
|
||||
optional string hd_map_ver = 21; //高精地图版本
|
||||
optional string slam_map_ver = 22; //slam地图版本
|
||||
optional string grid_map_ver = 23; //栅格地图版本
|
||||
}
|
||||
|
||||
@@ -74,6 +74,11 @@ message DoorState {
|
||||
optional bool is_on = 1; //是否开启
|
||||
}
|
||||
|
||||
message DoorStateV2 {
|
||||
optional DoorNumber number = 1; // 车门编号
|
||||
optional uint32 status = 2; // 车门开闭状态(0-关, 1-开)
|
||||
}
|
||||
|
||||
message LightState {
|
||||
optional bool is_on = 1; //是否开启
|
||||
optional uint32 color = 2; //颜色
|
||||
@@ -116,13 +121,13 @@ message VehicleState {
|
||||
optional bool steer_inference = 23 [default = false]; //方向盘干预
|
||||
optional bool brake_inference = 24 [default = false]; //制动踏板干预
|
||||
optional bool accel_inference = 25 [default = false]; //加速踏板干预
|
||||
optional bool gear_switch_inference = 26 [default = false]; //档位切换干预
|
||||
optional bool gear_switch_inference = 26 [default = false]; //档位切换干预
|
||||
optional bool location_missing = 27 [default = false]; //未收到定位
|
||||
optional bool trajectory_missing = 28 [default = false]; //未收到轨迹
|
||||
optional bool chassis_status_missing = 29 [default = false]; //未收到车辆底盘反馈信息
|
||||
optional bool brake_light_status = 30 [default = false]; //自驾模式下制动灯状态
|
||||
optional bool pilot_mode_condition_met = 31 [default = false];
|
||||
|
||||
|
||||
optional float steeringSpd = 32 [default = 0]; // steering angle speed in degrees/s
|
||||
|
||||
optional float leftFrontWheelAngle = 33 [default = 0];//左前轮角度(deg),左负右正
|
||||
@@ -136,6 +141,8 @@ message VehicleState {
|
||||
optional float bms_soc = 40 [default = 0]; // 电量百分比范围 0~100
|
||||
optional float fuel_value = 41 [default = 0]; // 油车剩余油量
|
||||
|
||||
repeated DoorStateV2 door_state = 42; // 车门状态
|
||||
|
||||
optional SweeperFuTianCleanSystemState sweeper_futian_clean_system_state = 200; // 福田清扫车上装状态信息
|
||||
optional RoboTaxiState robo_taxi_state = 201; // taxi状态
|
||||
optional RoboBusState robo_bus_state = 202; // bus状态
|
||||
|
||||
@@ -22,6 +22,7 @@ android {
|
||||
versionName rootProject.versionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
multiDexEnabled true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
||||
|
||||
@@ -11,6 +11,7 @@ import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_SOURCE_ADAS;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_TYPE_INIT_STATUS;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_TYPE_SOCKET_AUTOPILOT;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.SystemClock;
|
||||
@@ -139,6 +140,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
*/
|
||||
private SubscribeInterface subscribeInterface;
|
||||
private Timer carConfigReqTimer;//车辆基础信息请求 多次请求防止无法收到基础信息情况出现
|
||||
private Context context;
|
||||
|
||||
public void setOnMultiDeviceListener(OnMultiDeviceListener onMultiDeviceListener) {
|
||||
this.onMultiDeviceListener = onMultiDeviceListener;
|
||||
@@ -170,7 +172,8 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* @param options
|
||||
* @param onAdasConnectStatusListener
|
||||
*/
|
||||
AdasChannel(AdasOptions options, OnAdasConnectStatusListener onAdasConnectStatusListener) {
|
||||
AdasChannel(Context context, AdasOptions options, OnAdasConnectStatusListener onAdasConnectStatusListener) {
|
||||
this.context = context;
|
||||
this.adasConnectStatusListener = onAdasConnectStatusListener;
|
||||
//配置为null默认是乘客屏幕
|
||||
if (options == null) {
|
||||
@@ -280,7 +283,8 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
nodeAliasCode = CHAIN_CODE_ADAS_INIT,
|
||||
paramIndexes = {-1})
|
||||
private void initSocket() {
|
||||
mSocket = new FpgaSocket();
|
||||
mSocket = new FpgaSocket(context);
|
||||
context = null;
|
||||
mSocket.setWebSocketListener(this);
|
||||
if (isUseQueue) {
|
||||
WebSocketQueueManager.getInstance().registerWebSocketListener(this);
|
||||
@@ -813,22 +817,41 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
/**
|
||||
* 自动驾驶设备基础信息应答
|
||||
*
|
||||
* @param sn SN
|
||||
* @param environment 环境 详情参见{@link Constants.ENVIRONMENT}1: 研发环境, 2:测试环境, 3:生产环境 4:演示环境
|
||||
* @param role 终端角色 详情参见{@link Constants.TERMINAL_ROLE}
|
||||
* @param sn SN
|
||||
* @param environment 环境 详情参见{@link Constants.ENVIRONMENT}1: 研发环境, 2:测试环境, 3:生产环境 4:演示环境
|
||||
* @param role 终端角色 详情参见{@link Constants.TERMINAL_ROLE}
|
||||
* @param versionCode 鹰眼版本号
|
||||
* @param versionName 鹰眼版本名
|
||||
* @param certification 鹰眼ssl证书
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendBasicInfoResp(@NonNull String sn, @Define.Environment int environment, @Define.TerminalRole int role) {
|
||||
public boolean sendBasicInfoResp(@NonNull String sn, @Define.Environment int environment, @Define.TerminalRole int role, int versionCode, String versionName, byte[] certification) {
|
||||
if (sn == null) {
|
||||
sn = "";
|
||||
}
|
||||
MessagePad.BasicInfoResp resp = MessagePad.BasicInfoResp
|
||||
.newBuilder()
|
||||
MessagePad.BasicInfoResp.Builder builder = MessagePad.BasicInfoResp.newBuilder()
|
||||
.setSn(sn)
|
||||
.setEnvironment(environment)
|
||||
.setRole(role)
|
||||
.build();
|
||||
.setRole(role);
|
||||
String version = null;
|
||||
if (versionCode > 0) {
|
||||
version = String.valueOf(versionCode);
|
||||
}
|
||||
if (!TextUtils.isEmpty(versionName)) {
|
||||
if (version != null) {
|
||||
version += "," + versionName;
|
||||
} else {
|
||||
version = versionName;
|
||||
}
|
||||
}
|
||||
if (!TextUtils.isEmpty(version)) {
|
||||
builder.setVersion(version);
|
||||
}
|
||||
if (certification != null && certification.length > 0) {
|
||||
builder.setCertification(com.google.protobuf.ByteString.copyFrom(certification));
|
||||
}
|
||||
MessagePad.BasicInfoResp resp = builder.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_BASIC_INFO_RESP.typeCode, resp.toByteArray());
|
||||
}
|
||||
|
||||
@@ -1091,7 +1114,8 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
/**
|
||||
* 发送 轨迹下载请求
|
||||
*
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param downloadType 下载类型: 0:正常下载 1:预下载
|
||||
* @return boolean
|
||||
*/
|
||||
@ChainLog(
|
||||
@@ -1101,10 +1125,13 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
paramIndexes = {0}
|
||||
)
|
||||
@Override
|
||||
public boolean sendTrajectoryDownloadReq(MessagePad.Line line) {
|
||||
public boolean sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType) {
|
||||
MessagePad.TrajectoryDownloadReq.Builder builder = MessagePad.TrajectoryDownloadReq.newBuilder();
|
||||
builder.setSource(1);//指令来源: 0: default, 1:pad, 2:aicloud
|
||||
builder.setLine(line);
|
||||
if (downloadType > -1) {
|
||||
builder.setDownloadType(downloadType);
|
||||
}
|
||||
MessagePad.TrajectoryDownloadReq req = builder.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_TRAJECTORY_DOWNLOAD_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
@@ -1114,8 +1141,16 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@Deprecated//HQ、M1 MAP350开始弃用,其他车型MAP360开始弃用
|
||||
@Override
|
||||
public boolean sendStatusQueryReq() {
|
||||
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) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
MessagePad.StatusQueryReq req = MessagePad.StatusQueryReq
|
||||
.newBuilder()
|
||||
.build();
|
||||
@@ -1513,14 +1548,11 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
/**
|
||||
* 设置参数命令
|
||||
*
|
||||
* @param type 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
|
||||
* 3:AEB开关(bool) 4:限制绕障开关(bool)
|
||||
* 5:停车让行线前避让等待开关(bool) 6:地图限速功能开关(bool)
|
||||
* @param type 类型{@link AdasConstants.MapSystemParamType}
|
||||
* @param value 转成字符串的值
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendSetParamReq(int type, String value) {
|
||||
private boolean sendSetParamReq(int type, String value) {
|
||||
MessagePad.SetOneParam oneParam = MessagePad.SetOneParam
|
||||
.newBuilder().setType(type).setValue(value).build();
|
||||
MessagePad.SetParamReq req = MessagePad.SetParamReq
|
||||
@@ -1530,6 +1562,71 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
return sendPBMessage(MessageType.TYPE_SEND_SET_PARAM_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置参数命令V2
|
||||
*/
|
||||
|
||||
private <T> boolean sendSetParamReqV2(ParamSetCmdOuterClass.ParamSetType paramSetType, T value) {
|
||||
ParamSetCmdOuterClass.ParamSetCmd.Builder builder = ParamSetCmdOuterClass.ParamSetCmd.newBuilder()
|
||||
.setSrc(1)
|
||||
.setType(paramSetType);
|
||||
if (paramSetType == ParamSetCmdOuterClass.ParamSetType.ParamSetTypeBlindArea
|
||||
|| paramSetType == ParamSetCmdOuterClass.ParamSetType.ParamSetTypeV2N
|
||||
|| paramSetType == ParamSetCmdOuterClass.ParamSetType.ParamSetTypeV2I) {
|
||||
builder.setBoolValue((Boolean) value);
|
||||
}
|
||||
ParamSetCmdOuterClass.ParamSetCmd req = builder.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_SET_PARAM_REQ_V2.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置参数命令
|
||||
*
|
||||
* @param param {@link AdasConstants.MapSystemParamType#DETOURING Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#DETOURING_SPEED Value类型:double或double类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#AEB Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#LANE_CHANGE_RESTRAIN_VALID Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#STOP_YIELD_VALID Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#HADMAP_SPEED_LIMIT_VALID Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#RAMP_THETA_VALID Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#WEAK_NET_SLOW_DOWN Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#BREAKDOWN_SLOW_DOWN Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#BLIND_AREA Value类型:boolean或boolean类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#V2N_TO_PNC Value类型:boolean或boolean类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#V2I_TO_PNC Value类型:boolean或boolean类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#FUSION_MODE Value类型:int或int类型String}
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendSetParamReq(@NonNull Map<AdasConstants.MapSystemParamType, Object> param) {
|
||||
boolean isV1 = true;
|
||||
boolean isV2BlindArea = true;
|
||||
boolean isV2V2N = true;
|
||||
boolean isV2V2NI = true;
|
||||
MessagePad.SetParamReq.Builder builder = MessagePad.SetParamReq.newBuilder();
|
||||
for (Map.Entry<AdasConstants.MapSystemParamType, Object> entry : param.entrySet()) {
|
||||
AdasConstants.MapSystemParamType key = entry.getKey();
|
||||
if (key != AdasConstants.MapSystemParamType.DEFAULT_TYPE && key != AdasConstants.MapSystemParamType.M1_STITCHED_VIDEO_SELF_VEHICLE_PARAM) {
|
||||
Object value = entry.getValue();
|
||||
if (key == AdasConstants.MapSystemParamType.BLIND_AREA) {
|
||||
isV2BlindArea = sendSetParamReqV2(ParamSetCmdOuterClass.ParamSetType.ParamSetTypeBlindArea, (Boolean) value);
|
||||
} else if (key == AdasConstants.MapSystemParamType.V2N_TO_PNC) {
|
||||
isV2V2N = sendSetParamReqV2(ParamSetCmdOuterClass.ParamSetType.ParamSetTypeV2N, (Boolean) value);
|
||||
} else if (key == AdasConstants.MapSystemParamType.V2I_TO_PNC) {
|
||||
isV2V2NI = sendSetParamReqV2(ParamSetCmdOuterClass.ParamSetType.ParamSetTypeV2I, (Boolean) value);
|
||||
} else {
|
||||
builder.addReqs(MessagePad.SetOneParam.newBuilder().setType(key.getNumber()).setValue(String.valueOf(value)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (builder.getReqsCount() > 0) {
|
||||
MessagePad.SetParamReq req = builder.build();
|
||||
isV1 = sendPBMessage(MessageType.TYPE_SEND_SET_PARAM_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
return isV1 && isV2BlindArea && isV2V2N && isV2V2NI;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绕障类功能开关
|
||||
*
|
||||
@@ -1624,6 +1721,62 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
return sendSetParamReq(AdasConstants.MapSystemParamType.WEAK_NET_SLOW_DOWN_VALUE, String.valueOf(enable));
|
||||
}
|
||||
|
||||
/**
|
||||
* 故障减速停车策路开关
|
||||
*
|
||||
* @param enable 0:关闭故障减速停车策略 1:使用故障减速停车策略
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendBreakdownSlowDown(int enable) {
|
||||
return sendSetParamReq(AdasConstants.MapSystemParamType.BREAKDOWN_SLOW_DOWN_VALUE, String.valueOf(enable));
|
||||
}
|
||||
|
||||
/**
|
||||
* 融合模式
|
||||
*
|
||||
* @param cmd 1:全融合模式 2:盲区模式 3:超视距模式 4:透传模式 5:纯路侧模式,默认1
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendFusionMode(int cmd) {
|
||||
return sendSetParamReq(AdasConstants.MapSystemParamType.FUSION_MODE_VALUE, String.valueOf(cmd));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 盲区数据开关
|
||||
*
|
||||
* @param switchCmd 数据开关
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendBlindAreaCmd(boolean switchCmd) {
|
||||
return sendSetParamReqV2(ParamSetCmdOuterClass.ParamSetType.ParamSetTypeBlindArea, switchCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制V2N进PnC
|
||||
*
|
||||
* @param switchCmd true:发给PnC,false:不发给PnC
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendV2nToPncCmd(boolean switchCmd) {
|
||||
return sendSetParamReqV2(ParamSetCmdOuterClass.ParamSetType.ParamSetTypeV2N, switchCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制V2I进PnC
|
||||
*
|
||||
* @param switchCmd true:发给Pnc和鹰眼,false:不发给PnC和鹰眼
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendV2iToPncCmd(boolean switchCmd) {
|
||||
return sendSetParamReqV2(ParamSetCmdOuterClass.ParamSetType.ParamSetTypeV2I, switchCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部参数
|
||||
* 结果回调{@link OnAdasListener#onGetParamResp(MessagePad.Header, MessagePad.SetParamReq, AdasParam)}
|
||||
@@ -1632,7 +1785,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
*/
|
||||
@Override
|
||||
public boolean sendGetAllParamReq() {
|
||||
return sendGetParamReq(null);
|
||||
return sendGetParamReq((AdasConstants.MapSystemParamType[]) null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1643,9 +1796,9 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendGetParamReq(AdasConstants.MapSystemParamType paramType) {
|
||||
public boolean sendGetParamReq(AdasConstants.MapSystemParamType... paramType) {
|
||||
MessagePad.SetParamReq req;
|
||||
if (paramType == null || paramType == AdasConstants.MapSystemParamType.DEFAULT_TYPE) {
|
||||
if (paramType == null || paramType[0] == null || (paramType.length == 1 && paramType[0] == AdasConstants.MapSystemParamType.DEFAULT_TYPE)) {
|
||||
req = MessagePad.SetParamReq
|
||||
.newBuilder()
|
||||
.addReqs(MessagePad.SetOneParam.newBuilder().setType(AdasConstants.MapSystemParamType.DETOURING_VALUE))
|
||||
@@ -1657,12 +1810,20 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
.addReqs(MessagePad.SetOneParam.newBuilder().setType(AdasConstants.MapSystemParamType.RAMP_THETA_VALID_VALUE))
|
||||
.addReqs(MessagePad.SetOneParam.newBuilder().setType(AdasConstants.MapSystemParamType.WEAK_NET_SLOW_DOWN_VALUE))
|
||||
.addReqs(MessagePad.SetOneParam.newBuilder().setType(AdasConstants.MapSystemParamType.M1_STITCHED_VIDEO_SELF_VEHICLE_PARAM_VALUE))
|
||||
.addReqs(MessagePad.SetOneParam.newBuilder().setType(AdasConstants.MapSystemParamType.BREAKDOWN_SLOW_DOWN_VALUE))
|
||||
.addReqs(MessagePad.SetOneParam.newBuilder().setType(AdasConstants.MapSystemParamType.BLIND_AREA_VALUE))
|
||||
.addReqs(MessagePad.SetOneParam.newBuilder().setType(AdasConstants.MapSystemParamType.V2N_TO_PNC_VALUE))
|
||||
.addReqs(MessagePad.SetOneParam.newBuilder().setType(AdasConstants.MapSystemParamType.V2I_TO_PNC_VALUE))
|
||||
.addReqs(MessagePad.SetOneParam.newBuilder().setType(AdasConstants.MapSystemParamType.FUSION_MODE_VALUE))
|
||||
.build();
|
||||
} else {
|
||||
req = MessagePad.SetParamReq
|
||||
.newBuilder()
|
||||
.addReqs(MessagePad.SetOneParam.newBuilder().setType(paramType.getNumber()))
|
||||
.build();
|
||||
MessagePad.SetParamReq.Builder builder = MessagePad.SetParamReq.newBuilder();
|
||||
for (AdasConstants.MapSystemParamType type : paramType) {
|
||||
if (type != AdasConstants.MapSystemParamType.DEFAULT_TYPE) {
|
||||
builder.addReqs(MessagePad.SetOneParam.newBuilder().setType(type.getNumber()));
|
||||
}
|
||||
}
|
||||
req = builder.build();
|
||||
}
|
||||
return sendPBMessage(MessageType.TYPE_SEND_GET_PARAM_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
@@ -1711,43 +1872,6 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
return sendPBMessage(MessageType.TYPE_SEND_BAG_MANAGER_CMD.typeCode, bagManager.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制V2N数据给车端PnC
|
||||
*
|
||||
* @param switchCmd true为发给PnC,false为不发给PnC
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendV2nToPncCmd(boolean switchCmd) {
|
||||
return sendSetParamReqV2(ParamSetCmdOuterClass.ParamSetType.ParamSetTypeV2N, switchCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 盲区数据开关
|
||||
*
|
||||
* @param switchCmd 数据开关
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendBlindAreaCmd(boolean switchCmd) {
|
||||
return sendSetParamReqV2(ParamSetCmdOuterClass.ParamSetType.ParamSetTypeBlindArea, switchCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置参数命令V2
|
||||
*/
|
||||
|
||||
private <T> boolean sendSetParamReqV2(ParamSetCmdOuterClass.ParamSetType paramSetType, T value) {
|
||||
ParamSetCmdOuterClass.ParamSetCmd.Builder builder = ParamSetCmdOuterClass.ParamSetCmd.newBuilder()
|
||||
.setSrc(1)
|
||||
.setType(paramSetType);
|
||||
if (paramSetType == ParamSetCmdOuterClass.ParamSetType.ParamSetTypeBlindArea || paramSetType == ParamSetCmdOuterClass.ParamSetType.ParamSetTypeV2N) {
|
||||
builder.setBoolValue((Boolean) value);
|
||||
}
|
||||
ParamSetCmdOuterClass.ParamSetCmd req = builder.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_SET_PARAM_REQ_V2.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* FSM状态原因查询
|
||||
* 当FSMFunctionStates的类型是XXX_DRIVING_OFF时查询OFF的原因
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -103,13 +104,13 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
* @param options 连接参数
|
||||
* @param onAdasConnectStatusListener 连接状态监听
|
||||
*/
|
||||
public synchronized void create(AdasOptions options, OnAdasConnectStatusListener onAdasConnectStatusListener) {
|
||||
public synchronized void create(Context context, AdasOptions options, OnAdasConnectStatusListener onAdasConnectStatusListener) {
|
||||
if (mChannel != null) {
|
||||
mChannel.disconnect();
|
||||
carConfig = null;
|
||||
mChannel = null;
|
||||
}
|
||||
mChannel = new AdasChannel(options, onAdasConnectStatusListener);
|
||||
mChannel = new AdasChannel(context, options, onAdasConnectStatusListener);
|
||||
|
||||
}
|
||||
|
||||
@@ -291,9 +292,51 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
* @param role 终端角色 详情参见{@link Constants.TERMINAL_ROLE}
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendBasicInfoResp(@NonNull String sn, @Define.Environment int environment, @Define.TerminalRole int role) {
|
||||
return mChannel != null && mChannel.sendBasicInfoResp(sn, environment, role);
|
||||
return sendBasicInfoResp(sn, environment, role, -1, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶设备基础信息应答
|
||||
*
|
||||
* @param sn SN
|
||||
* @param environment 环境 详情参见{@link Constants.ENVIRONMENT}1: 研发环境, 2:测试环境, 3:生产环境 4:演示环境
|
||||
* @param role 终端角色 详情参见{@link Constants.TERMINAL_ROLE}
|
||||
* @param versionCode 鹰眼版本号
|
||||
* @param versionName 鹰眼版本名
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean sendBasicInfoResp(@NonNull String sn, int environment, int role, int versionCode, String versionName) {
|
||||
return sendBasicInfoResp(sn, environment, role, versionCode, versionName, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶设备基础信息应答
|
||||
*
|
||||
* @param sn SN
|
||||
* @param environment 环境 详情参见{@link Constants.ENVIRONMENT}1: 研发环境, 2:测试环境, 3:生产环境 4:演示环境
|
||||
* @param role 终端角色 详情参见{@link Constants.TERMINAL_ROLE}
|
||||
* @param certification 鹰眼ssl证书
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean sendBasicInfoResp(@NonNull String sn, @Define.Environment int environment, @Define.TerminalRole int role, byte[] certification) {
|
||||
return sendBasicInfoResp(sn, environment, role, -1, null, certification);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶设备基础信息应答
|
||||
*
|
||||
* @param sn SN
|
||||
* @param environment 环境 详情参见{@link Constants.ENVIRONMENT}1: 研发环境, 2:测试环境, 3:生产环境 4:演示环境
|
||||
* @param role 终端角色 详情参见{@link Constants.TERMINAL_ROLE}
|
||||
* @param versionCode 鹰眼版本号
|
||||
* @param versionName 鹰眼版本名
|
||||
* @param certification 鹰眼ssl证书
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendBasicInfoResp(@NonNull String sn, @Define.Environment int environment, @Define.TerminalRole int role, int versionCode, String versionName, byte[] certification) {
|
||||
return mChannel != null && mChannel.sendBasicInfoResp(sn, environment, role, versionCode, versionName, certification);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -515,9 +558,20 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendTrajectoryDownloadReq(MessagePad.Line line) {
|
||||
return mChannel != null && mChannel.sendTrajectoryDownloadReq(line);
|
||||
return mChannel != null && mChannel.sendTrajectoryDownloadReq(line, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 轨迹下载请求
|
||||
*
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param downloadType 下载类型: 0:正常下载 1:预下载
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType) {
|
||||
return mChannel != null && mChannel.sendTrajectoryDownloadReq(line, downloadType);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -525,6 +579,7 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@Deprecated//HQ、M1 MAP350开始弃用,其他车型MAP360开始弃用
|
||||
@Override
|
||||
public boolean sendStatusQueryReq() {
|
||||
return mChannel != null && mChannel.sendStatusQueryReq();
|
||||
@@ -810,18 +865,6 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.sendOperatorCmdStopHonking();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置参数命令
|
||||
*
|
||||
* @param type 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
|
||||
* @param value 转成字符串的值
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendSetParamReq(int type, String value) {
|
||||
return mChannel != null && mChannel.sendSetParamReq(type, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绕障类功能开关
|
||||
*
|
||||
@@ -915,6 +958,84 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.sendWeakNetSlowDown(enable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 故障减速停车策路开关
|
||||
*
|
||||
* @param enable 0:关闭故障减速停车策略 1:使用故障减速停车策略
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendBreakdownSlowDown(int enable) {
|
||||
return mChannel != null && mChannel.sendBreakdownSlowDown(enable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 融合模式
|
||||
*
|
||||
* @param cmd 1:全融合模式 2:盲区模式 3:超视距模式 4:透传模式 5:纯路侧模式,默认1
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendFusionMode(int cmd) {
|
||||
return mChannel != null && mChannel.sendFusionMode(cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 盲区数据开关
|
||||
*
|
||||
* @param switchCmd 数据开关
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendBlindAreaCmd(boolean switchCmd) {
|
||||
return mChannel != null && mChannel.sendBlindAreaCmd(switchCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制V2N进PnC
|
||||
*
|
||||
* @param switchCmd true:发给PnC,false:不发给PnC
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendV2nToPncCmd(boolean switchCmd) {
|
||||
return mChannel != null && mChannel.sendV2nToPncCmd(switchCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制V2I进PnC
|
||||
*
|
||||
* @param switchCmd true:发给Pnc和鹰眼,false:不发给PnC和鹰眼
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendV2iToPncCmd(boolean switchCmd) {
|
||||
return mChannel != null && mChannel.sendV2iToPncCmd(switchCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置参数命令
|
||||
*
|
||||
* @param param {@link AdasConstants.MapSystemParamType#DETOURING Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#DETOURING_SPEED Value类型:double或double类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#AEB Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#LANE_CHANGE_RESTRAIN_VALID Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#STOP_YIELD_VALID Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#HADMAP_SPEED_LIMIT_VALID Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#RAMP_THETA_VALID Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#WEAK_NET_SLOW_DOWN Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#BREAKDOWN_SLOW_DOWN Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#BLIND_AREA Value类型:boolean或boolean类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#V2N_TO_PNC Value类型:boolean或boolean类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#V2I_TO_PNC Value类型:boolean或boolean类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#FUSION_MODE Value类型:int或int类型String}
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendSetParamReq(@NonNull Map<AdasConstants.MapSystemParamType, Object> param) {
|
||||
return mChannel != null && mChannel.sendSetParamReq(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部参数
|
||||
* 结果回调{@link OnAdasListener#onGetParamResp(MessagePad.Header, MessagePad.SetParamReq, AdasParam)}
|
||||
@@ -934,7 +1055,7 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendGetParamReq(AdasConstants.MapSystemParamType paramType) {
|
||||
public boolean sendGetParamReq(AdasConstants.MapSystemParamType... paramType) {
|
||||
return mChannel != null && mChannel.sendGetParamReq(paramType);
|
||||
}
|
||||
|
||||
@@ -967,28 +1088,6 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.sendBagManagerCmd(bagManager);
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制V2N数据给车端PnC
|
||||
*
|
||||
* @param switchCmd true为发给PnC,false为不发给PnC
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendV2nToPncCmd(boolean switchCmd) {
|
||||
return mChannel != null && mChannel.sendV2nToPncCmd(switchCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 盲区数据开关
|
||||
*
|
||||
* @param switchCmd 数据开关
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendBlindAreaCmd(boolean switchCmd) {
|
||||
return mChannel != null && mChannel.sendBlindAreaCmd(switchCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* FSM状态原因查询
|
||||
* 当FSMFunctionStates的类型是XXX_DRIVING_OFF时查询OFF的原因
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
@@ -77,12 +78,15 @@ public interface IAdasNetCommApi {
|
||||
/**
|
||||
* 自动驾驶设备基础信息应答
|
||||
*
|
||||
* @param sn SN
|
||||
* @param environment 环境 详情参见{@link Constants.ENVIRONMENT}1: 研发环境, 2:测试环境, 3:生产环境 4:演示环境
|
||||
* @param role 终端角色 详情参见{@link Constants.TERMINAL_ROLE}
|
||||
* @return 加入WS发送消息队列是否成功
|
||||
* @param sn SN
|
||||
* @param environment 环境 详情参见{@link Constants.ENVIRONMENT}1: 研发环境, 2:测试环境, 3:生产环境 4:演示环境
|
||||
* @param role 终端角色 详情参见{@link Constants.TERMINAL_ROLE}
|
||||
* @param versionCode 鹰眼版本号
|
||||
* @param versionName 鹰眼版本名
|
||||
* @param certification 鹰眼ssl证书
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendBasicInfoResp(@NonNull String sn, @Define.Environment int environment, @Define.TerminalRole int role);
|
||||
boolean sendBasicInfoResp(@NonNull String sn, @Define.Environment int environment, @Define.TerminalRole int role, int versionCode, String versionName, byte[] certification);
|
||||
|
||||
/**
|
||||
* 设置自动驾驶模式 启动自动驾驶
|
||||
@@ -252,16 +256,18 @@ public interface IAdasNetCommApi {
|
||||
/**
|
||||
* 发送 轨迹下载请求
|
||||
*
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param line 线路相关参数详情见PB message_pad.proto -> Line
|
||||
* @param downloadType 下载类型: 0:正常下载 1:预下载
|
||||
* @return 加入WS发送消息队列是否成功
|
||||
*/
|
||||
boolean sendTrajectoryDownloadReq(MessagePad.Line line);
|
||||
boolean sendTrajectoryDownloadReq(MessagePad.Line line, int downloadType);
|
||||
|
||||
/**
|
||||
* 发送 状态查询请求
|
||||
*
|
||||
* @return 加入WS发送消息队列是否成功
|
||||
*/
|
||||
@Deprecated//HQ、M1 MAP350开始弃用,其他车型MAP360开始弃用
|
||||
boolean sendStatusQueryReq();
|
||||
|
||||
/**
|
||||
@@ -483,14 +489,7 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
boolean sendOperatorCmdStopHonking();
|
||||
|
||||
/**
|
||||
* 设置参数命令
|
||||
*
|
||||
* @param type 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
|
||||
* @param value 转成字符串的值
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendSetParamReq(int type, String value);
|
||||
/*******************************设置参数命令 包括V1************************************/
|
||||
|
||||
/**
|
||||
* 绕障类功能开关
|
||||
@@ -563,6 +562,72 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
boolean sendWeakNetSlowDown(int enable);
|
||||
|
||||
/**
|
||||
* 故障减速停车策路开关
|
||||
*
|
||||
* @param enable 0:关闭故障减速停车策略 1:使用故障减速停车策略
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendBreakdownSlowDown(int enable);
|
||||
|
||||
/**
|
||||
* 融合模式
|
||||
*
|
||||
* @param cmd 1:全融合模式 2:盲区模式 3:超视距模式 4:透传模式 5:纯路侧模式,默认1
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendFusionMode(int cmd);
|
||||
|
||||
/*******************************设置参数命令 V2************************************/
|
||||
/**
|
||||
* 盲区数据开关
|
||||
*
|
||||
* @param switchCmd 数据开关
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendBlindAreaCmd(boolean switchCmd);
|
||||
|
||||
|
||||
/**
|
||||
* 控制V2N进PnC
|
||||
*
|
||||
* @param switchCmd true:发给PnC,false:不发给PnC
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendV2nToPncCmd(boolean switchCmd);
|
||||
|
||||
/**
|
||||
* 控制V2I进PnC
|
||||
*
|
||||
* @param switchCmd true:发给Pnc和鹰眼,false:不发给PnC和鹰眼 默认false
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendV2iToPncCmd(boolean switchCmd);
|
||||
|
||||
/*******************************设置参数命令 批量设置************************************/
|
||||
|
||||
/**
|
||||
* 批量设置参数命令
|
||||
*
|
||||
* @param param {@link AdasConstants.MapSystemParamType#DETOURING Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#DETOURING_SPEED Value类型:double或double类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#AEB Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#LANE_CHANGE_RESTRAIN_VALID Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#STOP_YIELD_VALID Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#HADMAP_SPEED_LIMIT_VALID Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#RAMP_THETA_VALID Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#WEAK_NET_SLOW_DOWN Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#BREAKDOWN_SLOW_DOWN Value类型:int或int类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#BLIND_AREA Value类型:boolean或boolean类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#V2N_TO_PNC Value类型:boolean或boolean类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#V2I_TO_PNC Value类型:boolean或boolean类型String}
|
||||
* {@link AdasConstants.MapSystemParamType#FUSION_MODE Value类型:int或int类型String}
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendSetParamReq(@NonNull Map<AdasConstants.MapSystemParamType, Object> param);
|
||||
|
||||
/*******************************设置参数命令 获取参数************************************/
|
||||
|
||||
/**
|
||||
* 获取全部参数
|
||||
*
|
||||
@@ -576,9 +641,9 @@ public interface IAdasNetCommApi {
|
||||
* @param paramType 参数类型:libraries/mogo-adas-data/src/main/proto/personal/adas_constants.proto
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendGetParamReq(AdasConstants.MapSystemParamType paramType);
|
||||
|
||||
boolean sendGetParamReq(AdasConstants.MapSystemParamType... paramType);
|
||||
|
||||
/*******************************设置参数命令************************************/
|
||||
/**
|
||||
* 发生行程相关
|
||||
* type=1或2的时 需要参数 lineName
|
||||
@@ -602,22 +667,6 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
boolean sendBagManagerCmd(BagManagerOuterClass.BagManager bagManager);
|
||||
|
||||
/**
|
||||
* 控制V2N数据给车端PnC
|
||||
*
|
||||
* @param switchCmd true为发给PnC,false为不发给PnC
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendV2nToPncCmd(boolean switchCmd);
|
||||
|
||||
/**
|
||||
* 盲区数据开关
|
||||
*
|
||||
* @param switchCmd 数据开关
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendBlindAreaCmd(boolean switchCmd);
|
||||
|
||||
/**
|
||||
* FSM状态原因查询
|
||||
* 当FSMFunctionStates的类型是XXX_DRIVING_OFF时查询OFF的原因
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.zhidao.support.adas.high.common.ProtocolStatus;
|
||||
import com.zhjt.mogo.adas.data.AdasConstants;
|
||||
import com.zhjt.mogo.adas.data.bean.AdasParam;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableAutopilotReason;
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask;
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask;
|
||||
@@ -19,6 +20,8 @@ import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import chassis.VehicleStateOuterClass;
|
||||
@@ -31,6 +34,7 @@ import perception.TrafficLightOuterClass;
|
||||
import planning.RoboSweeperTaskIndexOuterClass;
|
||||
import prediction.Prediction;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
import system_master.SsmInfo;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
/**
|
||||
@@ -194,8 +198,19 @@ public interface OnAdasListener {
|
||||
* @param header 头
|
||||
* @param statusInfo 数据
|
||||
*/
|
||||
@Deprecated//HQ、M1 MAP350开始弃用,其他车型MAP360开始弃用
|
||||
void onStatusQueryResp(MessagePad.Header header, SystemStatusInfo.StatusInfo statusInfo);
|
||||
|
||||
/**
|
||||
* 定频SSM接口
|
||||
* 1hz hq m1 MAP350开始支持,其他车型MAP360开始支持
|
||||
* 定频SSM接入后 onStatusQueryResp 状态查询应答接口将弃用
|
||||
*
|
||||
* @param header 头
|
||||
* @param statusInf 数据
|
||||
*/
|
||||
void onSystemStatus(MessagePad.Header header, SsmInfo.SsmStatusInf statusInf);
|
||||
|
||||
/**
|
||||
* 数据采集配置应答
|
||||
*
|
||||
@@ -406,7 +421,7 @@ public interface OnAdasListener {
|
||||
/**
|
||||
* 参数获取应答
|
||||
* <p>
|
||||
* 调用{@link AdasManager#sendGetAllParamReq()}或{@link AdasManager#sendGetParamReq(AdasConstants.MapSystemParamType)}
|
||||
* 调用{@link AdasManager#sendGetAllParamReq()}或{@link AdasManager#sendGetParamReq(AdasConstants.MapSystemParamType...)}
|
||||
* 如果对应的value是空串,说明没有这个param或者get失败了。重启后值还是在redis里
|
||||
*
|
||||
* @param header 头
|
||||
@@ -430,10 +445,11 @@ public interface OnAdasListener {
|
||||
/**
|
||||
* 是否有能力启动自动驾驶
|
||||
*
|
||||
* @param isAutopilotAbility 是否能启动自动驾驶
|
||||
* @param unableAutopilotReason 不能启动自动驾驶原因
|
||||
* @param isAutopilotAbility 是否能启动自动驾驶
|
||||
* @param unableAutopilotReasons 不能启动自动驾驶原因
|
||||
*/
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, String unableAutopilotReason);
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @Nullable ArrayList<UnableAutopilotReason> unableAutopilotReasons);
|
||||
|
||||
|
||||
/**
|
||||
* 启动自动驾驶失败回调
|
||||
|
||||
@@ -30,6 +30,7 @@ public enum MessageType {
|
||||
TYPE_RECEIVE_FUNCTION_STATES(MessagePad.MessageType.MsgTypeFunctionStates, "重构后功能状态"),
|
||||
TYPE_RECEIVE_BACK_CAMERA_VIDEO(MessagePad.MessageType.MsgTypeBackCameraVideo, "后摄像头"),
|
||||
TYPE_RECEIVE_M1_STITCHED_VIDEO(MessagePad.MessageType.MsgTypeM1StitchedVideo, "M1拼接视频"),
|
||||
TYPE_RECEIVE_SSM(MessagePad.MessageType.MsgTypeSSMState, "SSM系统状态"),
|
||||
|
||||
TYPE_RECEIVE_BASIC_INFO_REQ(MessagePad.MessageType.MsgTypeBasicInfoReq, "自动驾驶设备基础信息请求"),
|
||||
TYPE_SEND_BASIC_INFO_RESP(MessagePad.MessageType.MsgTypeBasicInfoResp, "自动驾驶设备基础信息应答"),
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
package com.zhidao.support.adas.high.common;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Network;
|
||||
import android.net.NetworkRequest;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@@ -13,15 +23,17 @@ public class ReconnectManager {
|
||||
private final AtomicBoolean isReconnection = new AtomicBoolean(false);//是否正在重连
|
||||
private final OnReconnectListener listener;
|
||||
private volatile Timer timer;
|
||||
private final Context context;
|
||||
private final AtomicBoolean isRegisterNetworkCallback = new AtomicBoolean(false);
|
||||
|
||||
public interface OnReconnectListener {
|
||||
void onReconnection();
|
||||
void onReconnection(String tag);
|
||||
}
|
||||
|
||||
|
||||
public ReconnectManager(OnReconnectListener listener) {
|
||||
public ReconnectManager(Context context, OnReconnectListener listener) {
|
||||
this.context = context;
|
||||
this.listener = listener;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,6 +48,12 @@ public class ReconnectManager {
|
||||
if (!isReconnection.get()) {
|
||||
CupidLogUtils.i(TAG, "开始重连");
|
||||
isReconnection.set(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkRequest networkRequest = new NetworkRequest.Builder().build();
|
||||
connMgr.registerNetworkCallback(networkRequest, networkCallback);
|
||||
isRegisterNetworkCallback.set(true);
|
||||
}
|
||||
if (timer == null) {
|
||||
timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
@@ -43,7 +61,7 @@ public class ReconnectManager {
|
||||
public void run() {
|
||||
if (isReconnection.get()) {
|
||||
if (listener != null)
|
||||
listener.onReconnection();
|
||||
listener.onReconnection("定时器");
|
||||
}
|
||||
}
|
||||
}, 0, RECONNECT_INTERVAL);//延时
|
||||
@@ -54,11 +72,26 @@ public class ReconnectManager {
|
||||
public synchronized void stop() {
|
||||
CupidLogUtils.i(TAG, "停止重连");
|
||||
isReconnection.set(false);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && isRegisterNetworkCallback.get()) {
|
||||
ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
connMgr.unregisterNetworkCallback(networkCallback);
|
||||
isRegisterNetworkCallback.set(false);
|
||||
}
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private final ConnectivityManager.NetworkCallback networkCallback = new ConnectivityManager.NetworkCallback() {
|
||||
@Override
|
||||
public void onAvailable(@NonNull Network network) {
|
||||
super.onAvailable(network);
|
||||
Log.i(TAG, "网络连接成功");
|
||||
if (listener != null)
|
||||
listener.onReconnection("网络监听");
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhjt.mogo.adas.data.bean.UnableAutopilotReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
@@ -15,41 +20,44 @@ import chassis.ChassisStatesOuterClass;
|
||||
*/
|
||||
public class AutopilotAbility230 {
|
||||
private static final String TAG = AutopilotAbility230.class.getSimpleName();
|
||||
private static final long DEFAULT_DETECTION_TIME = 3 * 1000L;//默认检测时间
|
||||
private volatile Timer timer;
|
||||
private ChassisStatesOuterClass.ChassisStates chassisStates;
|
||||
private OnAutopilotAbilityListener listener;
|
||||
|
||||
public AutopilotAbility230() {
|
||||
protected interface OnAutopilotAbilityListener {
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @Nullable ArrayList<UnableAutopilotReason> unableAutopilotReasons);
|
||||
}
|
||||
|
||||
protected AutopilotAbility230() {
|
||||
}
|
||||
|
||||
|
||||
public void setChassisStates(ChassisStatesOuterClass.ChassisStates chassisStates) {
|
||||
protected void setChassisStates(ChassisStatesOuterClass.ChassisStates chassisStates) {
|
||||
this.chassisStates = chassisStates;
|
||||
}
|
||||
|
||||
|
||||
private void onCallback() {
|
||||
boolean isAutopilotAbility = true;//是否能启动自动驾驶
|
||||
String unableAutopilotReason = null;//不能启动自动驾驶原因
|
||||
ArrayList<UnableAutopilotReason> unableAutopilotReasons = null;//不能启动自动驾驶原因
|
||||
//检测底盘相关
|
||||
if (chassisStates != null) {
|
||||
if (chassisStates.hasBrakeSystemStates()) {
|
||||
float brake = chassisStates.getBrakeSystemStates().getBrakePedalResponsePosition();
|
||||
if (brake > 0) {
|
||||
isAutopilotAbility = false;
|
||||
unableAutopilotReason = "制动踏板被踩下";
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.CHASSIS, "制动踏板被踩下");
|
||||
}
|
||||
}
|
||||
if (isAutopilotAbility) {
|
||||
if (chassisStates.hasGearSystemStates()) {
|
||||
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
|
||||
if (!AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear)) {
|
||||
isAutopilotAbility = false;
|
||||
unableAutopilotReason = "档位不正常";
|
||||
}
|
||||
if (chassisStates.hasGearSystemStates()) {
|
||||
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
|
||||
if (!AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear)) {
|
||||
isAutopilotAbility = false;
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.CHASSIS, "档位异常");
|
||||
}
|
||||
}
|
||||
//TODO 关于手刹:不同车型的实现不同所以目前没法使用此字段
|
||||
// if (isAutopilotAbility) {
|
||||
|
||||
// //电子驻车制动系统
|
||||
// if (chassisStates.hasEpbSystemStates()) {
|
||||
// ChassisStatesOuterClass.EPBSystemStates epb = chassisStates.getEpbSystemStates();
|
||||
@@ -57,12 +65,15 @@ public class AutopilotAbility230 {
|
||||
// epb.getEpbWorkState();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReasons);
|
||||
}
|
||||
AutopilotAbilityManager.getInstance().onAutopilotAbility(isAutopilotAbility, unableAutopilotReason);
|
||||
}
|
||||
|
||||
public synchronized void start() {
|
||||
protected synchronized void start(OnAutopilotAbilityListener listener) {
|
||||
this.listener = listener;
|
||||
if (timer == null) {
|
||||
timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
@@ -70,17 +81,16 @@ public class AutopilotAbility230 {
|
||||
public void run() {
|
||||
onCallback();
|
||||
}
|
||||
}, 2000L, DEFAULT_DETECTION_TIME);//延迟执行,避免刚连接成功后底盘信息无法及时同步
|
||||
}, 2000L, AutopilotAbilityManager.DEFAULT_DETECTION_TIME);//延迟执行,避免刚连接成功后底盘信息无法及时同步
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void stop() {
|
||||
protected synchronized void stop() {
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
timer = null;
|
||||
}
|
||||
this.chassisStates = null;
|
||||
this.listener = null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import android.os.Message;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableAutopilotReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
@@ -22,36 +24,42 @@ import system_master.SystemStatusInfo;
|
||||
*/
|
||||
public class AutopilotAbility250 {
|
||||
private static final String TAG = AutopilotAbility250.class.getSimpleName();
|
||||
private static final int WHAT_TIMEOUT = 0;
|
||||
private static final int DEFAULT_TIMEOUT = 1500;
|
||||
private static final long DEFAULT_DETECTION_TIME = 3 * 1000L;//默认检测时间
|
||||
private static final String[] NODE_INFO_STATE = {"未知状态 ", "依赖未就绪 ", "启动中 ", "运行 ", "停止 ", "无法启动状态 ", "人为启动状态 ", "人为关闭状态 "};
|
||||
private volatile Timer timer;
|
||||
private ChassisStatesOuterClass.ChassisStates chassisStates;
|
||||
private int mapVersion = -1;//MAP版本
|
||||
private int masterVersion = -1;//Master版本
|
||||
private OnAutopilotAbilityListener listener;
|
||||
|
||||
public AutopilotAbility250(int mapVersion) {
|
||||
protected interface OnAutopilotAbilityListener {
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @Nullable ArrayList<UnableAutopilotReason> unableAutopilotReasons);
|
||||
|
||||
void onStatusQuery();
|
||||
|
||||
void onSendTimeoutMessages();
|
||||
|
||||
void onRemoveTimeoutMessages();
|
||||
}
|
||||
|
||||
protected AutopilotAbility250(int mapVersion) {
|
||||
this.mapVersion = mapVersion;
|
||||
this.masterVersion = -1;
|
||||
}
|
||||
|
||||
|
||||
public void setStatusInfo(SystemStatusInfo.StatusInfo statusInfo) {
|
||||
if (AutopilotAbilityManager.getInstance().getHandler() != null) {
|
||||
if (AutopilotAbilityManager.getInstance().getHandler().hasMessages(WHAT_TIMEOUT))
|
||||
AutopilotAbilityManager.getInstance().getHandler().removeMessages(WHAT_TIMEOUT);
|
||||
protected void setStatusInfo(SystemStatusInfo.StatusInfo statusInfo) {
|
||||
if (listener != null) {
|
||||
listener.onRemoveTimeoutMessages();
|
||||
}
|
||||
onCallback(statusInfo);
|
||||
}
|
||||
|
||||
public void setChassisStates(ChassisStatesOuterClass.ChassisStates chassisStates) {
|
||||
protected void setChassisStates(ChassisStatesOuterClass.ChassisStates chassisStates) {
|
||||
this.chassisStates = chassisStates;
|
||||
}
|
||||
|
||||
private void onCallback(SystemStatusInfo.StatusInfo statusInfo) {
|
||||
boolean isAutopilotAbility = true;//是否能启动自动驾驶
|
||||
String unableAutopilotReason = null;//不能启动自动驾驶原因
|
||||
ArrayList<UnableAutopilotReason> unableAutopilotReasons = null;//不能启动自动驾驶原因
|
||||
//检测节点状态相关
|
||||
if (statusInfo != null) {
|
||||
if (masterVersion == -1 && statusInfo.hasMasterVersion()) {
|
||||
@@ -63,7 +71,7 @@ public class AutopilotAbility250 {
|
||||
if (mapVersion >= 30400 && masterVersion > 2 && statusInfo.hasAutoPilotReady() && statusInfo.hasAutoPilotUnreadyReason()) {
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
if (!isAutopilotAbility) {
|
||||
unableAutopilotReason = statusInfo.getAutoPilotUnreadyReason();
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, statusInfo.getAutoPilotUnreadyReason());
|
||||
}
|
||||
} else if (mapVersion >= 21000 && masterVersion > 1 && statusInfo.hasAutoPilotReady()) {//如果 maser version 大于1,还需要判断AutoPilotReady字段是否存在,以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
@@ -71,19 +79,17 @@ public class AutopilotAbility250 {
|
||||
SystemStatusInfo.NodeFaultList nodeFaultList = statusInfo.getAutoPilotUnreadyList();
|
||||
if (nodeFaultList.getSum() > 0) {
|
||||
List<SystemStatusInfo.NodeInfo> list = nodeFaultList.getNodeList();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (SystemStatusInfo.NodeInfo info : list) {
|
||||
builder.append(info.getNodeName());
|
||||
String nodeName = info.getNodeName();
|
||||
int state = info.getState();
|
||||
if (state < NODE_INFO_STATE.length) {
|
||||
builder.append(NODE_INFO_STATE[state]);
|
||||
if (state < AutopilotAbilityManager.NODE_INFO_STATE.length) {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, nodeName + AutopilotAbilityManager.NODE_INFO_STATE[state]);
|
||||
} else {
|
||||
builder.append("未知异常 ");
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, nodeName + "未知异常");
|
||||
}
|
||||
}
|
||||
unableAutopilotReason = builder.toString();
|
||||
} else {
|
||||
unableAutopilotReason = "未知异常节点";
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, "未知异常节点");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -91,6 +97,7 @@ public class AutopilotAbility250 {
|
||||
// 目前已知可以下发启动自驾命令的状态: SystemState.SYS_RUNNING、SystemState.PILOT_READY、SystemState.AUTO_PILOT_STARTING、SystemState.AUTO_PILOT_RUNNING
|
||||
if (systemState != SystemStatusInfo.SystemState.SYS_RUNNING && systemState != SystemStatusInfo.SystemState.PILOT_READY) {
|
||||
isAutopilotAbility = false;
|
||||
String unableAutopilotReason = null;
|
||||
if (systemState == SystemStatusInfo.SystemState.SYS_STARTING) {
|
||||
unableAutopilotReason = "系统正在启动";
|
||||
} else if (systemState == SystemStatusInfo.SystemState.SYS_EXITING) {
|
||||
@@ -112,34 +119,33 @@ public class AutopilotAbility250 {
|
||||
} else {
|
||||
unableAutopilotReason = "未知系统状态";
|
||||
}
|
||||
if (!isAutopilotAbility) {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, unableAutopilotReason);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
isAutopilotAbility = false;//是否能启动自动驾驶
|
||||
unableAutopilotReason = "SSM状态查询超时无响应";//不能启动自动驾驶原因
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.LIB, "SSM状态查询超时无响应");
|
||||
}
|
||||
//检测底盘相关
|
||||
if (chassisStates != null) {
|
||||
if (isAutopilotAbility) {
|
||||
if (chassisStates.hasBrakeSystemStates()) {
|
||||
float brake = chassisStates.getBrakeSystemStates().getBrakePedalResponsePosition();
|
||||
if (brake > 0) {
|
||||
isAutopilotAbility = false;
|
||||
unableAutopilotReason = "制动踏板被踩下";
|
||||
}
|
||||
if (chassisStates.hasBrakeSystemStates()) {
|
||||
float brake = chassisStates.getBrakeSystemStates().getBrakePedalResponsePosition();
|
||||
if (brake > 0) {
|
||||
isAutopilotAbility = false;
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.CHASSIS, "制动踏板被踩下");
|
||||
}
|
||||
}
|
||||
if (isAutopilotAbility) {
|
||||
if (chassisStates.hasGearSystemStates()) {
|
||||
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
|
||||
if (!AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear)) {
|
||||
isAutopilotAbility = false;
|
||||
unableAutopilotReason = "档位不正常";
|
||||
}
|
||||
if (chassisStates.hasGearSystemStates()) {
|
||||
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
|
||||
if (!AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear)) {
|
||||
isAutopilotAbility = false;
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.CHASSIS, "档位异常");
|
||||
}
|
||||
}
|
||||
//TODO 关于手刹:不同车型的实现不同所以目前没法使用此字段
|
||||
// if (isAutopilotAbility) {
|
||||
|
||||
// //电子驻车制动系统
|
||||
// if (chassisStates.hasEpbSystemStates()) {
|
||||
// ChassisStatesOuterClass.EPBSystemStates epb = chassisStates.getEpbSystemStates();
|
||||
@@ -147,45 +153,45 @@ public class AutopilotAbility250 {
|
||||
// epb.getEpbWorkState();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReasons);
|
||||
}
|
||||
AutopilotAbilityManager.getInstance().onAutopilotAbility(isAutopilotAbility, unableAutopilotReason);
|
||||
}
|
||||
|
||||
public synchronized void start() {
|
||||
protected synchronized void start(OnAutopilotAbilityListener listener) {
|
||||
this.listener = listener;
|
||||
if (timer == null) {
|
||||
timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (AutopilotAbilityManager.getInstance().getOnAutopilotAbilityListener() != null) {
|
||||
AutopilotAbilityManager.getInstance().getOnAutopilotAbilityListener().onStatusQuery();
|
||||
if (listener != null) {
|
||||
listener.onStatusQuery();
|
||||
}
|
||||
AdasManager.getInstance().sendStatusQueryReq();
|
||||
if (AutopilotAbilityManager.getInstance().getHandler() != null) {
|
||||
if (AutopilotAbilityManager.getInstance().getHandler().hasMessages(WHAT_TIMEOUT))
|
||||
AutopilotAbilityManager.getInstance().getHandler().removeMessages(WHAT_TIMEOUT);
|
||||
AutopilotAbilityManager.getInstance().getHandler().sendEmptyMessageDelayed(WHAT_TIMEOUT, DEFAULT_TIMEOUT);
|
||||
if (listener != null) {
|
||||
listener.onSendTimeoutMessages();
|
||||
}
|
||||
}
|
||||
}, 2000L, DEFAULT_DETECTION_TIME);//延迟执行,避免刚连接成功后底盘信息无法及时同步
|
||||
}, 2000L, AutopilotAbilityManager.DEFAULT_DETECTION_TIME);//延迟执行,避免刚连接成功后底盘信息无法及时同步
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void stop() {
|
||||
protected synchronized void stop() {
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
timer = null;
|
||||
}
|
||||
this.chassisStates = null;
|
||||
this.masterVersion = -1;
|
||||
this.listener = null;
|
||||
}
|
||||
|
||||
|
||||
public void onHandleMessage(Message msg) {
|
||||
if (msg.what == WHAT_TIMEOUT) {
|
||||
onCallback(null);
|
||||
}
|
||||
protected void onCallTimeout() {
|
||||
onCallback(null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableAutopilotReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
@@ -22,29 +26,35 @@ import system_master.SystemStatusInfo;
|
||||
*/
|
||||
public class AutopilotAbility330 {
|
||||
private static final String TAG = AutopilotAbility330.class.getSimpleName();
|
||||
private static final int WHAT_TIMEOUT = 0;
|
||||
private static final int DEFAULT_TIMEOUT = 1500;
|
||||
private static final long DEFAULT_DETECTION_TIME = 3 * 1000L;//默认检测时间
|
||||
private static final String[] NODE_INFO_STATE = {"未知状态 ", "依赖未就绪 ", "启动中 ", "运行 ", "停止 ", "无法启动状态 ", "人为启动状态 ", "人为关闭状态 "};
|
||||
private volatile Timer timer;
|
||||
|
||||
private volatile FSMStatusReasonQueryOuterClass.FSMStatusReasonRespond fsmStatusReasonRespond;//自动驾驶状态为OFF的原因
|
||||
private int mapVersion = -1;//MAP版本
|
||||
private int masterVersion = -1;//Master版本
|
||||
private OnAutopilotAbilityListener listener;
|
||||
|
||||
public AutopilotAbility330(int mapVersion) {
|
||||
protected interface OnAutopilotAbilityListener {
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @Nullable ArrayList<UnableAutopilotReason> unableAutopilotReasons);
|
||||
|
||||
void onStatusQuery();
|
||||
|
||||
void onSendTimeoutMessages();
|
||||
|
||||
void onRemoveTimeoutMessages();
|
||||
}
|
||||
|
||||
protected AutopilotAbility330(int mapVersion) {
|
||||
this.mapVersion = mapVersion;
|
||||
this.masterVersion = -1;
|
||||
}
|
||||
|
||||
public synchronized void setFsmStatusReasonRespond(FSMStatusReasonQueryOuterClass.FSMStatusReasonRespond fsmStatusReasonRespond) {
|
||||
protected synchronized void setFsmStatusReasonRespond(FSMStatusReasonQueryOuterClass.FSMStatusReasonRespond fsmStatusReasonRespond) {
|
||||
this.fsmStatusReasonRespond = fsmStatusReasonRespond;
|
||||
}
|
||||
|
||||
public void setStatusInfo(SystemStatusInfo.StatusInfo statusInfo) {
|
||||
if (AutopilotAbilityManager.getInstance().getHandler() != null) {
|
||||
if (AutopilotAbilityManager.getInstance().getHandler().hasMessages(WHAT_TIMEOUT))
|
||||
AutopilotAbilityManager.getInstance().getHandler().removeMessages(WHAT_TIMEOUT);
|
||||
protected void setStatusInfo(SystemStatusInfo.StatusInfo statusInfo) {
|
||||
if (listener != null) {
|
||||
listener.onRemoveTimeoutMessages();
|
||||
}
|
||||
onCallback(statusInfo);
|
||||
}
|
||||
@@ -52,7 +62,7 @@ public class AutopilotAbility330 {
|
||||
|
||||
private void onCallback(SystemStatusInfo.StatusInfo statusInfo) {
|
||||
boolean isAutopilotAbility = true;//是否能启动自动驾驶
|
||||
String unableAutopilotReason = null;//不能启动自动驾驶原因
|
||||
ArrayList<UnableAutopilotReason> unableAutopilotReasons = null;//不能启动自动驾驶原因
|
||||
//检测节点状态相关
|
||||
if (statusInfo != null) {
|
||||
if (masterVersion == -1 && statusInfo.hasMasterVersion()) {
|
||||
@@ -64,7 +74,7 @@ public class AutopilotAbility330 {
|
||||
if (mapVersion >= 30400 && masterVersion > 2 && statusInfo.hasAutoPilotReady() && statusInfo.hasAutoPilotUnreadyReason()) {
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
if (!isAutopilotAbility) {
|
||||
unableAutopilotReason = statusInfo.getAutoPilotUnreadyReason();
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, statusInfo.getAutoPilotUnreadyReason());
|
||||
}
|
||||
} else if (mapVersion >= 21000 && masterVersion > 1 && statusInfo.hasAutoPilotReady()) {//如果 maser version 大于1,还需要判断AutoPilotReady字段是否存在,以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
@@ -72,19 +82,17 @@ public class AutopilotAbility330 {
|
||||
SystemStatusInfo.NodeFaultList nodeFaultList = statusInfo.getAutoPilotUnreadyList();
|
||||
if (nodeFaultList.getSum() > 0) {
|
||||
List<SystemStatusInfo.NodeInfo> list = nodeFaultList.getNodeList();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (SystemStatusInfo.NodeInfo info : list) {
|
||||
builder.append(info.getNodeName());
|
||||
String nodeName = info.getNodeName();
|
||||
int state = info.getState();
|
||||
if (state < NODE_INFO_STATE.length) {
|
||||
builder.append(NODE_INFO_STATE[state]);
|
||||
if (state < AutopilotAbilityManager.NODE_INFO_STATE.length) {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, nodeName + AutopilotAbilityManager.NODE_INFO_STATE[state]);
|
||||
} else {
|
||||
builder.append("未知异常 ");
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, nodeName + "未知异常");
|
||||
}
|
||||
}
|
||||
unableAutopilotReason = builder.toString();
|
||||
} else {
|
||||
unableAutopilotReason = "未知异常节点";
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, "未知异常节点");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -92,6 +100,7 @@ public class AutopilotAbility330 {
|
||||
// 目前已知可以下发启动自驾命令的状态: SystemState.SYS_RUNNING、SystemState.PILOT_READY、SystemState.AUTO_PILOT_STARTING、SystemState.AUTO_PILOT_RUNNING
|
||||
if (systemState != SystemStatusInfo.SystemState.SYS_RUNNING && systemState != SystemStatusInfo.SystemState.PILOT_READY) {
|
||||
isAutopilotAbility = false;
|
||||
String unableAutopilotReason = null;
|
||||
if (systemState == SystemStatusInfo.SystemState.SYS_STARTING) {
|
||||
unableAutopilotReason = "系统正在启动";
|
||||
} else if (systemState == SystemStatusInfo.SystemState.SYS_EXITING) {
|
||||
@@ -113,67 +122,66 @@ public class AutopilotAbility330 {
|
||||
} else {
|
||||
unableAutopilotReason = "未知系统状态";
|
||||
}
|
||||
if (!isAutopilotAbility) {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, unableAutopilotReason);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
isAutopilotAbility = false;//是否能启动自动驾驶
|
||||
unableAutopilotReason = "SSM状态查询超时无响应";//不能启动自动驾驶原因
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.LIB, "SSM状态查询超时无响应");
|
||||
}
|
||||
if (isAutopilotAbility) {
|
||||
if (fsmStatusReasonRespond != null) {
|
||||
int count = fsmStatusReasonRespond.getFsmStatusReasonRespondCount();
|
||||
StringBuilder builder = null;
|
||||
if (count > 0) {
|
||||
builder = new StringBuilder();
|
||||
for (int i = 0; i < count; i++) {
|
||||
String respond = fsmStatusReasonRespond.getFsmStatusReasonRespond(i);
|
||||
builder.append(respond).append(' ');
|
||||
if (fsmStatusReasonRespond != null) {
|
||||
int count = fsmStatusReasonRespond.getFsmStatusReasonRespondCount();
|
||||
if (count > 0) {
|
||||
isAutopilotAbility = false;
|
||||
for (int i = 0; i < count; i++) {
|
||||
String respond = fsmStatusReasonRespond.getFsmStatusReasonRespond(i);
|
||||
if (!TextUtils.isEmpty(respond)) {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.FSM, respond);
|
||||
}
|
||||
}
|
||||
if (builder != null) {
|
||||
isAutopilotAbility = false;
|
||||
builder.deleteCharAt(builder.length() - 1);//删除末尾
|
||||
unableAutopilotReason = builder.toString();
|
||||
if (unableAutopilotReasons == null || unableAutopilotReasons.isEmpty()) {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.LIB, "FSM数据异常");
|
||||
}
|
||||
}
|
||||
}
|
||||
AutopilotAbilityManager.getInstance().onAutopilotAbility(isAutopilotAbility, unableAutopilotReason);
|
||||
if (listener != null) {
|
||||
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReasons);
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void start() {
|
||||
protected synchronized void start(OnAutopilotAbilityListener listener) {
|
||||
this.listener = listener;
|
||||
if (timer == null) {
|
||||
timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (AutopilotAbilityManager.getInstance().getOnAutopilotAbilityListener() != null) {
|
||||
AutopilotAbilityManager.getInstance().getOnAutopilotAbilityListener().onStatusQuery();
|
||||
if (listener != null) {
|
||||
listener.onStatusQuery();
|
||||
}
|
||||
AdasManager.getInstance().sendStatusQueryReq();
|
||||
if (AutopilotAbilityManager.getInstance().getHandler() != null) {
|
||||
if (AutopilotAbilityManager.getInstance().getHandler().hasMessages(WHAT_TIMEOUT))
|
||||
AutopilotAbilityManager.getInstance().getHandler().removeMessages(WHAT_TIMEOUT);
|
||||
AutopilotAbilityManager.getInstance().getHandler().sendEmptyMessageDelayed(WHAT_TIMEOUT, DEFAULT_TIMEOUT);
|
||||
if (listener != null) {
|
||||
listener.onSendTimeoutMessages();
|
||||
}
|
||||
}
|
||||
}, 2000L, DEFAULT_DETECTION_TIME);//延迟执行,避免刚连接成功后底盘信息无法及时同步
|
||||
}, 2000L, AutopilotAbilityManager.DEFAULT_DETECTION_TIME);//延迟执行,避免刚连接成功后底盘信息无法及时同步
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void stop() {
|
||||
protected synchronized void stop() {
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
timer = null;
|
||||
}
|
||||
this.masterVersion = -1;
|
||||
this.listener = null;
|
||||
}
|
||||
|
||||
|
||||
public void onHandleMessage(Message msg) {
|
||||
if (msg.what == WHAT_TIMEOUT) {
|
||||
onCallback(null);
|
||||
}
|
||||
protected void onCallTimeout() {
|
||||
onCallback(null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableAutopilotReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import system_master.SsmInfo;
|
||||
|
||||
/**
|
||||
* 是否可以启动自动驾驶能力检测 工控机版本>=350&&(isHQ||isJinlvM1) || 工控机版本>=360&&!isFutianSweeper 使用此类
|
||||
* 目前监控了定频SSM的数据和FSM状态原因查询
|
||||
* 没有使用监控事件报告的原因是因为,部分异常没进行正常恢复通知,例如收到了异常监控数据,但是异常恢复之后没有恢复的通知
|
||||
* <p>
|
||||
*/
|
||||
public class AutopilotAbility350And360 {
|
||||
private static final String TAG = AutopilotAbility250.class.getSimpleName();
|
||||
private ChassisStatesOuterClass.ChassisStates chassisStates;
|
||||
private int masterVersion = -1;//Master版本
|
||||
private OnAutopilotAbilityListener listener;
|
||||
|
||||
protected interface OnAutopilotAbilityListener {
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @Nullable ArrayList<UnableAutopilotReason> unableAutopilotReasons);
|
||||
|
||||
}
|
||||
|
||||
protected AutopilotAbility350And360() {
|
||||
this.masterVersion = -1;
|
||||
}
|
||||
|
||||
|
||||
protected void setStatusInfo(SsmInfo.SsmStatusInf statusInfo) {
|
||||
|
||||
onCallback(statusInfo);
|
||||
}
|
||||
|
||||
protected void setChassisStates(ChassisStatesOuterClass.ChassisStates chassisStates) {
|
||||
this.chassisStates = chassisStates;
|
||||
}
|
||||
|
||||
private void onCallback(SsmInfo.SsmStatusInf statusInfo) {
|
||||
boolean isAutopilotAbility = true;//是否能启动自动驾驶
|
||||
ArrayList<UnableAutopilotReason> unableAutopilotReasons = null;//不能启动自动驾驶原因
|
||||
//检测节点状态相关
|
||||
if (statusInfo != null) {
|
||||
if (masterVersion == -1 && statusInfo.hasMasterVersion()) {
|
||||
//截取Master Version
|
||||
masterVersion = AdasManager.getInstance().parseVersion(false, statusInfo.getMasterVersion());
|
||||
}
|
||||
CupidLogUtils.i(TAG, "MasterVersion=" + masterVersion);
|
||||
//SSM 3版本兼容
|
||||
if (masterVersion > 2 && statusInfo.hasAutoPilotReady() && statusInfo.hasAutoPilotUnreadyReason()) {
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
if (!isAutopilotAbility) {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, statusInfo.getAutoPilotUnreadyReason());
|
||||
}
|
||||
} else if (masterVersion > 1 && statusInfo.hasAutoPilotReady()) {//如果 maser version 大于1,还需要判断AutoPilotReady字段是否存在,以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
if (!isAutopilotAbility) {
|
||||
int count = statusInfo.getAutoPilotUnreadyListCount();
|
||||
if (count > 0) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
SsmInfo.NodeInf info = statusInfo.getAutoPilotUnreadyList(i);
|
||||
String nodeName = info.getNodeName();
|
||||
int state = info.getState().getNumber();
|
||||
if (state < AutopilotAbilityManager.NODE_INFO_STATE_FIXED_FREQUENCY.length) {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, nodeName + AutopilotAbilityManager.NODE_INFO_STATE_FIXED_FREQUENCY[state]);
|
||||
} else {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, nodeName + "未知异常");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, "未知异常节点");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
SsmInfo.ModeState modeState = statusInfo.getModeState();
|
||||
if (modeState != SsmInfo.ModeState.MODE_RUN_UNREADY && modeState != SsmInfo.ModeState.MODE_RUN_READY) {
|
||||
isAutopilotAbility = false;
|
||||
String unableAutopilotReason = null;
|
||||
if (modeState == SsmInfo.ModeState.MODE_STOP_UNREADY) {
|
||||
unableAutopilotReason = "系统处于停止模式(未就绪)";
|
||||
} else if (modeState == SsmInfo.ModeState.MODE_STOP_READY) {
|
||||
unableAutopilotReason = "系统处于停止模式";
|
||||
} else if (modeState == SsmInfo.ModeState.MODE_IDLE_UNREADY) {
|
||||
unableAutopilotReason = "系统处于空闲模式(未就绪)";
|
||||
} else if (modeState == SsmInfo.ModeState.MODE_IDLE_READY) {
|
||||
unableAutopilotReason = "系统处于空闲模式";
|
||||
} else {
|
||||
unableAutopilotReason = "未知系统模式";
|
||||
}
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, unableAutopilotReason);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
isAutopilotAbility = false;//是否能启动自动驾驶
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.LIB, "SSM数据异常");
|
||||
}
|
||||
//检测底盘相关
|
||||
if (chassisStates != null) {
|
||||
if (chassisStates.hasBrakeSystemStates()) {
|
||||
float brake = chassisStates.getBrakeSystemStates().getBrakePedalResponsePosition();
|
||||
if (brake > 0) {
|
||||
isAutopilotAbility = false;
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.CHASSIS, "制动踏板被踩下");
|
||||
}
|
||||
}
|
||||
if (chassisStates.hasGearSystemStates()) {
|
||||
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
|
||||
if (!AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear)) {
|
||||
isAutopilotAbility = false;
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.CHASSIS, "档位异常");
|
||||
}
|
||||
}
|
||||
//TODO 关于手刹:不同车型的实现不同所以目前没法使用此字段
|
||||
|
||||
// //电子驻车制动系统
|
||||
// if (chassisStates.hasEpbSystemStates()) {
|
||||
// ChassisStatesOuterClass.EPBSystemStates epb = chassisStates.getEpbSystemStates();
|
||||
// if (epb.hasEpbEnableState()){
|
||||
// epb.getEpbWorkState();
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReasons);
|
||||
}
|
||||
}
|
||||
|
||||
protected void start(OnAutopilotAbilityListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
protected void stop() {
|
||||
this.chassisStates = null;
|
||||
this.masterVersion = -1;
|
||||
this.listener = null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableAutopilotReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import function_state_management.FSMStatusReasonQueryOuterClass;
|
||||
import system_master.SsmInfo;
|
||||
|
||||
/**
|
||||
* 是否可以启动自动驾驶能力检测 工控机版本>=360&&isFutianSweeper 使用此类
|
||||
* TODO 目前只用于清扫车,其他车型需要MAP支持 FSM的相关功能
|
||||
* 目前监控了定频SSM的数据和FSM状态原因查询
|
||||
* 没有使用监控事件报告的原因是因为,部分异常没进行正常恢复通知,例如收到了异常监控数据,但是异常恢复之后没有恢复的通知
|
||||
*/
|
||||
public class AutopilotAbility360 {
|
||||
private static final String TAG = AutopilotAbility360.class.getSimpleName();
|
||||
|
||||
private volatile FSMStatusReasonQueryOuterClass.FSMStatusReasonRespond fsmStatusReasonRespond;//自动驾驶状态为OFF的原因
|
||||
private int masterVersion = -1;//Master版本
|
||||
private OnAutopilotAbilityListener listener;
|
||||
|
||||
protected interface OnAutopilotAbilityListener {
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @Nullable ArrayList<UnableAutopilotReason> unableAutopilotReasons);
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected AutopilotAbility360() {
|
||||
this.masterVersion = -1;
|
||||
}
|
||||
|
||||
protected synchronized void setFsmStatusReasonRespond(FSMStatusReasonQueryOuterClass.FSMStatusReasonRespond fsmStatusReasonRespond) {
|
||||
this.fsmStatusReasonRespond = fsmStatusReasonRespond;
|
||||
}
|
||||
|
||||
protected void setStatusInfo(SsmInfo.SsmStatusInf statusInfo) {
|
||||
onCallback(statusInfo);
|
||||
}
|
||||
|
||||
|
||||
private void onCallback(SsmInfo.SsmStatusInf statusInfo) {
|
||||
boolean isAutopilotAbility = true;//是否能启动自动驾驶
|
||||
ArrayList<UnableAutopilotReason> unableAutopilotReasons = null;//不能启动自动驾驶原因
|
||||
//检测节点状态相关
|
||||
if (statusInfo != null) {
|
||||
if (masterVersion == -1 && statusInfo.hasMasterVersion()) {
|
||||
//截取Master Version
|
||||
masterVersion = AdasManager.getInstance().parseVersion(false, statusInfo.getMasterVersion());
|
||||
}
|
||||
CupidLogUtils.i(TAG, "MasterVersion=" + masterVersion);
|
||||
//SSM 3版本兼容
|
||||
if (masterVersion > 2 && statusInfo.hasAutoPilotReady() && statusInfo.hasAutoPilotUnreadyReason()) {
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
if (!isAutopilotAbility) {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, statusInfo.getAutoPilotUnreadyReason());
|
||||
}
|
||||
} else if (masterVersion > 1 && statusInfo.hasAutoPilotReady()) {//如果 maser version 大于1,还需要判断AutoPilotReady字段是否存在,以确保MAP版本和SSM Maser版本不陪配情况逻辑能正常执行
|
||||
isAutopilotAbility = statusInfo.getAutoPilotReady();
|
||||
if (!isAutopilotAbility) {
|
||||
int count = statusInfo.getAutoPilotUnreadyListCount();
|
||||
if (count > 0) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
SsmInfo.NodeInf info = statusInfo.getAutoPilotUnreadyList(i);
|
||||
String nodeName = info.getNodeName();
|
||||
int state = info.getState().getNumber();
|
||||
if (state < AutopilotAbilityManager.NODE_INFO_STATE_FIXED_FREQUENCY.length) {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, nodeName + AutopilotAbilityManager.NODE_INFO_STATE_FIXED_FREQUENCY[state]);
|
||||
} else {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, nodeName + "未知异常");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, "未知异常节点");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
SsmInfo.ModeState modeState = statusInfo.getModeState();
|
||||
if (modeState != SsmInfo.ModeState.MODE_RUN_UNREADY && modeState != SsmInfo.ModeState.MODE_RUN_READY) {
|
||||
isAutopilotAbility = false;
|
||||
String unableAutopilotReason = null;
|
||||
if (modeState == SsmInfo.ModeState.MODE_STOP_UNREADY) {
|
||||
unableAutopilotReason = "系统处于停止模式(未就绪)";
|
||||
} else if (modeState == SsmInfo.ModeState.MODE_STOP_READY) {
|
||||
unableAutopilotReason = "系统处于停止模式";
|
||||
} else if (modeState == SsmInfo.ModeState.MODE_IDLE_UNREADY) {
|
||||
unableAutopilotReason = "系统处于空闲模式(未就绪)";
|
||||
} else if (modeState == SsmInfo.ModeState.MODE_IDLE_READY) {
|
||||
unableAutopilotReason = "系统处于空闲模式";
|
||||
} else {
|
||||
unableAutopilotReason = "未知系统模式";
|
||||
}
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.SSM, unableAutopilotReason);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
isAutopilotAbility = false;//是否能启动自动驾驶
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.LIB, "SSM数据异常");
|
||||
}
|
||||
if (fsmStatusReasonRespond != null) {
|
||||
int count = fsmStatusReasonRespond.getFsmStatusReasonRespondCount();
|
||||
if (count > 0) {
|
||||
isAutopilotAbility = false;
|
||||
for (int i = 0; i < count; i++) {
|
||||
String respond = fsmStatusReasonRespond.getFsmStatusReasonRespond(i);
|
||||
if (!TextUtils.isEmpty(respond)) {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.FSM, respond);
|
||||
}
|
||||
}
|
||||
if (unableAutopilotReasons == null || unableAutopilotReasons.isEmpty()) {
|
||||
unableAutopilotReasons = AutopilotAbilityManager.getInstance().addUnableAutopilotReason(unableAutopilotReasons, UnableAutopilotReason.SourceType.LIB, "FSM数据异常");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReasons);
|
||||
}
|
||||
}
|
||||
|
||||
protected void start(OnAutopilotAbilityListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
protected void stop() {
|
||||
this.masterVersion = -1;
|
||||
this.listener = null;
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,17 @@ package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.Constants;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableAutopilotReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
@@ -16,6 +21,7 @@ import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import function_state_management.FSMStatusReasonQueryOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import system_master.SsmInfo;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
/**
|
||||
@@ -25,17 +31,26 @@ import system_master.SystemStatusInfo;
|
||||
* <p>
|
||||
* 此定时器不能停止 鹰眼中存在UI更新依赖循环查询系统状态
|
||||
*/
|
||||
public class AutopilotAbilityManager {
|
||||
public class AutopilotAbilityManager implements AutopilotAbility230.OnAutopilotAbilityListener, AutopilotAbility250.OnAutopilotAbilityListener, AutopilotAbility330.OnAutopilotAbilityListener, AutopilotAbility350And360.OnAutopilotAbilityListener, AutopilotAbility360.OnAutopilotAbilityListener {
|
||||
private static final String TAG = AutopilotAbilityManager.class.getSimpleName();
|
||||
protected static final int WHAT_TIMEOUT = 0;
|
||||
protected static final int DEFAULT_TIMEOUT = 2500;
|
||||
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 = {"未知状态", "依赖未就绪", "启动中", "运行", "停止", "无法启动状态", "非自动启动状态", "非自动关闭状态"};
|
||||
private static volatile AutopilotAbilityManager INSTANCE;
|
||||
private OnAdasListener listener;
|
||||
private Handler handler;
|
||||
private OnAutopilotAbilityListener onAutopilotAbilityListener;
|
||||
private int mapVersion = -1;//工控机版本
|
||||
private boolean isFutianSweeper = false;//是否是福田清扫车
|
||||
private boolean isJinlvM1 = false;//是否是M1
|
||||
private boolean isHQ = false;//是否是HQ
|
||||
private AutopilotAbility230 autopilotAbility230;
|
||||
private AutopilotAbility250 autopilotAbility250;
|
||||
private AutopilotAbility330 autopilotAbility330;
|
||||
private AutopilotAbility350And360 autopilotAbility350And360;
|
||||
private AutopilotAbility360 autopilotAbility360;
|
||||
private Timer startTimer;
|
||||
/**
|
||||
* 不能启动自动驾驶的档位
|
||||
@@ -79,9 +94,27 @@ public class AutopilotAbilityManager {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加不能启动自驾的原因
|
||||
*
|
||||
* @param unableAutopilotReasons 原因列表
|
||||
* @param source 来源
|
||||
* @param unableAutopilotReason 云隐
|
||||
* @return 原因列表
|
||||
*/
|
||||
protected ArrayList<UnableAutopilotReason> addUnableAutopilotReason(ArrayList<UnableAutopilotReason> unableAutopilotReasons, UnableAutopilotReason.SourceType source, String unableAutopilotReason) {
|
||||
if (unableAutopilotReasons == null) {
|
||||
unableAutopilotReasons = new ArrayList<>();
|
||||
}
|
||||
unableAutopilotReasons.add(new UnableAutopilotReason(source, unableAutopilotReason));
|
||||
return unableAutopilotReasons;
|
||||
}
|
||||
|
||||
public void setCarConfig(MessagePad.CarConfigResp carConfig) {
|
||||
mapVersion = carConfig.getMapVersion();
|
||||
isFutianSweeper = carConfig.getIsFutianSweeper();
|
||||
isJinlvM1 = carConfig.getIsJinlvM1();
|
||||
isHQ = carConfig.getIsHQ();
|
||||
if (mapVersion != -1) {
|
||||
stopTimer();
|
||||
CupidLogUtils.i(TAG, "工控机版本=" + mapVersion);
|
||||
@@ -93,9 +126,33 @@ public class AutopilotAbilityManager {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public void onAutopilotAbility(boolean isAutopilotAbility, String unableAutopilotReason) {
|
||||
@Override
|
||||
public void onAutopilotAbility(boolean isAutopilotAbility, @Nullable ArrayList<UnableAutopilotReason> unableAutopilotReasons) {
|
||||
if (listener != null) {
|
||||
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReason);
|
||||
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReasons);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusQuery() {
|
||||
if (onAutopilotAbilityListener != null) {
|
||||
onAutopilotAbilityListener.onStatusQuery();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSendTimeoutMessages() {
|
||||
onRemoveTimeoutMessages();
|
||||
if (handler != null) {
|
||||
handler.sendEmptyMessageDelayed(WHAT_TIMEOUT, DEFAULT_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoveTimeoutMessages() {
|
||||
if (handler != null) {
|
||||
if (handler.hasMessages(WHAT_TIMEOUT))
|
||||
handler.removeMessages(WHAT_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,18 +160,11 @@ public class AutopilotAbilityManager {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
public Handler getHandler() {
|
||||
return handler;
|
||||
}
|
||||
|
||||
public void setOnAutopilotAbilityListener(OnAutopilotAbilityListener onAutopilotAbilityListener) {
|
||||
this.onAutopilotAbilityListener = onAutopilotAbilityListener;
|
||||
}
|
||||
|
||||
public OnAutopilotAbilityListener getOnAutopilotAbilityListener() {
|
||||
return onAutopilotAbilityListener;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* SSM状态更新
|
||||
@@ -130,6 +180,15 @@ public class AutopilotAbilityManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void setStatusInfo(SsmInfo.SsmStatusInf statusInfo) {
|
||||
if (autopilotAbility350And360 != null) {
|
||||
autopilotAbility350And360.setStatusInfo(statusInfo);
|
||||
}
|
||||
if (autopilotAbility360 != null) {
|
||||
autopilotAbility360.setStatusInfo(statusInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 底盘状态更新
|
||||
*
|
||||
@@ -142,6 +201,9 @@ public class AutopilotAbilityManager {
|
||||
if (autopilotAbility250 != null) {
|
||||
autopilotAbility250.setChassisStates(chassisStates);
|
||||
}
|
||||
if (autopilotAbility350And360 != null) {
|
||||
autopilotAbility350And360.setChassisStates(chassisStates);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -153,39 +215,74 @@ public class AutopilotAbilityManager {
|
||||
if (autopilotAbility330 != null) {
|
||||
autopilotAbility330.setFsmStatusReasonRespond(fsmStatusReasonRespond);
|
||||
}
|
||||
if (autopilotAbility360 != null) {
|
||||
autopilotAbility360.setFsmStatusReasonRespond(fsmStatusReasonRespond);
|
||||
}
|
||||
}
|
||||
|
||||
public void onHandleMessage(Message msg) {
|
||||
if (autopilotAbility250 != null) {
|
||||
autopilotAbility250.onHandleMessage(msg);
|
||||
if (msg.what == WHAT_TIMEOUT) {
|
||||
if (autopilotAbility250 != null) {
|
||||
autopilotAbility250.onCallTimeout();
|
||||
}
|
||||
if (autopilotAbility330 != null) {
|
||||
autopilotAbility330.onCallTimeout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initAutopilotAbility() {
|
||||
//目前只有MAP330的清扫车用的新的FSM状态原因查询
|
||||
if (mapVersion >= 30300 && isFutianSweeper) {
|
||||
CupidLogUtils.i(TAG, "是否可以启动自动驾驶能力检测使用330版本");
|
||||
if (mapVersion >= 30600 && isFutianSweeper) {
|
||||
Log.i(TAG, "能否启动自驾能力检测使用版本:360清扫车专用");
|
||||
stop230();
|
||||
stop250();
|
||||
stop330();
|
||||
stop350And360();
|
||||
if (autopilotAbility360 == null) {
|
||||
autopilotAbility360 = new AutopilotAbility360();
|
||||
autopilotAbility360.start(this);
|
||||
}
|
||||
|
||||
} else if ((mapVersion >= 30500 && (isJinlvM1 || isHQ)) || mapVersion >= 30600) {
|
||||
Log.i(TAG, "能否启动自驾能力检测使用版本:350和360共用");
|
||||
stop230();
|
||||
stop250();
|
||||
stop330();
|
||||
stop360();
|
||||
if (autopilotAbility350And360 == null) {
|
||||
autopilotAbility350And360 = new AutopilotAbility350And360();
|
||||
autopilotAbility350And360.start(this);
|
||||
}
|
||||
|
||||
} else if (mapVersion >= 30300 && isFutianSweeper) {//目前只有MAP330的清扫车用的新的FSM状态原因查询
|
||||
Log.i(TAG, "能否启动自驾能力检测使用版本:330清扫车专用");
|
||||
stop230();
|
||||
stop250();
|
||||
stop350And360();
|
||||
stop360();
|
||||
if (autopilotAbility330 == null) {
|
||||
autopilotAbility330 = new AutopilotAbility330(mapVersion);
|
||||
autopilotAbility330.start();
|
||||
autopilotAbility330.start(this);
|
||||
}
|
||||
} else if (mapVersion >= 20500) {
|
||||
CupidLogUtils.i(TAG, "是否可以启动自动驾驶能力检测使用250版本");
|
||||
Log.i(TAG, "能否启动自驾能力检测使用版本:250");
|
||||
stop230();
|
||||
stop330();
|
||||
stop350And360();
|
||||
stop360();
|
||||
if (autopilotAbility250 == null) {
|
||||
autopilotAbility250 = new AutopilotAbility250(mapVersion);
|
||||
autopilotAbility250.start();
|
||||
autopilotAbility250.start(this);
|
||||
}
|
||||
} else {
|
||||
CupidLogUtils.i(TAG, "是否可以启动自动驾驶能力检测使用230版本");
|
||||
Log.i(TAG, "能否启动自驾能力检测使用版本:230");
|
||||
stop250();
|
||||
stop330();
|
||||
stop350And360();
|
||||
stop360();
|
||||
if (autopilotAbility230 == null) {
|
||||
autopilotAbility230 = new AutopilotAbility230();
|
||||
autopilotAbility230.start();
|
||||
autopilotAbility230.start(this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -212,6 +309,20 @@ public class AutopilotAbilityManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void stop350And360() {
|
||||
if (autopilotAbility350And360 != null) {
|
||||
autopilotAbility350And360.stop();
|
||||
autopilotAbility350And360 = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void stop360() {
|
||||
if (autopilotAbility360 != null) {
|
||||
autopilotAbility360.stop();
|
||||
autopilotAbility360 = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void stopTimer() {
|
||||
if (startTimer != null) {
|
||||
startTimer.cancel();
|
||||
@@ -234,7 +345,7 @@ public class AutopilotAbilityManager {
|
||||
initAutopilotAbility();
|
||||
}
|
||||
}
|
||||
}, 8000L);//延迟执行,避免刚连接成功后底盘信息无法及时同步
|
||||
}, 8000L);//8秒原因:需要后去CarConfig 对象,两个地方调用initAutopilotAbility(); 初始化 一个在这,另一个在setCarConfig(),如果setCarConfig() 证明获取版本还未成功,获取版本会重试3次每次间隔两秒
|
||||
}
|
||||
|
||||
}
|
||||
@@ -244,9 +355,13 @@ public class AutopilotAbilityManager {
|
||||
stop230();
|
||||
stop250();
|
||||
stop330();
|
||||
stop350And360();
|
||||
stop360();
|
||||
handler = null;
|
||||
mapVersion = -1;
|
||||
isFutianSweeper = false;
|
||||
isHQ = false;
|
||||
isJinlvM1 = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg warnMessage;//预警数据
|
||||
private IMsg arrivalNotificationMessage;//到站提醒
|
||||
private IMsg statusQueryRespMessage;//状态查询应答
|
||||
private IMsg systemStatusMessage;//定频SSM
|
||||
private IMsg recordDataConfigRespMessage;//数据采集配置应答
|
||||
private IMsg planningDecisionStateMessage;//planning决策状态
|
||||
private IMsg obuWarningDataMessage;//工控机透传OBU V2I数据
|
||||
@@ -161,6 +162,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
statusQueryRespMessage = new StatusQueryRespMessage();
|
||||
}
|
||||
return statusQueryRespMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_SSM.typeCode) {
|
||||
//定频SSM
|
||||
if (systemStatusMessage == null) {
|
||||
systemStatusMessage = new SystemStatusMessage();
|
||||
}
|
||||
return systemStatusMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP.typeCode) {
|
||||
//数据采集配置应答
|
||||
if (recordDataConfigRespMessage == null) {
|
||||
|
||||
@@ -7,8 +7,8 @@ import com.zhidao.support.adas.high.AdasChannel;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.AutopilotReview;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.MogoReport;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
import com.zhjt.mogo.adas.data.bean.MogoReport;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
@@ -28,20 +28,39 @@ public class ReportMessage extends MyAbstractMessageHandler {
|
||||
}
|
||||
|
||||
private void initStartAutopilotFailCode() {
|
||||
//ssm_master的失败事件
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESYS.AUTOPILOT_FAILED);//在尝试启动自动驾驶,但是超过指定时间后底盘未进入,会发送此事件
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESYS.ROUTING_REQ_TIMEOUT);//算路请求响应超时或轨迹加载超时
|
||||
/* SSM侧上报的失败事件*/
|
||||
//首先有系统状态不符合,不允许自驾的情况
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESSM.AUTOPILOT_UNREADY);//因自动驾驶节点状态未就绪拒绝自动驾驶
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESSM.AUTOPILOT_KEY_NODE_BORKEN);//因自驾驾驶关键节点挂掉拒绝自动驾驶
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESSM.IGNORED_CMD_DUE_PAD_CONTROL);//pad自驾中,拒绝云控的自驾命令
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESSM.IGNORED_CMD_DUE_AICLOUD_CONTROL);//云控自驾中,拒绝pad的自驾命令
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESYS.NOT_ALLOW_AUTOPILOT_FOR_REMOTE);//系统处于远程驾驶中,拒绝进入自动驾驶
|
||||
//其次是自驾转发底盘前轨迹与算路的环节错误
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESYS.CHECK_TRAJECTORY_FAILURE);//自驾环节轨迹检查不可用,或者触发轨迹下载,检查超时
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESYS.ROUTING_REQ_TIMEOUT);//算路请求响应超时,可能原因是hadmap_engine没有返回,轨迹加载失败,轨迹加载超时
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESYS.PLANNING_CHANGE_FAILIED);//planning切换失败(仅df hq有此事件)
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESYS.CHECK_TRAJECTORY_FAILURE);//轨迹下载检查不可用
|
||||
//controller的失败事件 EMAP_ENTRY_AUTOPILOT_XXX 底盘启动失败
|
||||
//(7.10新增)鉴于存在 大量地图不存在导致或者 engine 节点不存在 导致的 routing反馈,SSM310,MAP350开始增加engine ready的检测
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESYS.MAP_ENGINE_NOT_READY);//hadmap_engine启动了但是状态不对,可能原因是hadmap_engine加载地图失败,或者初始化失败
|
||||
//最后是命令给到底盘,超时失败的事件,如果收到了控制侧上报的失败事件,这个事件可忽略
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.ESYS.AUTOPILOT_FAILED);//在尝试启动自动驾驶,但是超过指定时间后底盘未进入,会发送此事件
|
||||
|
||||
/*控制侧上报的失败事件 EMAP_ENTRY_AUTOPILOT_XXX 底盘启动失败*/
|
||||
//相关模块无消息导致的进自驾失败,需要联系相关模块排查
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_CANADAPTER_TIMEOUT);//can_adapter消息超时未进入自驾
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_PLANNING_TIMEOUT);//PLANNING消息超时未进自驾
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_LOCATION_TIMEOUT);//定位消息超时未进自驾
|
||||
//车端干预导致的自驾失败,检查是否有驾驶干预或者仪表盘不正常
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_BRAKE);//制动踏板干预未进自驾
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_ACCEL);//加速踏板干预未进自驾
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_STEER);//方向盘干预未进自驾
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_GEAR_SWITCH);//档位切换干预未进自驾
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_OTHER_CTL);//其他干预未进自驾,请检查仪表盘和开关项(如双闪,制动灯灯等 可在msg中补充原因信息)
|
||||
//控制判断车辆故障,需要联系运维处理的事件
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_VEHICLE_ERROR);//控制判断车辆故障,需要联系运维处理的事件
|
||||
//控制判断底盘异常,需要重启车辆
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_CHASSIS_FAULT);//控制判断底盘异常,需要重启车辆
|
||||
//不知道确切的失败原因,需要联系控制进一步排查
|
||||
startAutopilotFailCode.add(MogoReport.Code.Error.EMAP.ENTRY_AUTOPILOT_FOR_UNKNOWN);//不知道确切的失败原因,需要联系控制进一步排查
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,6 +14,7 @@ import system_master.SystemStatusInfo;
|
||||
/**
|
||||
* 状态查询应答
|
||||
*/
|
||||
@Deprecated//HQ、M1 MAP350开始弃用,其他车型MAP360开始弃用
|
||||
public class StatusQueryRespMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.AdasChannel;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityManager;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import system_master.SsmInfo;
|
||||
|
||||
/**
|
||||
* 定频SSM 接口
|
||||
*/
|
||||
public class SystemStatusMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
SsmInfo.SsmStatusInf statusInfo = SsmInfo.SsmStatusInf.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("定频SSM", raw.receiveTime);
|
||||
AutopilotAbilityManager.getInstance().setStatusInfo(statusInfo);
|
||||
long nowTime = 0;
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
adasListener.onSystemStatus(raw.getHeader(), statusInfo);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("定频SSM", nowTime);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
package com.zhidao.support.adas.high.socket;
|
||||
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_CODE_WEB_SOCKET_MESSAGE_BYTE;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_CODE_WEB_SOCKET_MESSAGE_JSON;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_CODE_WEB_SOCKET_OPEN;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_SOURCE_ADAS;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_TYPE_INIT_STATUS;
|
||||
import static com.zhidao.support.adas.high.common.Constants.RESOURCE_PATH;
|
||||
import static com.zhidao.support.adas.high.common.Constants.WS_IP_HOST_HEAD;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -25,6 +24,7 @@ import com.zhidao.support.adas.high.queue.WebSocketQueueManager;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
@@ -33,6 +33,7 @@ import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.WebSocket;
|
||||
import okhttp3.WebSocketListener;
|
||||
import okhttp3.internal.ws.RealWebSocket;
|
||||
import okio.ByteString;
|
||||
|
||||
/**
|
||||
@@ -51,7 +52,7 @@ public class FpgaSocket implements IWebSocket {
|
||||
private static final String TAG = FpgaSocket.class.getSimpleName();
|
||||
private OkHttpClient client;
|
||||
|
||||
private volatile WebSocket mWebSocket;
|
||||
private volatile RealWebSocket mWebSocket;
|
||||
|
||||
private EchoWebSocketListener listener;
|
||||
private IWebSocketConnectListener mWebSocketConnectListener;
|
||||
@@ -79,11 +80,11 @@ public class FpgaSocket implements IWebSocket {
|
||||
*/
|
||||
private volatile String receiveTimeoutReason = null;
|
||||
|
||||
public FpgaSocket() {
|
||||
init();
|
||||
public FpgaSocket(Context context) {
|
||||
init(context);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
private void init(Context context) {
|
||||
listener = new EchoWebSocketListener();
|
||||
OkHttpClient.Builder okBuilder = new OkHttpClient.Builder();
|
||||
okBuilder.writeTimeout(4, TimeUnit.SECONDS)
|
||||
@@ -96,10 +97,10 @@ public class FpgaSocket implements IWebSocket {
|
||||
onPassiveClose(1001, receiveTimeoutReason);
|
||||
}
|
||||
});
|
||||
reconnectManager = new ReconnectManager(new ReconnectManager.OnReconnectListener() {
|
||||
reconnectManager = new ReconnectManager(context, new ReconnectManager.OnReconnectListener() {
|
||||
@Override
|
||||
public void onReconnection() {
|
||||
connect("重连中");
|
||||
public void onReconnection(String tag) {
|
||||
connect("重连中(" + tag + ")");
|
||||
}
|
||||
});
|
||||
client = okBuilder.build();
|
||||
@@ -123,7 +124,9 @@ public class FpgaSocket implements IWebSocket {
|
||||
Request request = new Request.Builder()
|
||||
.url(wsHost)
|
||||
.build();
|
||||
mWebSocket = client.newWebSocket(request, listener);
|
||||
mWebSocket = new RealWebSocket(request, listener, new Random(), 0);
|
||||
mWebSocket.connect(client);
|
||||
// mWebSocket = client.newWebSocket(request, listener);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,14 @@ public class DispatchHandler {
|
||||
|
||||
public void sendRawMessage(RawData raw) {
|
||||
start();
|
||||
if (messageType == MessagePad.MessageType.MsgTypePointCloud) {
|
||||
boolean isIdle = mBaseHandler.getLooper().getQueue().isIdle();
|
||||
// Log.i("TimeConsuming", mThread.getName() + " 当前消息队列是否处于空闲状态=" + isIdle);
|
||||
if (!isIdle) {
|
||||
mBaseHandler.removeCallbacksAndMessages(null);
|
||||
// Log.i("TimeConsuming", mThread.getName() + " 移除所有消息后,当前消息队列是否处于空闲状态=" + mBaseHandler.getLooper().getQueue().isIdle());
|
||||
}
|
||||
}
|
||||
Message msg = Message.obtain();
|
||||
msg.obj = raw;
|
||||
msg.what = WHAT_DISPATCH;
|
||||
|
||||
@@ -59,6 +59,12 @@ public interface IMogoMapUIController {
|
||||
*/
|
||||
void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng);
|
||||
|
||||
/**
|
||||
* 切换视角锁定,用于启动/关闭漫游
|
||||
* @param lock 锁定值
|
||||
*/
|
||||
void visualAngleLock(boolean lock);
|
||||
|
||||
/**
|
||||
* 设置漫游路径
|
||||
* @param trajectory
|
||||
@@ -378,4 +384,28 @@ public interface IMogoMapUIController {
|
||||
void cancelDownloadCacheData();
|
||||
|
||||
String getCityCode();
|
||||
|
||||
/**
|
||||
* 自动切换视角到指定点,包含过渡动画,并持续指定duration毫秒
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param rotateAngle 旋转角度
|
||||
* @param duration 持续时间
|
||||
* @param isGps 是否是高精坐标
|
||||
*/
|
||||
void animateTo(double lon, double lat, float rotateAngle, int duration, boolean isGps);
|
||||
|
||||
|
||||
/**
|
||||
* 自动切换视角到指定点,包含过渡动画,并持续指定duration毫秒
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param v1 旋转角度
|
||||
* @param v2 持续时间
|
||||
* @param v3
|
||||
* @param v4
|
||||
*/
|
||||
void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps);
|
||||
}
|
||||
|
||||
@@ -24,13 +24,11 @@ import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
@@ -44,7 +42,6 @@ import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapStyleListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.hdcache.IHdCacheListener;
|
||||
@@ -126,8 +123,10 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
private IHdCacheListener hdCacheListener;
|
||||
|
||||
private volatile boolean visualLock = false;
|
||||
|
||||
public AMapViewWrapper(MapAutoView mMapView) {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--AMapViewWrapper: init");
|
||||
CallerLogger.i(M_MAP + TAG, "autoop--AMapViewWrapper: init");
|
||||
this.mMapView = mMapView;
|
||||
initViews();
|
||||
initListeners();
|
||||
@@ -137,7 +136,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
private void initViews() {
|
||||
// 初始化首次地图进入的时候的样式, MapAutoApi.INSTANCE.init(context, mapParams);将影响这里的数据
|
||||
int mapStyle = MapAutoApi.INSTANCE.getMapParams().getStyleMode();
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "默认配置地图模式:mapStyle=" + mapStyle);
|
||||
CallerLogger.d(M_MAP + TAG, "默认配置地图模式:mapStyle=" + mapStyle);
|
||||
switch (mapStyle) {
|
||||
case MapAutoApi.MAP_STYLE_DAY:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY;
|
||||
@@ -158,32 +157,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_VR;
|
||||
break;
|
||||
default:
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "暂不支持此地图模式,默认使用VR夜间模式");
|
||||
CallerLogger.e(M_MAP + TAG, "暂不支持此地图模式,默认使用VR夜间模式");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void initMapView() {
|
||||
if (mMapView == null) {
|
||||
return;
|
||||
}
|
||||
MapAutoViewHelper options = mMapView.getMapAutoViewHelper();
|
||||
ThreadUtils.getIoPool().submit(() -> {
|
||||
if (options != null) {
|
||||
//设置手势是否可以缩放 isCanZoom true 可缩放 false 不可缩放
|
||||
options.setZoomGesturesEnabled(true);
|
||||
options.setScaleVRMode(true);
|
||||
options.setWeatherEnable(false);
|
||||
// options.setAllGesturesEnabled(false); //禁止全部手势
|
||||
if (options.getMyLocationStyle() != null) {
|
||||
options.getMyLocationStyle().setDisplayAnimEnable(true);
|
||||
}
|
||||
//修改自车模型,未来需区分车的类型
|
||||
options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
mMapView.setOnMarkClickListener(this);
|
||||
mMapView.setOnMapLoadedListener(this);
|
||||
@@ -198,7 +176,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.setOnMapViewVisualAngleChangeListener(this);
|
||||
mMapView.setOnRoadInfoListener(this, 1);
|
||||
MapAutoApi.INSTANCE.registerLogListener(this);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "styleop - initListeners - setOnMapStyleListener - view " + mMapView);
|
||||
CallerLogger.d(M_MAP + TAG, "styleop - initListeners - setOnMapStyleListener - view " + mMapView);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,10 +188,10 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void onRoadIdInfo(@androidx.annotation.Nullable String roadId, @androidx.annotation.Nullable String s1) {
|
||||
if (roadId != null && !TextUtils.isEmpty(roadId)) {
|
||||
// CallerLogger.INSTANCE.d(M_MAP + TAG, "onRoadIdInfo::" + roadId);
|
||||
// CallerLogger.d(M_MAP + TAG, "onRoadIdInfo::" + roadId);
|
||||
CallerMapRoadListenerManager.INSTANCE.invokeListenersOnRoadIdGet(roadId);
|
||||
} else {
|
||||
//CallerLogger.INSTANCE.d(M_MAP + TAG, "onRoadIdInfo::null");
|
||||
//CallerLogger.d(M_MAP + TAG, "onRoadIdInfo::null");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,18 +206,18 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (stopLine != null && stopLine.road_id != null && !stopLine.road_id.isEmpty() && stopLine.points != null && stopLine.points.size() > 0) {
|
||||
ArrayList<LonLatPoint> points = stopLine.points;
|
||||
if (carLoc != null) {
|
||||
// //CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo:stop_line" + stopLine + ", car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
// //CallerLogger.d(M_MAP + TAG, "onStopLineInfo:stop_line" + stopLine + ", car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
MapRoadInfo.StopLine stopInfo = convert(stopLine);
|
||||
LonLatPoint p1 = points.get(0);
|
||||
LonLatPoint p2 = points.get(points.size() - 1);
|
||||
double distanceOfCarToStopLine = MapDataApi.INSTANCE.getNearstFromPointToSegment(carLoc.getLongitude(), carLoc.getLatitude(), p1.longitude, p1.latitude, p2.longitude, p2.latitude) * 10_0000;
|
||||
stopInfo.setDistanceOfCarToStopLine(distanceOfCarToStopLine);
|
||||
//CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo: --- distance: " + distanceOfCarToStopLine);
|
||||
//CallerLogger.d(M_MAP + TAG, "onStopLineInfo: --- distance: " + distanceOfCarToStopLine);
|
||||
CallerMapRoadListenerManager.INSTANCE.invokeListenersOnStopLineGet(stopInfo);
|
||||
}
|
||||
} else {
|
||||
if (carLoc != null) {
|
||||
//CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo::null, car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
//CallerLogger.d(M_MAP + TAG, "onStopLineInfo::null, car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -287,7 +265,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onCreate(Bundle bundle) {
|
||||
if (mMapView != null) {
|
||||
mMapView.onCreate(bundle);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onCreate");
|
||||
CallerLogger.d(M_MAP + TAG, "map onCreate");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +273,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onResume() {
|
||||
if (mMapView != null) {
|
||||
mMapView.onResume();
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onResume");
|
||||
CallerLogger.d(M_MAP + TAG, "map onResume");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,7 +281,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onPause() {
|
||||
if (mMapView != null) {
|
||||
mMapView.onPause();
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onPause");
|
||||
CallerLogger.d(M_MAP + TAG, "map onPause");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,7 +295,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.setOnMapClickListener(null);
|
||||
mMapView.setOnCameraChangeListener(null);
|
||||
MapAutoApi.INSTANCE.unregisterLogListener(this);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onDestroy");
|
||||
CallerLogger.d(M_MAP + TAG, "map onDestroy");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -326,7 +304,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
if (mMapView != null) {
|
||||
mMapView.onSaveInstanceState(outState);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onSaveInstanceState");
|
||||
CallerLogger.d(M_MAP + TAG, "map onSaveInstanceState");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,7 +318,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (isVrMold()) {
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "changeZoom : " + zoom);
|
||||
CallerLogger.d(M_MAP + TAG, "changeZoom : " + zoom);
|
||||
getMap().changeZoom(zoom);
|
||||
return MapControlResult.SUCCESS;
|
||||
}
|
||||
@@ -350,7 +328,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
// if (isVrMold()) {
|
||||
// return;
|
||||
// }
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "changeZoom2 : " + zoom);
|
||||
CallerLogger.d(M_MAP + TAG, "changeZoom2 : " + zoom);
|
||||
getMap().changeZoom2(zoom);
|
||||
}
|
||||
|
||||
@@ -361,12 +339,16 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
|
||||
if(visualLock){
|
||||
CallerLogger.e(M_MAP + TAG, "视角切换已锁定");
|
||||
return;
|
||||
}
|
||||
MapAutoViewHelper mapAutoViewHelper = mMapView.getMapAutoViewHelper();
|
||||
if (mapAutoViewHelper != null) {
|
||||
mVisualAngleMode = angelMode;
|
||||
if (angelMode == MODE_CLOSE_SIGHT) {
|
||||
if (mogoLatLng == null) {
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "切换地图近景需要传入要移动的经纬度数据");
|
||||
CallerLogger.e(M_MAP + TAG, "切换地图近景需要传入要移动的经纬度数据");
|
||||
return;
|
||||
}
|
||||
// 近景传入经纬度为点击地图上静态marker经纬度数据,为GPS坐标点。
|
||||
@@ -377,6 +359,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visualAngleLock(boolean lock) {
|
||||
visualLock = lock;
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_HD_MAP,
|
||||
linkCode = CHAIN_SOURCE_MAP,
|
||||
@@ -417,7 +404,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
private boolean checkAMapView() {
|
||||
if (mMapView == null || mMapView.getMapAutoViewHelper() == null) {
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "自研mapView实例为空,请检查");
|
||||
CallerLogger.e(M_MAP + TAG, "自研mapView实例为空,请检查");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -425,9 +412,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void moveToCenter(MogoLatLng latLng, boolean animate) {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "move to center " + latLng);
|
||||
CallerLogger.d(M_MAP + TAG, "move to center " + latLng);
|
||||
if (latLng == null || latLng.lat == 0.0d || latLng.lon == 0.0d) {
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "latLng = null or is illegal");
|
||||
CallerLogger.e(M_MAP + TAG, "latLng = null or is illegal");
|
||||
return;
|
||||
}
|
||||
if (checkAMapView()) {
|
||||
@@ -437,7 +424,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void showMyLocation(boolean visible) {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "showMyLocation1 " + visible);
|
||||
CallerLogger.d(M_MAP + TAG, "showMyLocation1 " + visible);
|
||||
// 如果是VR模式
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
@@ -458,7 +445,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
*/
|
||||
private boolean isVrMold() {
|
||||
boolean isVrMode = mCurrentUI == EnumMapUI.MAP_STYLE_NIGHT_VR || mCurrentUI == EnumMapUI.MAP_STYLE_DAY_VR;
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "是否是VR模式: " + isVrMode);
|
||||
CallerLogger.d(M_MAP + TAG, "是否是VR模式: " + isVrMode);
|
||||
return isVrMode;
|
||||
}
|
||||
|
||||
@@ -540,7 +527,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "setPointToCenter x : " + mapCenterX + " y : " + mapCenterY);
|
||||
CallerLogger.d(M_MAP + TAG, "setPointToCenter x : " + mapCenterX + " y : " + mapCenterY);
|
||||
mMapView.getMapAutoViewHelper().setPointToCenter((float) mapCenterX, (float) mapCenterY);
|
||||
}
|
||||
}
|
||||
@@ -577,7 +564,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (checkAMapView()) {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
mMapView.getMapAutoViewHelper().setRenderFps(fps);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "设置刷新帧率 fps = " + fps);
|
||||
CallerLogger.d(M_MAP + TAG, "设置刷新帧率 fps = " + fps);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -588,16 +575,16 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return;
|
||||
}
|
||||
if (isVrMold()) {
|
||||
CallerLogger.INSTANCE.w(M_MAP + TAG, "vr 模式下忽略该设置");
|
||||
CallerLogger.w(M_MAP + TAG, "vr 模式下忽略该设置");
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "showBounds : " + M_MAP + TAG + " , " + carPosition.toString() + " , " + bound.toShortString() + " , " + lockCarPosition);
|
||||
CallerLogger.i(M_MAP + TAG, "showBounds : " + M_MAP + TAG + " , " + carPosition.toString() + " , " + bound.toShortString() + " , " + lockCarPosition);
|
||||
try {
|
||||
LatLngBounds latLngBounds = MogoMapUtils.getLatLngBounds(carPosition, lonLats, lockCarPosition);
|
||||
mMapView.getMapAutoViewHelper().setCenter(ObjectUtils.fromMogo(carPosition));
|
||||
mMapView.getMapAutoViewHelper().moveCamera(CameraUpdateFactory.INSTANCE.newLatLngBounds(latLngBounds, bound.left, bound.right, bound.top, bound.bottom));
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "M_MAP+TAG : " + M_MAP + TAG + " error : " + e);
|
||||
CallerLogger.e(M_MAP + TAG, "M_MAP+TAG : " + M_MAP + TAG + " error : " + e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,7 +703,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
CallerMapDevaListenerManager.INSTANCE.invokeUploadLogFile(filePath);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onMapClick(@Nullable LonLatPoint lonLatPoint) {
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapClick(ObjectUtils.fromAMap(lonLatPoint));
|
||||
@@ -731,7 +717,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
)
|
||||
@Override
|
||||
public void onMapInit() {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--onMapInit: ");
|
||||
CallerLogger.i(M_MAP + TAG, "autoop--onMapInit: ");
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapLoaded();
|
||||
}
|
||||
|
||||
@@ -743,14 +729,19 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
)
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--onMapLoaded: ");
|
||||
CallerLogger.i(M_MAP + TAG, "autoop--onMapLoaded: ");
|
||||
if (checkAMapView()) {
|
||||
MapAutoViewHelper options = mMapView.getMapAutoViewHelper();
|
||||
if (options != null) {
|
||||
options.setScaleVRMode(true);
|
||||
}else{
|
||||
CallerLogger.i(M_MAP + TAG, "autoop--getMapAutoViewHelper is null");
|
||||
}
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
|
||||
cameraPosition.getZoom(),
|
||||
cameraPosition.getTilt(),
|
||||
cameraPosition.getBearing());
|
||||
initMapView();
|
||||
initMyLocation();
|
||||
loadPreVehicleModel();
|
||||
}
|
||||
@@ -782,7 +773,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onMapViewVisualAngleChange(int i) {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, " 地图自动更改视距 currentThread : " + Thread.currentThread().getName());
|
||||
CallerLogger.d(M_MAP + TAG, " 地图自动更改视距 currentThread : " + Thread.currentThread().getName());
|
||||
mVisualAngleMode = getVisualAngleMode(i);
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapVisualAngleChanged(mVisualAngleMode);
|
||||
}
|
||||
@@ -830,7 +821,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onChangeMapStyle(int styleId) {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "currentMapStyle = " + styleId);
|
||||
CallerLogger.d(M_MAP + TAG, "currentMapStyle = " + styleId);
|
||||
// 映射地图样式ID到鹰眼样式ID
|
||||
if (styleId == MapAutoApi.MAP_STYLE_DAY
|
||||
|| styleId == MapAutoApi.MAP_STYLE_DAY_NAV) {
|
||||
@@ -850,7 +841,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (mCurrentUI != null) {
|
||||
UiThreadHandler.post(() -> {
|
||||
try {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "currentUI = " + mCurrentUI);
|
||||
CallerLogger.d(M_MAP + TAG, "currentUI = " + mCurrentUI);
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapModeChanged(mCurrentUI);
|
||||
CallerMapStyleListenerManager.INSTANCE.invokeMapStyleChange(styleId);
|
||||
} catch (Exception e) {
|
||||
@@ -871,7 +862,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.getLocationClient().rtkEnable(mRtkEnable);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "rtkEnable has exception : " + e);
|
||||
CallerLogger.e(M_MAP + TAG, "rtkEnable has exception : " + e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -926,7 +917,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
* 加载3D模型
|
||||
*/
|
||||
private void loadPreVehicleModel() {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "添加感知模型到地图中……");
|
||||
CallerLogger.d(M_MAP + TAG, "添加感知模型到地图中……");
|
||||
ThreadUtils.getIoPool().submit(() -> {
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI, "添加感知模型到地图中……preVehicleStrWeiZhi=");
|
||||
|
||||
@@ -965,11 +956,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
.addPreVehicleModel(typeTrafficId.getType(), typeTrafficId.getTraffic3DNightIconId());
|
||||
}
|
||||
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, logMsg + preVehicleStrWeiZhi);
|
||||
CallerLogger.d(M_MAP + TAG, logMsg + preVehicleStrWeiZhi);
|
||||
|
||||
if (preVehicleStrWeiZhi == null) {
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
CallerLogger.INSTANCE.w(M_MAP + TAG, "添加感知模型到地图中失败,尝试重复添加……");
|
||||
CallerLogger.w(M_MAP + TAG, "添加感知模型到地图中失败,尝试重复添加……");
|
||||
addPreVehicleModelWeiZhi(typeTrafficId, logMsg);
|
||||
}, 1000L);
|
||||
}
|
||||
@@ -978,7 +969,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void setLockMode(boolean isLock) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setLockMode(true);
|
||||
mMapView.getMapAutoViewHelper().setLockMode(isLock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1044,7 +1035,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void cacheHDDataByCity(IHdCacheListener listener) {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
String gdCityCode = GDLocationClient.getInstance(getContext()).getLastCityCode();
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "gdCityCode is:" + gdCityCode);
|
||||
CallerLogger.i(M_MAP + TAG, "gdCityCode is:" + gdCityCode);
|
||||
Integer id = HDMapUtils.getHDCityCode(gdCityCode);
|
||||
if (id != null) {
|
||||
hdCacheListener = listener;
|
||||
@@ -1087,7 +1078,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void cacheHDDataByCity(IHdCacheListener listener, MogoLocation location) {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
hdCacheListener = listener;
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "location lon is:" + location.getLongitude() + ",lat is:" + location.getLatitude());
|
||||
CallerLogger.i(M_MAP + TAG, "location lon is:" + location.getLongitude() + ",lat is:" + location.getLatitude());
|
||||
mMapView.getMapAutoViewHelper().cacheHDDataByCityByLonLat(location.getLongitude(), location.getLatitude(), new OnHdDataDownByCityListener() {
|
||||
@Override
|
||||
public void onMapHDDataCacheProgressByCity(int cityId, double progress) {
|
||||
@@ -1126,7 +1117,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public boolean isCityDataCached() {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
String gdCityCode = GDLocationClient.getInstance(getContext()).getLastCityCode();
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "gdCityCode is:" + gdCityCode);
|
||||
CallerLogger.i(M_MAP + TAG, "gdCityCode is:" + gdCityCode);
|
||||
Integer id = HDMapUtils.getHDCityCode(gdCityCode);
|
||||
if (id != null) {
|
||||
List<CityInfo> cityInfoList = mMapView.getMapAutoViewHelper().getAllCityCode();
|
||||
@@ -1154,4 +1145,17 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return GDLocationClient.getInstance(getContext()).getLastCityCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float rotateAngle, int duration, boolean isGps) {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
mMapView.getMapAutoViewHelper().animateTo(lon, lat, rotateAngle, duration, isGps);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps) {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
mMapView.getMapAutoViewHelper().animateTo(lon, lat, v1, v2, v3, v4, duration, isGps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
private IMogoUiSettings mUiSettings;
|
||||
|
||||
public AMapWrapper(MapAutoViewHelper map, MapAutoView mapView, IMogoMapUIController controller) {
|
||||
CallerLogger.INSTANCE.i(TAG, "autoop--AMapWrapper: init" + this);
|
||||
CallerLogger.i(TAG, "autoop--AMapWrapper: init" + this);
|
||||
this.mAMap = map;
|
||||
sAMap = map;
|
||||
this.mMapView = mapView;
|
||||
@@ -89,7 +89,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
MarkerOptions markerOptions = ObjectUtils.fromMogo(options);
|
||||
if (markerOptions == null) {
|
||||
CallerLogger.INSTANCE.e(TAG, "marker参数为空");
|
||||
CallerLogger.e(TAG, "marker参数为空");
|
||||
return null;
|
||||
}
|
||||
Marker delegate = mAMap.addMarker(markerOptions);
|
||||
@@ -106,7 +106,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
PolylineOptions polylineOptions = ObjectUtils.fromMogo(options);
|
||||
if (polylineOptions == null) {
|
||||
CallerLogger.INSTANCE.e(TAG, "polyline参数为空");
|
||||
CallerLogger.e(TAG, "polyline参数为空");
|
||||
return null;
|
||||
}
|
||||
Polyline delegate = polylineOptions.lineWidth > 0 ? mAMap.drawThickLine(polylineOptions) : mAMap.drawLine(polylineOptions);
|
||||
@@ -139,6 +139,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
long time = markerOptionsArrayList.get(0).getTime();
|
||||
batchMarkerOptions.list = markerOptionsArrayList;
|
||||
batchMarkerOptions.averageFlag = 0;
|
||||
batchMarkerOptions.delayStrategy = false;
|
||||
batchMarkerOptions.ruleAngle = 8.0f;
|
||||
batchMarkerOptions.controlIcon = 1;
|
||||
@@ -230,7 +231,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
|
||||
@Override
|
||||
public void changeZoom(float zoom) {
|
||||
CallerLogger.INSTANCE.d(TAG, "changeZoom %s", zoom);
|
||||
CallerLogger.d(TAG, "changeZoom %s", zoom);
|
||||
if (checkAMap()) {
|
||||
mAMap.setZoom((int) zoom);
|
||||
}
|
||||
@@ -238,7 +239,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
|
||||
@Override
|
||||
public void changeZoom2(float zoom) {
|
||||
CallerLogger.INSTANCE.d(TAG, "changeZoom %s", zoom);
|
||||
CallerLogger.d(TAG, "changeZoom %s", zoom);
|
||||
if (checkAMap()) {
|
||||
mAMap.setZoomVal(zoom);
|
||||
}
|
||||
@@ -260,7 +261,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
mAMap = mMapView.getMapAutoViewHelper();
|
||||
sAMap = mAMap;
|
||||
if (mAMap == null) {
|
||||
CallerLogger.INSTANCE.e(TAG, "自研map实例为空,请检查");
|
||||
CallerLogger.e(TAG, "自研map实例为空,请检查");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.map;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
@@ -88,11 +87,20 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "set VisualAngle: " + angelMode.name());
|
||||
CallerLogger.d(TAG, "set VisualAngle: " + angelMode.name());
|
||||
mDelegate.changeMapVisualAngle(angelMode, mogoLatLng);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visualAngleLock(boolean lock) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
CallerLogger.d(TAG, "visualAngleLock: " + lock);
|
||||
mDelegate.visualAngleLock(lock);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRoamTrajectory(String trajectory) {
|
||||
initDelegate();
|
||||
@@ -105,7 +113,7 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
public void setRomaMode(int mode) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "set setRomaMode: " + mode);
|
||||
CallerLogger.d(TAG, "set setRomaMode: " + mode);
|
||||
mDelegate.setRomaMode(mode);
|
||||
}
|
||||
}
|
||||
@@ -505,4 +513,18 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float rotateAngle, int duration, boolean isGps) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.animateTo(lon, lat, rotateAngle, duration, isGps);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.animateTo(lon, lat, v1, v2, v3, v4, duration, isGps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
if (mapView != null) {
|
||||
addView(mapView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
} else {
|
||||
CallerLogger.INSTANCE.e(TAG, "create MapView instance failed.");
|
||||
CallerLogger.e(TAG, "create MapView instance failed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,25 +57,25 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
CallerLogger.INSTANCE.d(TAG, "onCreate");
|
||||
CallerLogger.d(TAG, "onCreate");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
CallerLogger.INSTANCE.d(TAG, "onResume");
|
||||
CallerLogger.d(TAG, "onResume");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
CallerLogger.INSTANCE.d(TAG, "onPause");
|
||||
CallerLogger.d(TAG, "onPause");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
CallerLogger.INSTANCE.d(TAG, "onDestroy");
|
||||
CallerLogger.d(TAG, "onDestroy");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,7 +26,11 @@ class GDLocationClient private constructor(context: Context) : AMapLocationListe
|
||||
IMogoGDLocationClient {
|
||||
//声明LocationClient对象
|
||||
private lateinit var mLocationClient: AMapLocationClient
|
||||
|
||||
@Volatile
|
||||
private var mCityCode: String = ""
|
||||
|
||||
@Volatile
|
||||
private var mapLocation: AMapLocation? = null
|
||||
|
||||
/**
|
||||
@@ -63,15 +67,11 @@ class GDLocationClient private constructor(context: Context) : AMapLocationListe
|
||||
}
|
||||
|
||||
override fun start() {
|
||||
if (mLocationClient != null) {
|
||||
mLocationClient.startLocation()
|
||||
}
|
||||
mLocationClient.startLocation()
|
||||
}
|
||||
|
||||
override fun stop() {
|
||||
if (mLocationClient != null) {
|
||||
mLocationClient.stopLocation()
|
||||
}
|
||||
mLocationClient.stopLocation()
|
||||
}
|
||||
|
||||
override fun onLocationChanged(aMapLocation: AMapLocation) {
|
||||
|
||||
@@ -47,7 +47,7 @@ class AMapPolylineWrapper(private val id: String, private val delegate: Polyline
|
||||
}
|
||||
|
||||
override fun isVisible(): Boolean {
|
||||
return delegate.isVisible() ?: false
|
||||
return delegate.isVisible()
|
||||
}
|
||||
|
||||
override fun setToTop() {
|
||||
|
||||
@@ -77,6 +77,13 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visualAngleLock(boolean lock) {
|
||||
if (mClient != null) {
|
||||
mClient.visualAngleLock(lock);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRoamTrajectory(String trajectory) {
|
||||
if (mClient != null) {
|
||||
@@ -442,4 +449,18 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float rotateAngle, int duration, boolean isGps) {
|
||||
if (mClient != null) {
|
||||
mClient.animateTo(lon, lat, rotateAngle, duration, isGps);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps) {
|
||||
if (mClient != null) {
|
||||
mClient.animateTo(lon, lat, v1, v2, v3, v4, duration, isGps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,6 @@ public class ObjectUtils {
|
||||
markerOptions.setLat(trafficData.getLatitude());
|
||||
markerOptions.setLon(trafficData.getLongitude());
|
||||
markerOptions.setTime(Double.valueOf(trafficData.getSatelliteTime() * 1000).longValue());
|
||||
trafficData.getColor();
|
||||
if(!trafficData.getColor().isEmpty()){
|
||||
markerOptions.setColor(trafficData.getColor());
|
||||
}else{
|
||||
|
||||
@@ -39,13 +39,13 @@ public class PointInterpolatorUtil {
|
||||
MogoLatLng current = points.get(i);
|
||||
MogoLatLng next = points.get(i + 1);
|
||||
float distance = CoordinateUtils.calculateLineDistance(current.lon, current.lat, next.lon, next.lat);
|
||||
CallerLogger.INSTANCE.d(TAG, i + ": " + distance);
|
||||
CallerLogger.d(TAG, i + ": " + distance);
|
||||
if (distance > DISTANCE_THRESHOLD) {
|
||||
int inter = (int) (distance / DISTANCE_THRESHOLD) + 1;
|
||||
for (int j = 1; j < inter; j++) {
|
||||
double newLat = current.lat + (next.lat - current.lat) * j / inter;
|
||||
double newLon = current.lon + (next.lon - current.lon) * j / inter;
|
||||
CallerLogger.INSTANCE.d(TAG, "distance: " + distance + ", j: " + j + ", nextLat: " + next.lat + ", nextLon: " + next.lon + ", newLat: " + newLat + ", newLon: " + newLon);
|
||||
CallerLogger.d(TAG, "distance: " + distance + ", j: " + j + ", nextLat: " + next.lat + ", nextLon: " + next.lon + ", newLat: " + newLat + ", newLon: " + newLon);
|
||||
points.add(i + 1, new MogoLatLng(newLat, newLon));
|
||||
current = points.get(++i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user