完成新架构的域控制器的监听及数据改造

Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
董宏宇
2021-10-18 19:16:41 +08:00
parent a4650ca514
commit 8a3e122518
76 changed files with 1895 additions and 1516 deletions

View File

@@ -0,0 +1,75 @@
package com.mogo.eagle.core.function.autopilot
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.autopilot.AutopilotControlCmdParameter
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.LogUtils
import com.zhidao.support.adas.high.AdasManager
/**
* @author xiaoyuzhou
* @date 2021/9/22 8:43 下午
*/
@Route(path = MogoServicePaths.PATH_AUTO_PILOT)
class MoGoAutopilotProvider :
IMoGoAutopilotProvider {
private val TAG = "MoGoAutoPilotProvider"
override val functionName: String
get() = TAG
override fun init(context: Context) {
// 初始化ADAS 域控制器
//AdasManager.getInstance().create(context)
}
override fun connectAutoPilot() {
}
override fun startAutoPilot(result: AutopilotControlParameters) {
if (AdasManager.getInstance().isSocketConnect) {
val parameter =
AutopilotControlCmdParameter(
TAG,
result
)
AdasManager.getInstance().aiCloudToAdasData(GsonUtils.toJson(parameter))
} else {
LogUtils.eTag(TAG, "车机与工控机链接失败,无法开启自动驾驶")
}
}
override fun cancelAutoPilot() {
if (AdasManager.getInstance().isSocketConnect) {
AdasManager.getInstance().controlAutopilotCarHead()
} else {
LogUtils.eTag(TAG, "车机与工控机链接失败,无法断开自动驾驶")
}
}
override fun getAutopilotStatus(): Int {
// int status = IMoGoAutoPilotStatusListener.STATUS_AUTOPILOT_DISABLE;
// try {
// status = adasProvider.autopilotStateCall().getState();
// } catch (Exception e) {
// e.printStackTrace();
// }
return 0
}
override fun recordPackage(): Boolean {
return AdasManager.getInstance().recordPackage()
}
}

View File

@@ -0,0 +1,10 @@
package com.mogo.eagle.core.function.autopilot.utils
/**
* @author xiaoyuzhou
* @date 2021/10/18 1:32 下午
*/
class AdasObjectConvertUtils {
}

View File

@@ -7,11 +7,11 @@ import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.commons.AbsMogoApplication
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo
import com.mogo.eagle.core.data.autopilot.*
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotStatusListener
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
@@ -38,7 +38,7 @@ class DebugSettingView @JvmOverloads constructor(
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
IMoGoAutoPilotStatusListener {
IMoGoAutopilotStatusListener {
private val TAG = "DebugSettingView"
@@ -107,19 +107,37 @@ class DebugSettingView @JvmOverloads constructor(
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
}
/**
* 自动驾驶相关回调
*/
override fun onAutoPilotArriveAtStation(data: AutoPilotStationInfo?) {
}
override fun onAutoPilotStateChanged(state: Int, reason: String?) {
}
override fun onAutoPilotStatusResponse(autoPilotStatusInfo: AutoPilotStatusInfo?) {
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
tvAutopilotInfo.text = GsonUtils.toJson(autoPilotStatusInfo)
}
override fun onAutopilotArriveAtStation(autopilotWayArrive: AutopilotStationInfo?) {
}
override fun onAutopilotCarStateData(autoPilotCarStateInfo: AutopilotCarStateInfo?) {
}
override fun onAutopilotRoute(autopilotRoute: AutopilotRouteInfo?) {
}
override fun onAutopilotSNRequest() {
}
override fun onAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?) {
}
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrafficData>?) {
}
override fun onAutopilotWarnMessage(autopilotWarnMessage: AutopilotWarnMessage?) {
}
}

View File

