整理adas控制接口

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2022-02-07 15:41:57 +08:00
parent a27476ffbe
commit ceee1d9c9a
26 changed files with 332 additions and 797 deletions

View File

@@ -1,17 +1,9 @@
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 com.mogo.eagle.core.data.autopilot.guardian.AutopilotGuardianModule;
import java.io.Serializable;
import java.util.List;
/**
* @author xiaoyuzhou
@@ -19,146 +11,103 @@ import java.util.List;
* 工控机节点状态信息
*/
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 +
'}';
}
}
//监控项名称
@SerializedName("agentName")
private String agentName;
//车牌号
@SerializedName("carNum")
private String carNum;
//车型
@SerializedName("carType")
private String carType;
//monitorType
@SerializedName("monitorType")
private String monitorType;
//sn
@SerializedName("sn")
private String sn;
//时间
@SerializedName("time")
private long time;
@SerializedName("modules")
private AutopilotGuardianModule modules;
public String getAction() {
return action;
}
public AutopilotGuardianResult getValue() {
return value;
public void setAction(String action) {
this.action = action;
}
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public String getCarNum() {
return carNum;
}
public void setCarNum(String carNum) {
this.carNum = carNum;
}
public String getCarType() {
return carType;
}
public void setCarType(String carType) {
this.carType = carType;
}
public String getMonitorType() {
return monitorType;
}
public void setMonitorType(String monitorType) {
this.monitorType = monitorType;
}
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public long getTime() {
return time;
}
public void setTime(long time) {
this.time = time;
}
public AutopilotGuardianModule getModules() {
return modules;
}
public void setModules(AutopilotGuardianModule modules) {
this.modules = modules;
}
@Override
public String toString() {
return "AutopilotGuardianInfo{" +
"action='" + action + '\'' +
", value=" + value +
", agentName='" + agentName + '\'' +
", carNum='" + carNum + '\'' +
", carType='" + carType + '\'' +
", monitorType='" + monitorType + '\'' +
", modules=" + modules +
'}';
}
}

View File

