merge
This commit is contained in:
@@ -19,8 +19,10 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics;
|
||||
import com.zhidao.support.adas.high.bean.VersionCompatibility;
|
||||
import com.zhidao.support.adas.high.common.AutopilotAbilityManager;
|
||||
import com.zhidao.support.adas.high.common.AutopilotReview;
|
||||
import com.zhidao.support.adas.high.common.ByteUtil;
|
||||
import com.zhidao.support.adas.high.common.Constants;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
@@ -53,6 +55,8 @@ import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass;
|
||||
import common.HeaderOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import okio.ByteString;
|
||||
|
||||
@@ -76,6 +80,8 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
private DispatchHandler defaultDispatchHandler;//默认分发线程分发
|
||||
private final Map<MessagePad.MessageType, DispatchHandler> dispatchHandlers = new HashMap<>();//其他分发线程
|
||||
private Timer checkCompatibilityTimer;//检查版本兼容性定时器 连接成功后5秒内等待工控机发送配置信息
|
||||
private int seqSpecialVehicle = 0;//特种车辆命令发送次数
|
||||
|
||||
/**
|
||||
* 与工控机链接状态
|
||||
*/
|
||||
@@ -92,6 +98,10 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* 消息工厂
|
||||
*/
|
||||
private MyMessageFactory myMessageFactory;
|
||||
/**
|
||||
* 自动驾驶统计
|
||||
*/
|
||||
private AutopilotReview autopilotReview;
|
||||
/**
|
||||
* 工控机连接配置
|
||||
*/
|
||||
@@ -164,13 +174,26 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
//原始数据解析类
|
||||
rawUnpack = new RawUnpack();
|
||||
rawPack = new RawPack();
|
||||
autopilotReview = new AutopilotReview(onAutopilotReviewListener);
|
||||
//消息工厂
|
||||
myMessageFactory = new MyMessageFactory();
|
||||
myMessageFactory = new MyMessageFactory(autopilotReview);
|
||||
//启用线程分发
|
||||
defaultDispatchHandler = new DispatchHandler(MessagePad.MessageType.MsgTypeDefault, this);//默认分发线程 不要添加到Map中
|
||||
initOtherDispatchHandler();
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动自动驾驶状态统计回调
|
||||
*/
|
||||
private final AutopilotReview.OnAutopilotReviewListener onAutopilotReviewListener = new AutopilotReview.OnAutopilotReviewListener() {
|
||||
@Override
|
||||
public void onReview(AutopilotStatistics statistics) {
|
||||
if (mAdasListener != null) {
|
||||
mAdasListener.onAutopilotStatistics(statistics);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 初始化其他分发线程
|
||||
*/
|
||||
@@ -475,6 +498,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
ipcConnectedIp = ipAddress;
|
||||
ipcConnectedPort = port;
|
||||
subscribeInterface = new SubscribeInterface(this);
|
||||
seqSpecialVehicle = 0;
|
||||
updateConnectStatus(Constants.IPC_CONNECTION_STATUS.CONNECTED, "已连接");
|
||||
//根据连接配置 进行接口订阅或取消订阅配置
|
||||
if (adasOptions != null) {
|
||||
@@ -757,6 +781,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
if (routeInfo != null)
|
||||
builder.setRouteInfo(routeInfo);
|
||||
MessagePad.SetAutopilotModeReq req = builder.build();
|
||||
if (autopilotReview != null) autopilotReview.onAutopilotCommandTrigger(req);
|
||||
return sendPBMessage(MessageType.TYPE_SEND_SET_AUTOPILOT_MODE_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
@@ -1139,6 +1164,61 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
return subscribeInterface != null && subscribeInterface.subscribeInterface(role, type, messageType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 福田清扫车业务指令下发
|
||||
*
|
||||
* @param fuTianTaskCmd 命令
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboSweeperFuTianTaskCmd(SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd fuTianTaskCmd) {
|
||||
SpecialVehicleTaskCmdOuterClass.SpecialVehicleTaskCmd.Builder cmdBuild = SpecialVehicleTaskCmdOuterClass.SpecialVehicleTaskCmd
|
||||
.newBuilder()
|
||||
.setRoboSweeperFutianTaskCmd(fuTianTaskCmd);
|
||||
return sendSpecialVehicleTaskCmd(cmdBuild);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开沃小巴业务指令下发
|
||||
*
|
||||
* @param vanSkywellTaskCmd 命令
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboVanSkywellTaskCmd(SpecialVehicleTaskCmdOuterClass.RoboVanSkywellTaskCmd vanSkywellTaskCmd) {
|
||||
SpecialVehicleTaskCmdOuterClass.SpecialVehicleTaskCmd.Builder cmdBuild = SpecialVehicleTaskCmdOuterClass.SpecialVehicleTaskCmd
|
||||
.newBuilder()
|
||||
.setRoboVanSkywellTaskCmd(vanSkywellTaskCmd);
|
||||
return sendSpecialVehicleTaskCmd(cmdBuild);
|
||||
}
|
||||
|
||||
/**
|
||||
* 特种车辆命令下发
|
||||
*
|
||||
* @param cmdBuild 命令
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendSpecialVehicleTaskCmd(SpecialVehicleTaskCmdOuterClass.SpecialVehicleTaskCmd.Builder cmdBuild) {
|
||||
long t = System.currentTimeMillis();
|
||||
int sec = (int) (t / 1000);
|
||||
int nsec = (int) (t % 1000 * 1000000);
|
||||
HeaderOuterClass.Time time = HeaderOuterClass.Time
|
||||
.newBuilder()
|
||||
.setSec(sec)
|
||||
.setNsec(nsec)
|
||||
.build();
|
||||
HeaderOuterClass.Header header = HeaderOuterClass.Header.newBuilder()
|
||||
.setSeq(++seqSpecialVehicle)
|
||||
.setStamp(time)
|
||||
.setFrameId("special_vehicle_task_cmd")
|
||||
.setModuleName("EagleEye")
|
||||
.build();
|
||||
cmdBuild.setHeader(header);
|
||||
return sendPBMessage(MessageType.TYPE_SEND_SPECIAL_VEHICLE_TASK_CMD.typeCode, cmdBuild.build().toByteArray());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 向左变道
|
||||
*
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
@@ -589,6 +590,40 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.subscribeInterface(role, type, messageType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 福田清扫车业务指令下发
|
||||
*
|
||||
* @param fuTianTaskCmd 命令
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboSweeperFuTianTaskCmd(SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd fuTianTaskCmd) {
|
||||
return mChannel != null && mChannel.sendRoboSweeperFuTianTaskCmd(fuTianTaskCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开沃小巴业务指令下发
|
||||
*
|
||||
* @param vanSkywellTaskCmd 命令
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRoboVanSkywellTaskCmd(SpecialVehicleTaskCmdOuterClass.RoboVanSkywellTaskCmd vanSkywellTaskCmd) {
|
||||
return mChannel != null && mChannel.sendRoboVanSkywellTaskCmd(vanSkywellTaskCmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 特种车辆命令下发
|
||||
*
|
||||
* @param cmdBuild 命令
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendSpecialVehicleTaskCmd(SpecialVehicleTaskCmdOuterClass.SpecialVehicleTaskCmd.Builder cmdBuild) {
|
||||
return mChannel != null && mChannel.sendSpecialVehicleTaskCmd(cmdBuild);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean sendOperatorCmdChangeLaneLeft() {
|
||||
return mChannel != null && mChannel.sendOperatorCmdChangeLaneLeft();
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.zhidao.support.adas.high.common.MessageType;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
@@ -310,6 +311,30 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
boolean subscribeInterface(@Define.TerminalRole int role, @Define.SubscribeType int type, @NonNull MessageType messageType);
|
||||
|
||||
/**
|
||||
* 福田清扫车业务指令下发
|
||||
*
|
||||
* @param fuTianTaskCmd 命令
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRoboSweeperFuTianTaskCmd(SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd fuTianTaskCmd);
|
||||
|
||||
/**
|
||||
* 开沃小巴业务指令下发
|
||||
*
|
||||
* @param vanSkywellTaskCmd 命令
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRoboVanSkywellTaskCmd(SpecialVehicleTaskCmdOuterClass.RoboVanSkywellTaskCmd vanSkywellTaskCmd);
|
||||
|
||||
/**
|
||||
* 特种车辆命令下发
|
||||
*
|
||||
* @param cmdBuild 命令
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendSpecialVehicleTaskCmd(SpecialVehicleTaskCmdOuterClass.SpecialVehicleTaskCmd.Builder cmdBuild);
|
||||
|
||||
|
||||
/**
|
||||
* 向左变道
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zhidao.support.adas.high;
|
||||
|
||||
import com.zhidao.support.adas.high.bean.AutopilotAbility;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics;
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus;
|
||||
|
||||
import chassis.VehicleStateOuterClass;
|
||||
@@ -179,13 +180,6 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onPlanningActionMsg(MessagePad.Header header, MessagePad.PlanningActionMsg planningActionMsg);
|
||||
|
||||
/**
|
||||
* 数据错误
|
||||
*
|
||||
* @param status 错误原因
|
||||
* @param bytes 原始数据
|
||||
*/
|
||||
void onError(ProtocolStatus status, byte[] bytes);
|
||||
|
||||
/**
|
||||
* 是否有能力启动自动驾驶
|
||||
@@ -193,4 +187,31 @@ public interface OnAdasListener {
|
||||
* @param ability 是否可以启动自动驾驶
|
||||
*/
|
||||
void onAutopilotAbility(AutopilotAbility ability);
|
||||
|
||||
/**
|
||||
* 启动自动驾驶失败回调
|
||||
* 根据MAP 系统监控状态返回过滤
|
||||
* message.getMsg() 获取详细错误说明
|
||||
* message.getCode() 可用于判断属于什么类型
|
||||
*
|
||||
* @param message 数据
|
||||
*/
|
||||
void onStartAutopilotFailed(MogoReportMsg.MogoReportMessage message);
|
||||
|
||||
/**
|
||||
* 启动自动驾驶状态统计
|
||||
* 触发机制:下发启动自动驾驶命令,根据MAP返回状态判断成功或失败
|
||||
* 统计四种状态:成功 失败 取消 超时
|
||||
*
|
||||
* @param statistics 统计数据
|
||||
*/
|
||||
void onAutopilotStatistics(AutopilotStatistics statistics);
|
||||
|
||||
/**
|
||||
* 数据错误
|
||||
*
|
||||
* @param status 错误原因
|
||||
* @param bytes 原始数据
|
||||
*/
|
||||
void onError(ProtocolStatus status, byte[] bytes);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.zhidao.support.adas.high.bean;
|
||||
|
||||
import com.zhidao.support.adas.high.common.Define;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
|
||||
/**
|
||||
* 自动驾驶启动统计
|
||||
*/
|
||||
public class AutopilotStatistics {
|
||||
|
||||
/**
|
||||
* 启动自动驾驶后状态
|
||||
* 0 成功
|
||||
* 1 失败
|
||||
* 2 取消
|
||||
* 3 超时
|
||||
* {@link com.zhidao.support.adas.high.common.Constants.AUTOPILOT_START_STATUS}
|
||||
*/
|
||||
@Define.AutopilotStartStatus
|
||||
public final int status;
|
||||
|
||||
/**
|
||||
* 用时
|
||||
* 单位:ms
|
||||
*/
|
||||
public final long usedTime;
|
||||
|
||||
/**
|
||||
* 下发的启动自动驾驶命令
|
||||
*/
|
||||
public final MessagePad.SetAutopilotModeReq req;
|
||||
|
||||
/**
|
||||
* 失败的消息
|
||||
*/
|
||||
public final MogoReportMsg.MogoReportMessage failedMessage;
|
||||
|
||||
public AutopilotStatistics(@Define.AutopilotStartStatus int status, long usedTime, MessagePad.SetAutopilotModeReq req, MogoReportMsg.MogoReportMessage failedMessage) {
|
||||
this.status = status;
|
||||
this.usedTime = usedTime;
|
||||
this.req = req;
|
||||
this.failedMessage = failedMessage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.zhidao.support.adas.high.common;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
|
||||
/**
|
||||
* 自动驾驶状态检查/统计
|
||||
*/
|
||||
public class AutopilotReview {
|
||||
/**
|
||||
* 默认启动自驾超时时间
|
||||
*/
|
||||
private static final long DEFAULT_TIMEOUT = 15 * 1000L;
|
||||
|
||||
|
||||
private Timer timer;
|
||||
/**
|
||||
* 下发的启动自动驾驶命令
|
||||
*/
|
||||
public MessagePad.SetAutopilotModeReq startReq;
|
||||
private long startTime;//自动驾驶命令下发启动时间
|
||||
|
||||
/**
|
||||
* 失败的消息
|
||||
*/
|
||||
public MogoReportMsg.MogoReportMessage failedMessage;
|
||||
|
||||
private final OnAutopilotReviewListener listener;
|
||||
|
||||
public AutopilotReview(@NonNull OnAutopilotReviewListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public interface OnAutopilotReviewListener {
|
||||
void onReview(AutopilotStatistics statistics);
|
||||
}
|
||||
|
||||
private void onCallback(@Define.AutopilotStartStatus int status) {
|
||||
stopTimer();
|
||||
long usedTime = SystemClock.elapsedRealtime() - startTime;
|
||||
if (listener != null) {
|
||||
listener.onReview(new AutopilotStatistics(status, usedTime, startReq, failedMessage));
|
||||
}
|
||||
startTime = 0;
|
||||
startReq = null;
|
||||
failedMessage = null;
|
||||
}
|
||||
|
||||
|
||||
private void startTimer() {
|
||||
if (timer == null) {
|
||||
timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
//超时
|
||||
onCallback(Constants.AUTOPILOT_START_STATUS.TIMEOUT);
|
||||
}
|
||||
}, DEFAULT_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
private void stopTimer() {
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾命令
|
||||
*
|
||||
* @param req 启动或停止
|
||||
*/
|
||||
public void onAutopilotCommandTrigger(MessagePad.SetAutopilotModeReq req) {
|
||||
if (req.getMode() == 1) {
|
||||
//启动自动驾驶
|
||||
startReq = req;
|
||||
startTime = SystemClock.elapsedRealtime();
|
||||
startTimer();
|
||||
} else {
|
||||
onCallback(Constants.AUTOPILOT_START_STATUS.CANCEL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 监控报告状态 目前只用于自动驾驶失败结果
|
||||
*
|
||||
* @param message
|
||||
*/
|
||||
public void onReportResult(MogoReportMsg.MogoReportMessage message) {
|
||||
if (startReq != null && message != null) {
|
||||
failedMessage = message;
|
||||
onCallback(Constants.AUTOPILOT_START_STATUS.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶状态 目前只用于自动驾驶成功结果
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
public void onAutopilotResult(MessagePad.AutopilotState state) {
|
||||
if (startReq != null && state != null && state.getState() == 2) {
|
||||
onCallback(Constants.AUTOPILOT_START_STATUS.SUCCESSFUL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,4 +110,26 @@ public class Constants {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动自动驾驶后的状态
|
||||
*/
|
||||
public interface AUTOPILOT_START_STATUS {
|
||||
/**
|
||||
* 成功
|
||||
*/
|
||||
int SUCCESSFUL = 0;
|
||||
/**
|
||||
* 失败
|
||||
*/
|
||||
int FAILED = 1;
|
||||
/**
|
||||
* 取消
|
||||
*/
|
||||
int CANCEL = 2;
|
||||
/**
|
||||
* 超时
|
||||
*/
|
||||
int TIMEOUT = 3;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -46,4 +46,12 @@ public final class Define {
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface SubscribeType {
|
||||
}
|
||||
|
||||
@IntDef(flag = true, value = {Constants.AUTOPILOT_START_STATUS.SUCCESSFUL,
|
||||
Constants.AUTOPILOT_START_STATUS.FAILED,
|
||||
Constants.AUTOPILOT_START_STATUS.CANCEL,
|
||||
Constants.AUTOPILOT_START_STATUS.TIMEOUT})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface AutopilotStartStatus {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ public enum MessageType {
|
||||
TYPE_SEND_SUBSCRIBE_DATA_REQ(MessagePad.MessageType.MsgTypeSubscribeDataReq, "数据订阅、取消订阅请求"),
|
||||
TYPE_SEND_SET_PARAM_REQ(MessagePad.MessageType.MsgTypeSetParamReq, "设置参数命令"),
|
||||
TYPE_SEND_TRIP_INFO_REQ(MessagePad.MessageType.MsgTypeTripInfoEvent, "行程信息"),
|
||||
TYPE_SEND_SPECIAL_VEHICLE_TASK_CMD(MessagePad.MessageType.MsgTypeSpecialVehicleTaskCmd, "特种车辆命令"),
|
||||
//透传 原始pb文件中不存在以下type。由于Java中无法强转所以在mogo-adas-data message_pad.proto中放开注释
|
||||
TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态");
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ package com.zhidao.support.adas.high.common;
|
||||
* 根据290消息定义编写
|
||||
*/
|
||||
public class MogoReport {
|
||||
private static final String RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED";
|
||||
private static final String RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE";
|
||||
private static final String RESULT_AUTOPILOT_INFERIOR = "RESULT_AUTOPILOT_INFERIOR";
|
||||
private static final String RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE";
|
||||
private static final String RESULT_REMOTEPILOT_INFERIOR = "RESULT_REMOTEPILOT_INFERIOR";
|
||||
private 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";
|
||||
|
||||
// private static final String RESULT_DISCONNECTED_WITH_PAD = "RESULT_DISCONNECTED_WITH_PAD";
|
||||
// private static final String RESULT_PAD_CANNOT_CONNECT_TELEMATICS = "RESULT_PAD_CANNOT_CONNECT_TELEMATICS";
|
||||
@@ -96,14 +96,14 @@ public class MogoReport {
|
||||
|
||||
}
|
||||
|
||||
private static final String ACTION_CONTACT_TECH_SUPPORT = "ACTION_CONTACT_TECH_SUPPORT";
|
||||
private static final String ACTION_CONTACT_MAINTENANCE = "ACTION_CONTACT_MAINTENANCE";
|
||||
private static final String ACTION_CONTACT_HARDWARE_ENGINEER = "ACTION_CONTACT_HARDWARE_ENGINEER";
|
||||
private static final String ACTION_REBOOT_PAD = "ACTION_REBOOT_PAD";
|
||||
private static final String ACTION_REBOOT_VEHICLE = "ACTION_REBOOT_VEHICLE";
|
||||
private static final String ACTION_CHECK_GEAR = "ACTION_CHECK_GEAR";
|
||||
private static final String ACTION_CHECK_NETWORK = "ACTION_CHECK_NETWORK";
|
||||
private static final String ACTION_TRY_AGAIN_LATER = "ACTION_TRY_AGAIN_LATER";
|
||||
public static final String ACTION_CONTACT_TECH_SUPPORT = "ACTION_CONTACT_TECH_SUPPORT";
|
||||
public static final String ACTION_CONTACT_MAINTENANCE = "ACTION_CONTACT_MAINTENANCE";
|
||||
public static final String ACTION_CONTACT_HARDWARE_ENGINEER = "ACTION_CONTACT_HARDWARE_ENGINEER";
|
||||
public static final String ACTION_REBOOT_PAD = "ACTION_REBOOT_PAD";
|
||||
public static final String ACTION_REBOOT_VEHICLE = "ACTION_REBOOT_VEHICLE";
|
||||
public static final String ACTION_CHECK_GEAR = "ACTION_CHECK_GEAR";
|
||||
public static final String ACTION_CHECK_NETWORK = "ACTION_CHECK_NETWORK";
|
||||
public static final String ACTION_TRY_AGAIN_LATER = "ACTION_TRY_AGAIN_LATER";
|
||||
|
||||
public enum Action {
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.AutopilotReview;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
@@ -14,6 +15,11 @@ import mogo.telematics.pad.MessagePad;
|
||||
* 自动驾驶状态
|
||||
*/
|
||||
public class AutopilotStateMessage extends MyAbstractMessageHandler {
|
||||
private final AutopilotReview autopilotReview;
|
||||
|
||||
public AutopilotStateMessage(AutopilotReview autopilotReview) {
|
||||
this.autopilotReview = autopilotReview;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
@@ -25,6 +31,9 @@ public class AutopilotStateMessage extends MyAbstractMessageHandler {
|
||||
if (adasListener != null) {
|
||||
adasListener.onAutopilotState(raw.getHeader(), autopilotState);
|
||||
}
|
||||
if (autopilotReview != null) {
|
||||
autopilotReview.onAutopilotResult(autopilotState);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("自动驾驶状态", nowTime);
|
||||
// CupidLogUtils.e("自动驾驶状态--->" + autopilotState.toString());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import com.zhidao.support.adas.high.common.AutopilotReview;
|
||||
import com.zhidao.support.adas.high.common.MessageType;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
@@ -31,6 +32,11 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg recordDataConfigRespMessage;//数据采集配置应答
|
||||
private IMsg planningDecisionStateMessage;//planning决策状态
|
||||
|
||||
private final AutopilotReview autopilotReview;
|
||||
|
||||
public MyMessageFactory(AutopilotReview autopilotReview) {
|
||||
this.autopilotReview = autopilotReview;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMsg createMessage(MessagePad.MessageType messageType) {
|
||||
@@ -61,13 +67,13 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_AUTOPILOT_STATE.typeCode) {
|
||||
//自动驾驶状态
|
||||
if (autopilotStateMessage == null) {
|
||||
autopilotStateMessage = new AutopilotStateMessage();
|
||||
autopilotStateMessage = new AutopilotStateMessage(autopilotReview);
|
||||
}
|
||||
return autopilotStateMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_REPORT_MESSAGE.typeCode) {
|
||||
//监控事件报告
|
||||
if (reportMessage == null) {
|
||||
reportMessage = new ReportMessage();
|
||||
reportMessage = new ReportMessage(autopilotReview);
|
||||
}
|
||||
return reportMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_PERCEPTION_TRAFFIC_LIGHT.typeCode) {
|
||||
|
||||
@@ -5,15 +5,24 @@ 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.AutopilotReview;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.common.MogoReport;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mogo_msg.MogoReportMsg;
|
||||
|
||||
/**
|
||||
* 监控事件报告
|
||||
* 监控事件报告回调
|
||||
*/
|
||||
public class ReportMessage extends MyAbstractMessageHandler {
|
||||
private final AutopilotReview autopilotReview;
|
||||
|
||||
public ReportMessage(AutopilotReview autopilotReview) {
|
||||
this.autopilotReview = autopilotReview;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
@@ -23,8 +32,18 @@ public class ReportMessage extends MyAbstractMessageHandler {
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
adasListener.onReportMessage(raw.getHeader(), mogoReportMessage);
|
||||
adasListener.onReportMessage(raw.getHeader(), mogoReportMessage);//监控报告回调
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("监控事件报告", nowTime);
|
||||
//分发自动驾驶启动失败相关回调
|
||||
List<String> results = mogoReportMessage.getResultList();
|
||||
if (!results.isEmpty() && results.contains(MogoReport.RESULT_AUTOPILOT_DISABLE)) {
|
||||
if (adasListener != null) {
|
||||
adasListener.onStartAutopilotFailed(mogoReportMessage);//启动自动驾驶失败回调
|
||||
}
|
||||
if (autopilotReview != null) {
|
||||
autopilotReview.onReportResult(mogoReportMessage);//统计启动自动驾驶失败原因
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.map.search.traffic.IMogoTrafficSearch;
|
||||
import com.mogo.map.uicontroller.AMapUIController;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.zhidaoauto.map.sdk.open.HDTypes;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.MapParams;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
@@ -60,6 +61,20 @@ public class CustomMapApiBuilder implements IMogoMapApiBuilder {
|
||||
//.setDataFileSource(1)
|
||||
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
|
||||
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_3D)
|
||||
.setHDVisibileArray(new int[]{HDTypes.DIVIDER.type,
|
||||
HDTypes.ROAD_AREA.type,
|
||||
HDTypes.STOP_LINE.type,
|
||||
HDTypes.ARROW.type,
|
||||
HDTypes.STATION_BRIDGE.type,
|
||||
HDTypes.ZEBRA_LINE.type,
|
||||
HDTypes.GREEN_BELT.type,
|
||||
HDTypes.DIVERSION.type,
|
||||
HDTypes.SAFE_ISLAND.type,
|
||||
HDTypes.ALPHANUMERIC.type,
|
||||
HDTypes.GUARDBAR.type,
|
||||
HDTypes.TRAFFIC_DEVICE.type,
|
||||
HDTypes.CABLE.type,
|
||||
HDTypes.SIGNAL_LINE.type})
|
||||
// .setZoom( 20 )
|
||||
// .setPointToCenter( 0.734375f, 0.5f )
|
||||
//todo 2D模式下需要注意ADAS部分遮挡
|
||||
|
||||
Reference in New Issue
Block a user