@@ -5,8 +5,8 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.LogUtils
@@ -68,10 +68,10 @@ class AutoPilotStatusView @JvmOverloads constructor(
}
private fun startAutoPilot() {
val currentAutopilot =
AutoPilotControlParameters()
AutopilotControlParameters()
currentAutopilot.isSpeakVoice = false
currentAutopilot.startLatLon = AutoPilotControlParameters.AutoPilotLonLat(40.199157289445921,116.73675895051454);
currentAutopilot.endLatLon = AutoPilotControlParameters.AutoPilotLonLat(40.199255159538758,116.73274535677977);
currentAutopilot.startLatLon = AutopilotControlParameters.AutoPilotLonLat(40.199157289445921,116.73675895051454);
currentAutopilot.endLatLon = AutopilotControlParameters.AutoPilotLonLat(40.199255159538758,116.73274535677977);
currentAutopilot.vehicleType = 10
MogoApisHandler.getInstance().apis.adasControllerApi.aiCloudToAdasData(currentAutopilot)
}
@@ -103,7 +103,7 @@ class AutoPilotStatusView @JvmOverloads constructor(
}
}
override fun onArriveAt(data: AutoPilotStationInfo?) {
override fun onArriveAt(data: AutopilotStationInfo?) {
}

View File

@@ -45,6 +45,9 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.gson
if (Boolean.valueOf(RELEASE)) {
} else {

View File

@@ -0,0 +1,269 @@
package com.mogo.eagle.core.data.autopilot;
import java.io.Serializable;
/**
* @author donghongyu
* @des 自车辆状态
* @date 2021/10/18
*/
public class AutopilotCarStateInfo implements Serializable {
/**
* action : “state”
* values : {"lon":116.8,"lat":39.4,"alt":22.3,"heading":87.5,"acceleration":0.5,"yaw_rate":0.3}
*/
private String action;
private ValuesBean values;
private float fps;
public float getFps() {
return fps;
}
public void setFps(float fps) {
this.fps = fps;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public ValuesBean getValues() {
return values;
}
public void setValues(ValuesBean values) {
this.values = values;
}
public static class ValuesBean {
/**
* lon : 116.8
* lat : 39.4
* alt : 22.3
* heading : 87.5
* acceleration : 0.5
* yaw_rate : 0.3
*/
private double lon;
private double lat;
private double alt;
private double heading;
private double acceleration;
private double yaw_rate;
//惯导车速 m/s
private float gnss_speed;
//车辆车速 m/s
private float vehicle_speed;
//gps时间
private String satelliteTime;
//UTC时间差
private long utcTimeDiffer;
//系统时间
private String systemTime;
//接收到数据的时间
private String receiverDataTime;
//接收到gps时间
private String adasSatelliteTime;
//开始接收数据时间
private String startReceiverDataTime;
//时间延迟
private long timeDiff=0;
private int turn_light; //转向灯状态 0是正常 1是左转 2是右转
private int flash_light; //双闪灯状态
private int brake_light; //刹车灯状态
private int frame_num;//统计发包个数
public int getFrame_num() {
return frame_num;
}
public void setFrame_num(int frame_num) {
this.frame_num = frame_num;
}
public long getTimeDiff() {
return timeDiff;
}
public void setTimeDiff(long timeDiff) {
this.timeDiff = timeDiff;
}
public String getReceiverDataTime() {
return receiverDataTime;
}
public void setReceiverDataTime(String receiverDataTime) {
this.receiverDataTime = receiverDataTime;
}
public String getAdasSatelliteTime() {
return adasSatelliteTime;
}
public void setAdasSatelliteTime(String adasSatelliteTime) {
this.adasSatelliteTime = adasSatelliteTime;
}
public String getSystemTime() {
return systemTime;
}
public void setSystemTime(String systemTime) {
this.systemTime = systemTime;
}
public float getGnss_speed() {
return gnss_speed;
}
public void setGnss_speed(float gnss_speed) {
this.gnss_speed = gnss_speed;
}
public float getVehicle_speed() {
return vehicle_speed;
}
public void setVehicle_speed(float vehicle_speed) {
this.vehicle_speed = vehicle_speed;
}
public int getTurn_light() {
return turn_light;
}
public void setTurn_light(int turn_light) {
this.turn_light = turn_light;
}
public int getFlash_light() {
return flash_light;
}
public void setFlash_light(int flash_light) {
this.flash_light = flash_light;
}
public int getBrake_light() {
return brake_light;
}
public void setBrake_light(int brake_light) {
this.brake_light = brake_light;
}
public double getLon() {
return lon;
}
public void setLon(double lon) {
this.lon = lon;
}
public double getLat() {
return lat;
}
public void setLat(double lat) {
this.lat = lat;
}
public double getAlt() {
return alt;
}
public void setAlt(double alt) {
this.alt = alt;
}
public double getHeading() {
return heading;
}
public void setHeading(double heading) {
this.heading = heading;
}
public double getAcceleration() {
return acceleration;
}
public void setAcceleration(double acceleration) {
this.acceleration = acceleration;
}
public double getYaw_rate() {
return yaw_rate;
}
public void setYaw_rate(double yaw_rate) {
this.yaw_rate = yaw_rate;
}
public String getSatelliteTime() {
return satelliteTime;
}
public void setSatelliteTime(String satelliteTime) {
this.satelliteTime = satelliteTime;
}
public long getUtcTimeDiffer() {
return utcTimeDiffer;
}
public void setUtcTimeDiffer(long utcTimeDiffer) {
this.utcTimeDiffer = utcTimeDiffer;
}
public String getStartReceiverDataTime() {
return startReceiverDataTime;
}
public void setStartReceiverDataTime(String startReceiverDataTime) {
this.startReceiverDataTime = startReceiverDataTime;
}
@Override
public String toString() {
return "ValuesBean{" +
"lon=" + lon +
", lat=" + lat +
", alt=" + alt +
", heading=" + heading +
", acceleration=" + acceleration +
", yaw_rate=" + yaw_rate +
", gnss_speed=" + gnss_speed +
", vehicle_speed=" + vehicle_speed +
", satelliteTime='" + satelliteTime + '\'' +
", utcTimeDiffer='" + utcTimeDiffer + '\'' +
", systemTime='" + systemTime + '\'' +
", receiverDataTime='" + receiverDataTime + '\'' +
", startReceiverDataTime='" + startReceiverDataTime + '\'' +
", timeDiff=" + timeDiff +
", turn_light=" + turn_light +
", flash_light=" + flash_light +
", brake_light=" + brake_light +
", frame_num=" + frame_num +
'}';
}
}
@Override
public String toString() {
return "CarStateInfo{" +
"action='" + action + '\'' +
", values=" + values +
'}';
}
}

View File

@@ -0,0 +1,27 @@
package com.mogo.eagle.core.data.autopilot;
public
/**
* @author congtaowang
* @since 2020/10/22
*
* 域控制器 控制指令发送
*/
class AutopilotControlCmdParameter {
public String action;
public Object result;
public AutopilotControlCmdParameter(String action, Object result) {
this.action = action;
this.result = result;
}
@Override
public String toString() {
return "AutoPilotControlCmdParameter{" +
"action='" + action + '\'' +
", result=" + result +
'}';
}
}

View File

@@ -0,0 +1,54 @@
package com.mogo.eagle.core.data.autopilot;
import java.util.List;
/**
* @author donghongyu
* @since 2021/09/22
* <p>
* 启动自动驾驶参数
*/
public class AutopilotControlParameters {
public AutoPilotLonLat startLatLon;
public List<AutoPilotLonLat> wayLatLons;
public AutoPilotLonLat endLatLon;
public float speedLimit;
public int vehicleType;// 运营类型
/**
* 是否播放adas的 开始自动驾驶 语音
*/
public boolean isSpeakVoice = true;
public static class AutoPilotLonLat {
public double lat;
public double lon;
public AutoPilotLonLat() {
}
public AutoPilotLonLat(double lat, double lon) {
this.lat = lat;
this.lon = lon;
}
@Override
public String toString() {
return "AutoPilotLonLat{" +
"lat=" + lat +
", lon=" + lon +
'}';
}
}
@Override
public String toString() {
return "RemoteControlAutoPilotParameters{" +
"startLatLon=" + startLatLon +
", wayLatLons=" + wayLatLons +
", endLatLon=" + endLatLon +
", speedLimit=" + speedLimit +
", vehicleType=" + vehicleType +
'}';
}
}

View File

@@ -0,0 +1,164 @@
package com.mogo.eagle.core.data.autopilot;
import com.google.gson.annotations.SerializedName;
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotCpuState;
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotDiskState;
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotHardwareState;
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotMemState;
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotNetFlowState;
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotNodeState;
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotProgramState;
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotTopicState;
import java.io.Serializable;
import java.util.List;
/**
* @author xiaoyuzhou
* @date 2021/10/18 12:54 下午
* 工控机节点状态信息
*/
public class AutopilotGuardianStatusInfo implements Serializable {
@SerializedName("action")
private String action;
@SerializedName("value")
private AutopilotGuardianResult value;
public static class AutopilotGuardianResult {
//车辆类型 WEY-长城 DF-东风 BYD-比亚迪 JINLV-金旅
@SerializedName("cartype")
private String carType;
//车牌号
@SerializedName("carnum")
private String carNum;
//ws连接状态 0-非链接 1-链接
@SerializedName("websocket_state")
private String wsState;
//ai云长链状态 0-非链接 1-链接
@SerializedName("aicloud_state")
private String aiCloudState;
//感知 eagle_hz
@SerializedName("eagle_hz")
private String eagleHz;
//软件节点
@SerializedName("nodestate")
private List<AutopilotNodeState> nodeState;
//topic
@SerializedName("topicstate")
private List<AutopilotTopicState> topicState;
//硬件节点
@SerializedName("hardwarestate")
private List<AutopilotHardwareState> hardwareState;
//CPU
@SerializedName("cpustate")
private AutopilotCpuState cpuState;
//内存
@SerializedName("memstate")
private AutopilotMemState memState;
//硬盘状态
@SerializedName("diskstate")
private List<AutopilotDiskState> diskState;
//占CPU最多的10个程序
@SerializedName("programcpustate")
private List<AutopilotProgramState> programCpuState;
//占内存最多的10个程序
@SerializedName("programmemstate")
private List<AutopilotProgramState> programMemState;
//流量
@SerializedName("netflowstate")
private List<AutopilotNetFlowState> netFlowState;
public String getCarType() {
return carType;
}
public String getCarNum() {
return carNum;
}
public String getWsState() {
return wsState;
}
public String getAiCloudState() {
return aiCloudState;
}
public List<AutopilotNodeState> getNodeState() {
return nodeState;
}
public List<AutopilotHardwareState> getHardwareState() {
return hardwareState;
}
public AutopilotCpuState getCpuState() {
return cpuState;
}
public AutopilotMemState getMemState() {
return memState;
}
public List<AutopilotDiskState> getDiskState() {
return diskState;
}
public String getEagleHz() {
return eagleHz;
}
public List<AutopilotProgramState> getProgramCpuState() {
return programCpuState;
}
public List<AutopilotProgramState> getProgramMemState() {
return programMemState;
}
public List<AutopilotNetFlowState> getNetFlowState() {
return netFlowState;
}
public List<AutopilotTopicState> getTopicState() {
return topicState;
}
@Override
public String toString() {
return "AutopilotGuardianResult{" +
"carType='" + carType + '\'' +
", carNum='" + carNum + '\'' +
", wsState='" + wsState + '\'' +
", aiCloudState='" + aiCloudState + '\'' +
", eagleHz='" + eagleHz + '\'' +
", nodeState=" + nodeState +
", topicState=" + topicState +
", hardwareState=" + hardwareState +
", cpuState=" + cpuState +
", memState=" + memState +
", diskState=" + diskState +
", programCpuState=" + programCpuState +
", programMemState=" + programMemState +
", netFlowState=" + netFlowState +
'}';
}
}
public String getAction() {
return action;
}
public AutopilotGuardianResult getValue() {
return value;
}
@Override
public String toString() {
return "AutopilotGuardianInfo{" +
"action='" + action + '\'' +
", value=" + value +
'}';
}
}

View File

@@ -0,0 +1,70 @@
package com.mogo.eagle.core.data.autopilot;
import java.util.List;
/**
* @author song kenan
* @des
* @date 2021/6/21
*/
public class AutopilotRouteInfo {
private String action;
private List<RouteModels> models;
public static class RouteModels {
private Double lat;
private Double lon;
public Double getLat() {
return lat;
}
public void setLat(Double lat) {
this.lat = lat;
}
public Double getLon() {
return lon;
}
public void setLon(Double lon) {
this.lon = lon;
}
@Override
public String toString() {
return "RouteModels{" +
"lat=" + lat +
", lon=" + lon +
'}';
}
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public List<RouteModels> getModels() {
return models;
}
public void setModels(List<RouteModels> models) {
this.models = models;
}
@Override
public String toString() {
return "AutopilotRoute{" +
"action='" + action + '\'' +
", models=" + models +
'}';
}
}

View File

@@ -0,0 +1,53 @@
package com.mogo.eagle.core.data.autopilot;
/**
* @author congtaowang
* @since 2021/1/18
* <p>
* 自动驾驶网约车回调数据
*/
public class AutopilotStationInfo {
private int type;
private double lon;
private double lat;
public AutopilotStationInfo(int type, double lon, double lat) {
this.type = type;
this.lon = lon;
this.lat = lat;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public double getLon() {
return lon;
}
public void setLon(double lon) {
this.lon = lon;
}
public double getLat() {
return lat;
}
public void setLat(double lat) {
this.lat = lat;
}
@Override
public String toString() {
return "AutoPilotStationInfo{" +
"type=" + type +
", lon=" + lon +
", lat=" + lat +
'}';
}
}

View File

@@ -0,0 +1,108 @@
package com.mogo.eagle.core.data.autopilot;
import java.io.Serializable;
/**
* @author nie yunlong
* @des
* @date 2020/7/14
*/
public class AutopilotStatus implements Serializable {
/**
* action : autopilotstate
* values : {"state":0,"reason":""}
*/
private String action;
private ValuesBean values;
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public ValuesBean getValues() {
return values;
}
public void setValues(ValuesBean values) {
this.values = values;
}
public static class ValuesBean {
/**
* 0是不可用 1是ready 2是自动驾驶start
*
* @return
*/
private int state;
/**
* 车速 m/s
*/
private float speed;
/**
* 不可用原因
*/
private String reason;
/**
* 摄像头状态 1代表开启0代表关闭
*/
private int camera;
/**
* 雷达状态 1代表开启0代表关闭
*/
private int radar;
/**
* RTK状态 1代表开启0代表关闭
*/
private int rtk;
/**
* 自动驾驶状态 0非自动驾驶1自动驾驶
*/
private int pilotmode;
public int getState() {
return state;
}
public void setState(int state) {
this.state = state;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public float getSpeed() {
return speed;
}
public void setSpeed(float speed) {
this.speed = speed;
}
public int getCamera() {
return camera;
}
public int getRadar() {
return radar;
}
public int getRtk() {
return rtk;
}
public int getPilotmode() {
return pilotmode;
}
}
}

View File

@@ -0,0 +1,61 @@
package com.mogo.eagle.core.data.autopilot
import java.io.Serializable
/**
* @author xiaoyuzhou
* @date 2021/10/12 8:16 下午
* 域控制器状态信息
* 不建议自己初始化此对象,建议使用 CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
*/
class AutopilotStatusInfo : Serializable {
/**
* 当前链接的IP地址, 默认地址 192.168.1.102
*/
var connectIP: String = "0.0.0.0"
var connectStatus = false
var version: String = "v0.0"
/**
* 定位是否可用
*/
var locationStatus = false
var locationLat = 0.0
var locationLon = 0.0
/**
* 车速 m/s
*/
var speed = 0f
/**
* 自动驾驶状态 0是不可用 1是ready 2是自动驾驶start
*/
var state = 0
/**
* 不可用原因
*/
var reason: String = ""
/**
* 摄像头状态 1代表开启0代表关闭
*/
var camera = 0
/**
* 雷达状态 1代表开启0代表关闭
*/
var radar = 0
/**
* RTK状态 1代表开启0代表关闭
*/
var rtk = 0
/**
* 自动驾驶状态 0非自动驾驶1自动驾驶
*/
var pilotmode = 0
}

View File

@@ -0,0 +1,32 @@
package com.mogo.eagle.core.data.autopilot;
/**
* @author congtaowang
* @since 2020/10/25
* <p>
* 描述
*/
public class AutopilotWarnMessage {
public String content;
public String level;
/**
* 警告消息类型
* <p>
* {@link MogoADASWarnType}
*/
public int type;
public String value;
@Override
public String toString() {
return "ADASWarnMessage{" +
"content='" + content + '\'' +
", level='" + level + '\'' +
", type=" + type +
", value='" + value + '\'' +
'}';
}
}

View File

@@ -0,0 +1,64 @@
package com.mogo.eagle.core.data.autopilot;
/**
* @author congtaowang
* @since 2020/10/25
* <p>
* 描述
*/
public interface MogoADASWarnType {
/**
* 行人报警
*/
int ADAS_WARNING_PERSON = 16;
/**
* 前车起步
*/
int ADAS_WARNING_FRONT_CAR_GO = 17;
/**
* ldw 类型 左侧车道线
*/
int ADAS_WARNING_SENCE_LANE_LEFT_LOST = 18;
/**
* 右侧车道线
*/
int ADAS_WARNING_SENCE_LANE_RIGHT_LOST = 19;
/**
* fcw 类型
*/
int ADAS_WARNING_FRONT_CAR = 20;
/**
* 摩托车碰撞
*/
int ADAS_WARNING_MOTORCYCLE = 23;
/**
* 急刹车
*/
int ADAS_WARNING_QUICK_BRAKE = 30;
/**
* 禁止掉头
*/
int ADAS_WARNING_NOT_U_TURN = 40;
/**
* 禁止左转
*/
int ADAS_WARNING_NOT_LEFT_TURN = 41;
/**
* 禁止右转
*/
int ADAS_WARNING_NOT_RIGHT_TURN = 42;
/**
* 禁止鸣喇叭
*/
int ADAS_WARNING_NOT_VOICE = 43;
/**
* 禁止通行
*/
int ADAS_WARNING_DO_NOT_ENTER = 44;
/**
* 限速
*/
int ADAS_WARNING_LIMIT_SPEED = 45;
}

View File

@@ -0,0 +1,81 @@
package com.mogo.eagle.core.data.autopilot.guardian;
import com.google.gson.annotations.SerializedName;
/**
* @author song kenan
* @des CPU状态
* @date 2021/8/11
*/
public class AutopilotCpuState {
//cup总使用率
@SerializedName("all")
private Double all;
@SerializedName("cpu1")
private Double cpu1;
@SerializedName("cpu2")
private Double cpu2;
@SerializedName("cpu3")
private Double cpu3;
@SerializedName("cpu4")
private Double cpu4;
@SerializedName("cpu5")
private Double cpu5;
@SerializedName("cpu6")
private Double cpu6;
@SerializedName("cpu7")
private Double cpu7;
@SerializedName("cpu8")
private Double cpu8;
public Double getAll() {
return all;
}
public Double getCpu1() {
return cpu1;
}
public Double getCpu2() {
return cpu2;
}
public Double getCpu3() {
return cpu3;
}
public Double getCpu4() {
return cpu4;
}
public Double getCpu5() {
return cpu5;
}
public Double getCpu6() {
return cpu6;
}
public Double getCpu7() {
return cpu7;
}
public Double getCpu8() {
return cpu8;
}
@Override
public String toString() {
return "AutopilotCpuState{" +
"all=" + all +
", cpu1=" + cpu1 +
", cpu2=" + cpu2 +
", cpu3=" + cpu3 +
", cpu4=" + cpu4 +
", cpu5=" + cpu5 +
", cpu6=" + cpu6 +
", cpu7=" + cpu7 +
", cpu8=" + cpu8 +
'}';
}
}

View File

@@ -0,0 +1,65 @@
package com.mogo.eagle.core.data.autopilot.guardian;
import com.google.gson.annotations.SerializedName;
/**
* @author song kenan
* @des 磁盘信息
* @date 2021/8/11
*/
public class AutopilotDiskState {
//磁盘总大小
@SerializedName("diskall")
private String diskall;
//磁盘空闲大小
@SerializedName("diskfree")
private String diskfree;
//磁盘挂在目录
@SerializedName("diskmount")
private String diskmount;
//磁盘名称
@SerializedName("diskname")
private String diskname;
//磁盘使用百分比
@SerializedName("diskpercent")
private String diskpercent;
//磁盘已使用大小
@SerializedName("diskuse")
private String diskuse;
public String getDiskall() {
return diskall;
}
public String getDiskfree() {
return diskfree;
}
public String getDiskmount() {
return diskmount;
}
public String getDiskname() {
return diskname;
}
public String getDiskpercent() {
return diskpercent;
}
public String getDiskuse() {
return diskuse;
}
@Override
public String toString() {
return "AutopilotDiskState{" +
"diskall='" + diskall + '\'' +
", diskfree='" + diskfree + '\'' +
", diskmount='" + diskmount + '\'' +
", diskname='" + diskname + '\'' +
", diskpercent='" + diskpercent + '\'' +
", diskuse='" + diskuse + '\'' +
'}';
}
}

View File

@@ -0,0 +1,41 @@
package com.mogo.eagle.core.data.autopilot.guardian;
import com.google.gson.annotations.SerializedName;
/**
* @author song kenan
* @des 硬件状态
* @date 2021/7/26
*/
public class AutopilotHardwareState {
/**
* 0不正常
*/
@SerializedName("run_hz")
private String runHz;
@SerializedName("set_hz")
private String setHz;
@SerializedName("topic_name")
private String topicName;
public String getRunHz() {
return runHz;
}
public String getSetHz() {
return setHz;
}
public String getTopicName() {
return topicName;
}
@Override
public String toString() {
return "AutopilotHardwareState{" +
"runHz='" + runHz + '\'' +
", setHz='" + setHz + '\'' +
", topicName='" + topicName + '\'' +
'}';
}
}

View File

@@ -0,0 +1,49 @@
package com.mogo.eagle.core.data.autopilot.guardian;
import com.google.gson.annotations.SerializedName;
/**
* @author song kenan
* @des 内存状态
* @date 2021/8/11
*/
public class AutopilotMemState {
//空闲内存(M)
@SerializedName("free")
private String free;
//内存使用百分比
@SerializedName("percent_mem")
private String percentMem;
//总内存M
@SerializedName("total_mem")
private String totalMem;
//使用的内存(M)
@SerializedName("used_mem")
private String usedMem;
public String getFree() {
return free;
}
public String getPercentMem() {
return percentMem;
}
public String getTotalMem() {
return totalMem;
}
public String getUsedMem() {
return usedMem;
}
@Override
public String toString() {
return "AutopilotMemState{" +
"free='" + free + '\'' +
", percentMem='" + percentMem + '\'' +
", totalMem='" + totalMem + '\'' +
", usedMem='" + usedMem + '\'' +
'}';
}
}

View File

@@ -0,0 +1,38 @@
package com.mogo.eagle.core.data.autopilot.guardian;
import com.google.gson.annotations.SerializedName;
/**
* @author song kenan
* @des 占用内存的程序
* @date 2021/8/16
*/
public class AutopilotNetFlowState {
@SerializedName("netname")
private String netName;
@SerializedName("recv_flow")
private String recvFlow;
@SerializedName("send_flow")
private String sendFlow;
public String getNetName() {
return netName;
}
public String getRecvFlow() {
return recvFlow;
}
public String getSendFlow() {
return sendFlow;
}
@Override
public String toString() {
return "AutopilotNetFlowState{" +
"netName='" + netName + '\'' +
", recvFlow='" + recvFlow + '\'' +
", sendFlow='" + sendFlow + '\'' +
'}';
}
}

View File

@@ -0,0 +1,34 @@
package com.mogo.eagle.core.data.autopilot.guardian;
import com.google.gson.annotations.SerializedName;
/**
* @author song kenan
* @des 工控机节点状态
* @date 2021/7/7
*/
public class AutopilotNodeState {
/**
* -on-开启, off-关闭
*/
@SerializedName("node_name")
private String nodeName;
@SerializedName("node_state")
private String nodeState;
public String getNodeName() {
return nodeName;
}
public String getNodeState() {
return nodeState;
}
@Override
public String toString() {
return "AutopilotNodeState{" +
"nodeName='" + nodeName + '\'' +
", nodeState='" + nodeState + '\'' +
'}';
}
}

View File

@@ -0,0 +1,41 @@
package com.mogo.eagle.core.data.autopilot.guardian;
import com.google.gson.annotations.SerializedName;
/**
* @author song kenan
* @des 占用内存的程序
* @date 2021/8/16
*/
public class AutopilotProgramState {
//cpu
@SerializedName("cpu_percent")
private String cpuPercent;
//内存
@SerializedName("mem_percent")
private String memPercent;
//name
@SerializedName("prog_name")
private String progName;
public String getCpuPercent() {
return cpuPercent;
}
public String getMemPercent() {
return memPercent;
}
public String getProgName() {
return progName;
}
@Override
public String toString() {
return "AutopilotProgramState{" +
"cpuPercent='" + cpuPercent + '\'' +
", memPercent='" + memPercent + '\'' +
", progName='" + progName + '\'' +
'}';
}
}

View File

@@ -0,0 +1,39 @@
package com.mogo.eagle.core.data.autopilot.guardian;
import com.google.gson.annotations.SerializedName;
/**
* @author song kenan
* @des topic info
* @date 2021/8/16
*/
public class AutopilotTopicState {
@SerializedName("run_hz")
private String runHz;
@SerializedName("set_hz")
private String setHz;
@SerializedName("topic_name")
private String topicName;
public String getRunHz() {
return runHz;
}
public String getSetHz() {
return setHz;
}
public String getTopicName() {
return topicName;
}
@Override
public String toString() {
return "AutopilotTopicState{" +
"runHz='" + runHz + '\'' +
", setHz='" + setHz + '\'' +
", topicName='" + topicName + '\'' +
'}';
}
}

View File

@@ -74,6 +74,25 @@ enum class TrafficTypeEnum(
"道路施工",
R.raw.v2x_shigong_warning,
R.raw.v2x_shigong_warning
)
);
companion object {
@JvmStatic
fun getType(type: Int): TrafficTypeEnum {
return when (type) {
TYPE_TRAFFIC_ID_WEI_ZHI.type -> TYPE_TRAFFIC_ID_WEI_ZHI
TYPE_TRAFFIC_ID_PEOPLE.type -> TYPE_TRAFFIC_ID_PEOPLE
TYPE_TRAFFIC_ID_BICYCLE.type -> TYPE_TRAFFIC_ID_BICYCLE
TYPE_TRAFFIC_ID_TA_CHE.type -> TYPE_TRAFFIC_ID_TA_CHE
TYPE_TRAFFIC_ID_MOTO.type -> TYPE_TRAFFIC_ID_MOTO
TYPE_TRAFFIC_ID_BUS.type -> TYPE_TRAFFIC_ID_BUS
TYPE_TRAFFIC_ID_TRUCK.type -> TYPE_TRAFFIC_ID_TRUCK
TYPE_TRAFFIC_ID_CAMERA.type -> TYPE_TRAFFIC_ID_CAMERA
TYPE_TRAFFIC_ID_SPECIAL_VEHICLE.type -> TYPE_TRAFFIC_ID_SPECIAL_VEHICLE
TYPE_TRAFFIC_ID_DAO_LU_SHI_GONG.type -> TYPE_TRAFFIC_ID_DAO_LU_SHI_GONG
else -> TYPE_TRAFFIC_ID_WEI_ZHI
}
}
}
}

View File

@@ -18,6 +18,16 @@ class TrafficData {
*/
var uuid: String = ""
/**
* 车牌id
*/
var carId: String = ""
/**
* 数据来源精度 0 - 普通定位、1 - 高精定位
*/
var dataAccuracy = 1
/**
* 识别物体的纬度
*/

View File

@@ -1,22 +0,0 @@
package com.mogo.eagle.core.function.api.autopilot;
import com.mogo.eagle.core.data.traffic.TrafficData;
import java.util.List;
/**
* @author xiaoyuzhou
* @date 2021/9/23 11:23 上午
* 自动驾驶识别数据监听,回调后做数据可视化呈现
*/
public interface IMoGoAutoPilotIdentifyListener {
/**
* 识别交通元素数据发生更新
*
* @param trafficData 交通元素信息列表
*/
void onIdentifyDataUpdate(List<TrafficData> trafficData);
}

View File

@@ -1,48 +0,0 @@
package com.mogo.eagle.core.function.api.autopilot;
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo;
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo;
/**
* @author xiaoyuzhou
* @date 2021/9/22 8:59 下午
* 自动驾驶状态回调监听
*/
public interface IMoGoAutoPilotStatusListener {
/**
* 不可自动驾驶目前场景是刚开机adas还未和工控机连接
*/
int STATUS_AUTOPILOT_DISABLE = 0;
/**
* 可自动驾驶,工控机连接正常,且处于人工干预状态
*/
int STATUS_AUTOPILOT_ENABLE = 1;
/**
* 自动驾驶中,可能是停车,可能是行进,但是是机器在处理车的前进后退,不是人
*/
int STATUS_AUTOPILOT_RUNNING = 2;
/**
* 自动驾驶到站
*
* @param data 所到车站的简单信息
*/
void onAutoPilotArriveAtStation(AutoPilotStationInfo data);
/**
* 自动驾驶状态发生改变
*
* @param state {@link #STATUS_AUTOPILOT_DISABLE}
* @param reason 不能自动驾驶的原因
*/
void onAutoPilotStateChanged(int state, String reason);
/**
* 自动驾驶状态信息
*
* @param autoPilotStatusInfo 状态信息
*/
void onAutoPilotStatusResponse(AutoPilotStatusInfo autoPilotStatusInfo);
}

View File

@@ -0,0 +1,44 @@
package com.mogo.eagle.core.function.api.autopilot;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider;
/**
* @author xiaoyuzhou
* @date 2021/9/22 8:27 下午
* 自动驾驶节点
*/
public interface IMoGoAutopilotProvider extends IMoGoFunctionServerProvider {
/**
* 连接自动驾驶域控制器
*/
void connectAutoPilot();
/**
* 开启自动驾驶
*
* @param result
*/
void startAutoPilot(AutopilotControlParameters result);
/**
* 结束自动驾驶
*/
void cancelAutoPilot();
/**
* 获取车辆自动驾驶状态
*
* @return
*/
int getAutopilotStatus();
/**
* 开启域控制器录制bag包
*
* @return true-成功,false-失败
*/
boolean recordPackage();
}

View File

@@ -0,0 +1,83 @@
package com.mogo.eagle.core.function.api.autopilot
import com.mogo.eagle.core.data.autopilot.*
import com.mogo.eagle.core.data.traffic.TrafficData
/**
* @author xiaoyuzhou
* @date 2021/9/22 8:59 下午
* 自动驾驶状态回调监听
*/
interface IMoGoAutopilotStatusListener {
/**
* 自动驾驶状态信息
*
* @param autoPilotStatusInfo 状态信息
*/
fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo)
/**
* 自动驾驶到站
*
* @param autopilotWayArrive 所到车站的简单信息
*/
fun onAutopilotArriveAtStation(autopilotWayArrive: AutopilotStationInfo?)
/**
* 车辆状态数据
*
* @param autoPilotCarStateInfo
*/
fun onAutopilotCarStateData(autoPilotCarStateInfo: AutopilotCarStateInfo?)
/**
* 自动驾驶路径
*
* @param autopilotRoute
*/
fun onAutopilotRoute(autopilotRoute: AutopilotRouteInfo?)
/**
* 工控机获取SN
*/
fun onAutopilotSNRequest()
/**
* 工控机监控节点
*/
fun onAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?)
/**
* 识别交通元素数据发生更新
*
* @param trafficData 交通元素信息列表
*/
fun onAutopilotIdentifyDataUpdate(trafficData: List<TrafficData>?)
/**
* 报警信息
*
* @param autopilotWarnMessage 预警信息
*/
fun onAutopilotWarnMessage(autopilotWarnMessage: AutopilotWarnMessage?)
companion object {
/**
* 不可自动驾驶目前场景是刚开机adas还未和工控机连接
*/
const val STATUS_AUTOPILOT_DISABLE = 0
/**
* 可自动驾驶,工控机连接正常,且处于人工干预状态
*/
const val STATUS_AUTOPILOT_ENABLE = 1
/**
* 自动驾驶中,可能是停车,可能是行进,但是是机器在处理车的前进后退,不是人
*/
const val STATUS_AUTOPILOT_RUNNING = 2
}
}

View File

@@ -1,7 +1,7 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotProvider
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
import com.mogo.eagle.core.function.call.base.CallerBase
/**
@@ -10,9 +10,9 @@ import com.mogo.eagle.core.function.call.base.CallerBase
* 域控制器管理
*/
object CallerAutoPilotManager {
private val providerApi: IMoGoAutoPilotProvider
private val providerApi: IMoGoAutopilotProvider
get() = CallerBase.getApiInstance(
IMoGoAutoPilotProvider::class.java,
IMoGoAutopilotProvider::class.java,
MogoServicePaths.PATH_AUTO_PILOT
)

View File

@@ -1,9 +1,9 @@
package com.mogo.eagle.core.function.call.autopilot
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotStatusListener
import com.mogo.eagle.core.data.autopilot.*
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.GsonUtils
@@ -15,26 +15,27 @@ import com.mogo.eagle.core.utilcode.util.LogUtils
* 域控制器相关的回调监听
*/
object CallerAutoPilotStatusListenerManager : CallerBase() {
private val TAG = "CallerAutopilotListenerManager"
private val TAG = "CallerAutoPilotStatusListenerManager"
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
private var mAutoPilotStatusInfo: AutoPilotStatusInfo = AutoPilotStatusInfo()
private var mAutopilotStatusInfo: AutopilotStatusInfo = AutopilotStatusInfo()
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val mAutoPilotStatusListeners: HashMap<String, IMoGoAutoPilotStatusListener> = HashMap()
private val M_AUTOPILOT_STATUS_LISTENERS: HashMap<String, IMoGoAutopilotStatusListener> =
HashMap()
/**
* 查询AutoPilot状态
*/
fun getAutoPilotStatusInfo(): AutoPilotStatusInfo {
return mAutoPilotStatusInfo
fun getAutoPilotStatusInfo(): AutopilotStatusInfo {
return mAutopilotStatusInfo
}
/**
* 查询AutoPilot状态
*/
fun getAutoPilotStatusInfoJsonString(): String {
return GsonUtils.toJson(mAutoPilotStatusInfo)
return GsonUtils.toJson(mAutopilotStatusInfo)
}
/**
@@ -44,10 +45,10 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
*/
fun addListener(
@Nullable tag: String,
@Nullable listener: IMoGoAutoPilotStatusListener
@Nullable listener: IMoGoAutopilotStatusListener
) {
mAutoPilotStatusListeners[tag] = listener
listener.onAutoPilotStatusResponse(mAutoPilotStatusInfo)
M_AUTOPILOT_STATUS_LISTENERS[tag] = listener
listener.onAutopilotStatusResponse(mAutopilotStatusInfo)
}
/**
@@ -55,7 +56,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
* @param tag 标记,用来注销监听使用
*/
fun removeListener(@Nullable tag: String) {
mAutoPilotStatusListeners.remove(tag)
M_AUTOPILOT_STATUS_LISTENERS.remove(tag)
}
/**
@@ -63,9 +64,9 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
* @param listener 要删除的监听对象
*/
fun removeListener(@Nullable listener: IMoGoObuStatusListener) {
mAutoPilotStatusListeners.forEach {
M_AUTOPILOT_STATUS_LISTENERS.forEach {
if (it.value == listener) {
mAutoPilotStatusListeners.remove(it.key)
M_AUTOPILOT_STATUS_LISTENERS.remove(it.key)
}
}
}
@@ -74,53 +75,125 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
* 自动驾驶状态信息回调
*/
@Synchronized
fun invokeAutoPilotStatusListener() {
LogUtils.dTag(TAG, "$mAutoPilotStatusInfo")
invokeAutoPilotStatusListener(mAutoPilotStatusInfo)
fun invokeAutoPilotStatus() {
LogUtils.dTag(TAG, "$mAutopilotStatusInfo")
invokeAutoPilotStatus(mAutopilotStatusInfo)
}
/**
* 自动驾驶状态信息回调
* @param autoPilotStatusInfo 自动驾驶状态信息
* 自动驾驶状态信息 回调
* @param autopilotStatusInfo 自动驾驶状态信息
*/
@Synchronized
fun invokeAutoPilotStatusListener(autoPilotStatusInfo: AutoPilotStatusInfo) {
LogUtils.dTag(TAG, "$autoPilotStatusInfo")
mAutoPilotStatusInfo = autoPilotStatusInfo
mAutoPilotStatusListeners.forEach {
fun invokeAutoPilotStatus(autopilotStatusInfo: AutopilotStatusInfo) {
LogUtils.dTag(TAG, "$autopilotStatusInfo")
mAutopilotStatusInfo = autopilotStatusInfo
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutoPilotStatusResponse(mAutoPilotStatusInfo)
listener.onAutopilotStatusResponse(mAutopilotStatusInfo)
}
}
/**
* 自动驾驶网约车回调数据 回调
* @param autoPilotStationInfo 自动驾驶网约车回调数据
* 自动驾驶站点信息 回调
* @param autopilotStationInfo 自动驾驶网约车回调数据
*/
fun invokeArriveAtStationListener(autoPilotStationInfo: AutoPilotStationInfo) {
LogUtils.dTag(TAG, "$autoPilotStationInfo")
mAutoPilotStatusListeners.forEach {
@Synchronized
fun invokeArriveAtStation(autopilotStationInfo: AutopilotStationInfo) {
LogUtils.dTag(TAG, "$autopilotStationInfo")
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutoPilotArriveAtStation(autoPilotStationInfo)
listener.onAutopilotArriveAtStation(autopilotStationInfo)
}
}
/**
* 自动驾驶状态回调
* @param state
* @param reason
* 车辆状态数据 回调
* @param autoPilotCarStateInfo
*/
fun invokeStateChangedListener(state: Int, reason: String) {
LogUtils.dTag(TAG, "$state $reason")
mAutoPilotStatusListeners.forEach {
@Synchronized
fun invokeAutopilotCarStateData(autoPilotCarStateInfo: AutopilotCarStateInfo?) {
LogUtils.dTag(TAG, "$autoPilotCarStateInfo")
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutoPilotStateChanged(state, reason)
listener.onAutopilotCarStateData(autoPilotCarStateInfo)
}
}
/**
* 自动驾驶路径 回调
* @param routeInfo
*/
@Synchronized
fun invokeAutopilotRoute(routeInfo: AutopilotRouteInfo?) {
LogUtils.dTag(TAG, "$routeInfo")
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotRoute(routeInfo)
}
}
/**
* 工控机获取SN 回调
*/
@Synchronized
fun invokeAutopilotSNRequest() {
LogUtils.dTag(TAG, "")
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotSNRequest()
}
}
/**
* 工控机监控节点 回调
*/
@Synchronized
fun invokeAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?) {
LogUtils.dTag(TAG, "$guardianInfo")
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotGuardian(guardianInfo)
}
}
/**
* 识别交通元素数据发生更新 回调
*/
@Synchronized
fun invokeIdentifyDataUpdate(trafficData: List<TrafficData>?) {
LogUtils.dTag(TAG, "$trafficData")
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotIdentifyDataUpdate(trafficData)
}
}
/**
* 报警信息 回调
*/
@Synchronized
fun invokeAutopilotWarnMessage(autopilotWarnMessage: AutopilotWarnMessage?) {
LogUtils.dTag(TAG, "$autopilotWarnMessage")
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotWarnMessage(autopilotWarnMessage)
}
}