@@ -1,6 +1,8 @@
package com.mogo.eagle.core.data.autopilot;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
@@ -11,11 +13,15 @@ import java.util.List;
public class AutopilotRouteInfo {
@SerializedName("action")
private String action;
@SerializedName("models")
private List<RouteModels> models;
public static class RouteModels {
@SerializedName("lat")
private Double lat;
@SerializedName("lon")
private Double lon;
public Double getLat() {

View File

@@ -1,81 +0,0 @@
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

@@ -1,65 +0,0 @@
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,39 @@
package com.mogo.eagle.core.data.autopilot.guardian;
import com.google.gson.annotations.SerializedName;
/**
* @author song kenan
* @des
* @date 2021/12/10
*/
public class AutopilotGuardianItem {
@SerializedName("name")
private String name;
@SerializedName("value")
private String value;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
public String toString() {
return "GuardianItem{" +
"name='" + name + '\'' +
", value='" + value + '\'' +
'}';
}
}

View File

@@ -0,0 +1,41 @@
package com.mogo.eagle.core.data.autopilot.guardian;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* @author song kenan
* @des
* @date 2021/12/10
*/
public class AutopilotGuardianItemsName {
@SerializedName("name")
private String name;
@SerializedName("items")
private List<AutopilotGuardianItem> items;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<AutopilotGuardianItem> getItems() {
return items;
}
public void setItems(List<AutopilotGuardianItem> items) {
this.items = items;
}
@Override
public String toString() {
return "GuardianItemsName{" +
"name='" + name + '\'' +
", items=" + items +
'}';
}
}

View File

@@ -0,0 +1,41 @@
package com.mogo.eagle.core.data.autopilot.guardian;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* @author song kenan
* @des
* @date 2021/12/10
*/
public class AutopilotGuardianModule {
@SerializedName("itemsname")
private List<AutopilotGuardianItemsName> itemsname;
@SerializedName("submodules")
private List<AutopilotGuardianSubmodule> submodules;
public List<AutopilotGuardianItemsName> getItemsname() {
return itemsname;
}
public void setItemsname(List<AutopilotGuardianItemsName> itemsname) {
this.itemsname = itemsname;
}
public List<AutopilotGuardianSubmodule> getSubmodules() {
return submodules;
}
public void setSubmodules(List<AutopilotGuardianSubmodule> submodules) {
this.submodules = submodules;
}
@Override
public String toString() {
return "GuardianModule{" +
"itemsname=" + itemsname +
", submodules=" + submodules +
'}';
}
}

View File

@@ -0,0 +1,84 @@
package com.mogo.eagle.core.data.autopilot.guardian;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* @author song kenan
* @des
* @date 2021/12/10
*/
public class AutopilotGuardianSubmodule {
@SerializedName("modulename")
private String modulename;
@SerializedName("subnodes")
private List<Subnode> subnodes;
public String getModulename() {
return modulename;
}
public void setModulename(String modulename) {
this.modulename = modulename;
}
public List<Subnode> getSubnodes() {
return subnodes;
}
public void setSubnodes(List<Subnode> subnodes) {
this.subnodes = subnodes;
}
public static class Subnode {
@SerializedName("nodename")
private String nodename;
@SerializedName("nodeitems")
private List<AutopilotGuardianItemsName> nodeitems;
@SerializedName("topicitems")
private List<AutopilotGuardianItemsName> topicitems;
public String getNodename() {
return nodename;
}
public void setNodename(String nodename) {
this.nodename = nodename;
}
public List getNodeitems() {
return nodeitems;
}
public void setNodeitems(List nodeitems) {
this.nodeitems = nodeitems;
}
public List<AutopilotGuardianItemsName> getTopicitems() {
return topicitems;
}
public void setTopicitems(List<AutopilotGuardianItemsName> topicitems) {
this.topicitems = topicitems;
}
@Override
public String toString() {
return "Subnode{" +
"nodename='" + nodename + '\'' +
", nodeitems=" + nodeitems +
", topicitems=" + topicitems +
'}';
}
}
@Override
public String toString() {
return "GuardianSubmodule{" +
"modulename='" + modulename + '\'' +
", subnodes=" + subnodes +
'}';
}
}

View File

@@ -1,41 +0,0 @@
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

@@ -1,49 +0,0 @@
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

@@ -1,38 +0,0 @@
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

@@ -1,34 +0,0 @@
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

@@ -1,41 +0,0 @@
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

@@ -1,39 +0,0 @@
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

@@ -7,7 +7,7 @@ import com.mogo.eagle.core.data.enums.TrafficTypeEnum
* @date 2021/8/17 8:41 下午
* 交通元素数据,
*/
class TrafficData {
class /**/TrafficData {
/**
* 交通元素类型, 车、人、摩托、大巴车、卡车、自行车
*/

View File

@@ -2,14 +2,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.module.adas">
<application>
<receiver android:name=".receiver.AdasTestPanelBroadCastReceiver">
<intent-filter>
<action android:name="com.adas.test_panel_control" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
</application>
</manifest>

View File

@@ -1,8 +0,0 @@
package com.mogo.module.adas;
/**
* Created by XuYong on 2021/5/28 15:24
*/
public class AdasConstant {
public static final String MODULE_TAG = "AdasConstant";
}

View File

@@ -4,6 +4,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.gson.Gson;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
import com.mogo.eagle.core.data.autopilot.AutoPilotRecordResult;
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
@@ -30,6 +31,7 @@ import com.mogo.module.common.drawer.IdentifyDataDrawer;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotStateModel;
import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.support.adas.high.OnAdasMsgConnectStatusListener;
import com.zhidao.support.adas.high.bean.BasicInfo;
import com.zhidao.support.obu.ami.AmiClientManager;
import java.util.ArrayList;
@@ -56,7 +58,6 @@ public class AdasEventManager implements
private final Gson gson;
private final ArrayList<IAdasDataListener> iAdasEventListeners = new ArrayList<>();
private final ArrayList<IAdasStatusListener> iAdasStatusListeners = new ArrayList<>();
//自动驾驶状态
private int mCurrentAutopilotStatus = -1;
//自动驾驶车速度
@@ -64,7 +65,6 @@ public class AdasEventManager implements
//自动驾驶状态
private AutopilotStatusInfo mAutopilotValuesStatus = null;
private IAdasProviderBizListener providerBizListener;
private AdasEventManager() {
gson = GsonUtil.getGson();
@@ -98,32 +98,19 @@ public class AdasEventManager implements
iAdasEventListeners.remove(listener);
}
public void addStatusListener(IAdasStatusListener listener) {
Logger.d(TAG, "添加adas状态事件监听");
if (iAdasStatusListeners.contains(listener)) {
return;
}
iAdasStatusListeners.add(listener);
/**
* 同步SN信息给工控机
*/
public void syncBasicInfoToAutopilot() {
Logger.d(TAG, "同步PAD的SN给工控机……");
BasicInfo info = new BasicInfo();
info.setSn(MoGoAiCloudClientConfig.getInstance().getSn());
AdasManager.getInstance().setBasicInfo(info);
}
public void removeStatusListener(IAdasStatusListener listener) {
Logger.d(TAG, "注销adas状态事件监听");
iAdasStatusListeners.remove(listener);
}
public void removeStatusListener() {
Logger.d(TAG, "注销adas状态事件监听");
iAdasStatusListeners.clear();
}
@Override
public void onAutopilotSNRequest() {
if (providerBizListener != null) {
providerBizListener.getDeviceSn();
} else {
Logger.e(TAG, "onAutopilotSNRequest providerBizListener is null");
}
syncBasicInfoToAutopilot();
}
@Override
@@ -134,9 +121,11 @@ public class AdasEventManager implements
CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().setConnectStatus(true);
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
for (IAdasStatusListener listener : iAdasStatusListeners) {
listener.onServiceConnected();
}
// 同步SN给工控机
syncBasicInfoToAutopilot();
// 开启轮训上传自动驾驶状态
updateDriveStatusTask();
}
@@ -146,9 +135,6 @@ public class AdasEventManager implements
CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().setConnectIP(AdasManager.getInstance().getAdasConfig().getAddress());
CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().setConnectStatus(false);
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
for (IAdasStatusListener listener : iAdasStatusListeners) {
listener.onServiceDisconnected();
}
}
public void updateDriveStatusTask() {
@@ -178,10 +164,6 @@ public class AdasEventManager implements
return adasAIDLAutopilotStateModel;
}
public void setProviderBizListener(IAdasProviderBizListener listener) {
providerBizListener = listener;
}
@Override
public void onAutopilotStatusResponse(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
int state = autoPilotStatusInfo.getState();
@@ -218,12 +200,15 @@ public class AdasEventManager implements
}
}
//can数据转发
AutopilotCarStateInfo.ValuesBean bean = autoPilotCarStateInfo.getValues();
if (bean != null) {
int turn_light = bean.getTurn_light(); //转向灯状态 0是正常 1是左转 2是右转
AmiClientManager.getInstance().setTurnLightState(turn_light);
// 获取的自动驾驶车辆信息不是空的时候
if (autoPilotCarStateInfo != null) {
//can数据转发
AutopilotCarStateInfo.ValuesBean bean = autoPilotCarStateInfo.getValues();
if (bean != null) {
//转向灯状态 0是正常 1是左转 2是右转
int turnLight = bean.getTurn_light();
AmiClientManager.getInstance().setTurnLightState(turnLight);
}
}
}
@@ -248,24 +233,12 @@ public class AdasEventManager implements
@Override
public void onAutopilotWarnMessage(@Nullable AutopilotWarnMessage autopilotWarnMessage) {
Logger.d(TAG, "onWarnMessage " + autopilotWarnMessage);
//报警model
for (IAdasDataListener listener : iAdasEventListeners) {
if (listener != null) {
listener.onWarnMessage(autopilotWarnMessage);
}
}
}
@Override
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfo) {
if (trajectoryInfo != null && trajectoryInfo.size() > 0) {
for (IAdasDataListener listener : iAdasEventListeners) {
if (listener != null) {
listener.onAutopilotTrajectory(trajectoryInfo);
}
}
}
}
@@ -276,12 +249,6 @@ public class AdasEventManager implements
@Override
public void onAutopilotRecordResult(AutoPilotRecordResult result) {
if (result != null) {
for (IAdasDataListener listener : iAdasEventListeners) {
if (listener != null) {
listener.onAutopilotRecordResult(result);
}
}
}
}
}

View File

@@ -24,22 +24,22 @@ object AdasObjectUtils {
fun fromAutopilotGuardianInfo(autopilotGuardianInfo: AutopilotGuardianInfo): AutopilotGuardianStatusInfo? {
return GsonUtil.objectFromJson(
GsonUtil.jsonFromObject(autopilotGuardianInfo),
AutopilotGuardianStatusInfo::class.java
GsonUtil.jsonFromObject(autopilotGuardianInfo),
AutopilotGuardianStatusInfo::class.java
)
}
fun fromAdasAutopilotRoute(carStateInfo: AutopilotRoute): AutopilotRouteInfo? {
return GsonUtil.objectFromJson(
GsonUtil.jsonFromObject(carStateInfo),
AutopilotRouteInfo::class.java
GsonUtil.jsonFromObject(carStateInfo),
AutopilotRouteInfo::class.java
)
}
fun fromAdasCarStateInfoObject(carStateInfo: CarStateInfo): AutopilotCarStateInfo? {
return GsonUtil.objectFromJson(
GsonUtil.jsonFromObject(carStateInfo),
AutopilotCarStateInfo::class.java
GsonUtil.jsonFromObject(carStateInfo),
AutopilotCarStateInfo::class.java
)
}
@@ -47,8 +47,7 @@ object AdasObjectUtils {
if (info == null) {
return null
}
val warnMessage =
AutopilotWarnMessage()
val warnMessage = AutopilotWarnMessage()
warnMessage.content = info.content
warnMessage.level = info.level
try {

View File

@@ -4,13 +4,11 @@ import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotStateModel;
import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.support.adas.high.bean.BasicInfo;
import com.zhidao.support.adas.high.common.CupidLogUtils;
@@ -31,18 +29,6 @@ public class AdasProvider implements IProvider {
Logger.d(TAG, "初始化 AdasProvider 模块");
adasEventManager = AdasEventManager.getInstance();
initAdas(context, adasEventManager);
addAdasStatusListener(new IAdasStatusListener() {
@Override
public void onServiceConnected() {
Logger.d(TAG, "adas statusListener connected & send sn");
setBasicInfo();
}
@Override
public void onServiceDisconnected() {
Logger.d(TAG, "adas statuslistener disconnected");
}
});
}
private void initAdas(Context context, AdasEventManager adasEventManager) {
@@ -65,13 +51,6 @@ public class AdasProvider implements IProvider {
}
AdasManager.getInstance().setOnAdasListener(new OnAdasListenerAdapter());
AdasManager.getInstance().setOnAdasConnectStatusListener(adasEventManager);
adasEventManager.setProviderBizListener(this::setBasicInfo);
}
public void setBasicInfo() {
BasicInfo info = new BasicInfo();
info.setSn(MoGoAiCloudClientConfig.getInstance().getSn());
AdasManager.getInstance().setBasicInfo(info);
}
public void addAdasEventListener(IAdasDataListener listener) {
@@ -82,14 +61,6 @@ public class AdasProvider implements IProvider {
adasEventManager.removeEventListener(listener);
}
public void addAdasStatusListener(IAdasStatusListener listener) {
adasEventManager.addStatusListener(listener);
}
public void removeAdasStatusListener() {
adasEventManager.removeStatusListener();
}
public void sendWsMessage(String msg) {
AdasManager.getInstance().aiCloudToAdasData(msg);
}

View File

@@ -1,27 +1,11 @@
package com.mogo.module.adas;
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
import com.mogo.eagle.core.data.autopilot.AutoPilotRecordResult;
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage;
import java.util.ArrayList;
import java.util.List;
public interface IAdasDataListener {
default void sendMsg(String msg) {
}
default void onWarnMessage(AutopilotWarnMessage autopilotWarnMessage) {
}
/**
* 自动驾驶到达站点回调接口
*
@@ -46,18 +30,4 @@ public interface IAdasDataListener {
default void notifyAutopilotState(AutopilotStatusInfo autopilotStatus) {
}
/**
* 车前引导路径回调
* @param trajectory
*/
default void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectory) {
}
/**
* 采集任务结果回调
* @param record 结果数据
*/
default void onAutopilotRecordResult(AutoPilotRecordResult record) {}
}

View File

@@ -1,6 +0,0 @@
package com.mogo.module.adas;
public interface IAdasProviderBizListener {
void getDeviceSn();
}

View File

@@ -1,11 +0,0 @@
package com.mogo.module.adas;
/**
* Created by XuYong on 4/28/21 16:19
*/
public interface IAdasStatusListener {
void onServiceConnected();
void onServiceDisconnected();
}

View File

@@ -1,47 +0,0 @@
package com.mogo.module.adas.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.module.adas.AdasProvider;
public class AdasTestPanelBroadCastReceiver extends BroadcastReceiver {
private static final String TAG = "AdasTestPanelBroadCastReceiver";
/**
* Adas测试控制面板广播Action
*/
public static final String BROADCAST_TEST_PANEL_CONTROL_TYPE_EXTRA_KEY = "sceneType";
private Context mContext;
@Override
public void onReceive(Context context, Intent intent) {
try {
this.mContext = context;
int sceneType = intent.getIntExtra(BROADCAST_TEST_PANEL_CONTROL_TYPE_EXTRA_KEY, 0);
Logger.d(TAG, "textPanelOpenType:" + sceneType);
// 分发场景
dispatchSceneTest(sceneType);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 分发处理场景
*
* @param sceneType 场景类型
*/
private void dispatchSceneTest(int sceneType) {
Logger.d(TAG, "sceneType=" + sceneType);
if(sceneType == 6){ //测试发送sn
AdasProvider adasProvider = ARouter.getInstance().navigation(AdasProvider.class);
adasProvider.setBasicInfo();
}
}
}

View File

@@ -1,16 +0,0 @@
package com.mogo.service.adas;
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage;
/**
* adas 数据回调接口
*
* @author tongchenfei
*/
public interface IMogoAdasWarnMessageCallback {
/**
* adas 数据回调
* @param msg 具体数据
*/
void onReceiveData( AutopilotWarnMessage msg );
}

View File

@@ -11,19 +11,15 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlCmdParameter;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.network.utils.GsonUtil;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.adas.AdasProvider;
import com.mogo.module.adas.IAdasDataListener;
import com.mogo.service.adas.IMogoADASController;
import com.mogo.service.adas.IMogoAdasCarDataCallback;
import com.mogo.service.adas.IMogoAdasDataCallback;
import com.mogo.service.adas.IMogoAdasOCHCallback;
import com.mogo.service.adas.IMogoAdasWarnMessageCallback;
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
import java.util.List;
@@ -35,17 +31,6 @@ public class MogoADASController implements IMogoADASController {
private static final String TAG = "MogoADASController";
private AdasProvider adasProvider;
/**
* 获取adas前车距离
*/
private final List<IMogoAdasDataCallback> mAdasDataCallbackList = new CopyOnWriteArrayList<>();
/**
* adas 报警数据回调
*/
private final List<IMogoAdasWarnMessageCallback> mMogoAdasWarnMessageCallbackList = new CopyOnWriteArrayList<>();
private IAdasDataListener mAdasDataListener;
private IMogoAdasCarDataCallback mMogoAdasCarDataCallback;
@@ -82,36 +67,6 @@ public class MogoADASController implements IMogoADASController {
init(AbsMogoApplication.getApp());
if (mAdasDataListener == null) {
mAdasDataListener = new IAdasDataListener() {
@Override
public void sendMsg(String msg) {
for (IMogoAdasDataCallback callback : mAdasDataCallbackList) {
try {
callback.onAdasDataCallback(msg);
} catch (Exception e) {
Logger.e(TAG, e, "sendMsg");
}
}
}
@Override
public void onWarnMessage(AutopilotWarnMessage autopilotWarnMessage) {
if (autopilotWarnMessage == null) {
return;
}
// 警告消息
Logger.d(TAG, "onWarnMessage = %s", autopilotWarnMessage.toString());
if (mMogoAdasWarnMessageCallbackList.isEmpty()) {
return;
}
UiThreadHandler.post(() -> {
for (IMogoAdasWarnMessageCallback callback : mMogoAdasWarnMessageCallbackList) {
if (callback != null) {
callback.onReceiveData(autopilotWarnMessage);
}
}
});
}
@Override
public void autopilotArrive(AutopilotStationInfo autopilotArriveModel) {
@@ -185,7 +140,6 @@ public class MogoADASController implements IMogoADASController {
@Override
public void release() {
adasProvider.removeAdasEventListener(mAdasDataListener);
adasProvider.removeAdasStatusListener();
AutopilotServiceManage.getInstance().release();
}