Merge branch 'master' into dev_robouiadapter_1062_221117_1.6.2

# Conflicts:
#	OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_route_fragment.xml
#	OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/video/VideoActivity.kt
#	OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_passenger_check_panel.xml
#	OCH/mogo-och-taxi/src/main/res/layout/taxi_being_order.xml
#	OCH/mogo-och-taxi/src/main/res/layout/taxi_navi_view.xml
#	app/src/main/java/com/mogo/launcher/MogoApplication.java
#	core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt
#	core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml
#	core/function-impl/mogo-core-function-hmi/src/main/res/values-xhdpi-2560x1440/color.xml
#	gradle.properties
This commit is contained in:
yangyakun
2022-11-18 10:36:15 +08:00
527 changed files with 18862 additions and 3434 deletions

View File

@@ -23,6 +23,7 @@ enum PilotMode {
MODE_AUTO_DRIVE = 1;
MODE_STEER_ONLY = 2;
MODE_SPEED_ONLY = 3;
MODE_REMOTE_DRIVE = 6;
}
enum LongitudeDrivingMode {

View File

@@ -4,7 +4,7 @@ package mogo.telematics.pad;
enum ProtocolVersion
{
Defaultver = 0;
CurrentVersion = 7; //每次修改proto文件增加1
CurrentVersion = 8; //每次修改proto文件增加1
}
enum MessageType
@@ -50,6 +50,8 @@ enum MessageType
MsgTypeOperatorCmdReq = 0x10116; //操控指令
MsgTypeSubscribeDataReq = 0x10117; //数据订阅、取消订阅请求
MsgTypeSpecialVehicleTaskCmd = 0x10118; //特种车辆命令
MsgTypeSetParamReq = 0x10119; //设置参数命令
MsgTypeTripInfoEvent = 0x1011a; //行程信息
}
message Header
@@ -141,11 +143,11 @@ message GnssInfo
// message definition for MessageType: MsgTypeAutopilotState
message AutopilotState
{
uint32 state = 1; //0: 不可用(abandoned), 1:ready, 2:自动驾驶中,3:平行驾驶
uint32 state = 1; //0: 不可用(abandoned), 1:ready, 2:自动驾驶中, 7:平行驾驶
uint32 camera = 2; //camera节点状态 1:开启0:关闭
uint32 radar = 3; //雷达节点状态 1:开启0:关闭
uint32 rtk = 4; //RTK节点状态 1:开启0:关闭
uint32 autopilotMode = 5; //自动驾驶状态 0: 非自动驾驶1: 自动驾驶2平行驾驶
uint32 autopilotMode = 5; //自动驾驶状态 0: 非自动驾驶1: 自动驾驶
double speed = 6; //惯导车速 m/s
string reason = 7; //不可用原因(abandoned)
}
@@ -286,6 +288,7 @@ message RecordData
bool isRecord = 4; //采集指令, true: 采集, false: 停止采集
bool sustain = 5; //是否持续采集
uint32 bduration = 6; //前溯时长
repeated string topics = 7; //topic列表
}
// message definition for MsgTypeRecordResult
@@ -385,7 +388,9 @@ message SetRainModeReq
// message definition for MsgTypeRecordDataConfigReq
message RecordDataConfigReq
{
uint32 reqType = 1; // 0: all, 其他保留
uint32 reqType = 1; // 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
uint32 recordType = 2; // 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
repeated string topicsNeedToCache = 3;
}
// message definition for MsgTypeRecordDataConfigResp
@@ -393,11 +398,13 @@ message RecordDataType
{
uint32 id = 1; //采集类型id
string desc = 2; //采集类型描述
repeated string topics = 3; //采集类型必须采集的topic列表
}
message RecordDataConfig
{
repeated RecordDataType recordTypes = 1;
repeated string allTopics = 2; //当前所有topic列表
}
// message definition for MsgTypeSubscribeDataReq
@@ -466,3 +473,27 @@ message PlanningActionMsg
//message definition for MsgTypeSpecialVehicleTaskCmd
//refer to special_vehicle_task_cmd.proto for details
//message definition for MsgTypeSetParamReq
message SetOneParam
{
uint32 type = 1; // 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
string value = 2; // 转成字符串的值
}
message SetParamReq
{
repeated SetOneParam reqs = 1;
}
//message definition for MsgTypeTripInfoEvent
message TripInfoEvent
{
uint32 type = 1; //事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
string lineName = 2; //路线名
string departureStopName = 3; //出站站点名
string arrivalStopName = 4; //下一站到达站点名
bool isLastStop = 5; //下一站到达站是否最终站
}

View File

@@ -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;
@@ -46,12 +48,15 @@ import com.zhjt.service.chain.TracingConstants;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
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;
@@ -75,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;//特种车辆命令发送次数
/**
* 与工控机链接状态
*/
@@ -91,6 +98,10 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
* 消息工厂
*/
private MyMessageFactory myMessageFactory;
/**
* 自动驾驶统计
*/
private AutopilotReview autopilotReview;
/**
* 工控机连接配置
*/
@@ -163,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);
}
}
};
/**
* 初始化其他分发线程
*/
@@ -362,6 +386,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
CupidLogUtils.i("TimeConsuming", who + " 从接收到解析耗时=" + time + "毫秒");
}
}
//TODO 计算耗时 临时测试
public static void calculateTimeConsumingBusiness(String who, long receiveTime) {
if (CupidLogUtils.isEnableLog()) {
@@ -369,6 +394,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
CupidLogUtils.i("TimeConsuming", who + " 业务处理耗时=" + time + "毫秒");
}
}
/**
* 分发和解析
*
@@ -472,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) {
@@ -754,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());
}
@@ -817,25 +845,39 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
@Override
public boolean startRecordPackage(int id, int type) {
return sendRecordData(id, 0, type, true, -1);
return sendRecordData(id, 0, type, true, -1, null);
}
@Override
public boolean startRecordPackage(int id, int duration, int type) {
return sendRecordData(id, duration, type, true, -1);
return sendRecordData(id, duration, type, true, -1, null);
}
@Override
public boolean startRecordPackage(int id, int duration, int type, int bduration) {
return sendRecordData(id, duration, type, true, bduration);
return sendRecordData(id, duration, type, true, bduration, null);
}
@Override
public boolean startRecordPackage(int id, int type, List<String> topics) {
return sendRecordData(id, 0, type, true, -1, topics);
}
@Override
public boolean startRecordPackage(int id, int duration, int type, List<String> topics) {
return sendRecordData(id, duration, type, true, -1, topics);
}
@Override
public boolean startRecordPackage(int id, int duration, int type, int bduration, List<String> topics) {
return sendRecordData(id, duration, type, true, bduration, topics);
}
@Override
public boolean stopRecordPackage(int id, int type) {
return sendRecordData(id, 0, type, false, -1);
return sendRecordData(id, 0, type, false, -1, null);
}
/**
* 数据采集请求 主动录制Bag包
* sustain为true时 duration无效
@@ -846,10 +888,11 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
* @param isRecord 采集指令, true: 采集, false: 停止采集
* @param bduration 前溯时长
* @param sustain 是否持续采集
* @param topics 要录制的Topic列表
* @return boolean
*/
@Override
public boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration) {
public boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration, List<String> topics) {
boolean sustain = false;
if (isRecord) {
if (duration <= 0) {
@@ -867,6 +910,9 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
if (bduration > -1) {
builder.setBduration(bduration);
}
if (topics != null && !topics.isEmpty()) {
builder.addAllTopics(topics);
}
MessagePad.RecordData req = builder.build();
return sendPBMessage(MessageType.TYPE_SEND_RECORD_DATA.typeCode, req.toByteArray());
}
@@ -1031,14 +1077,20 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
/**
* 数据采集配置查询
*
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
* @param topicsNeedToCache
* @return boolean
*/
@Override
public boolean sendRecordDataConfigReq() {
MessagePad.RecordDataConfigReq req = MessagePad.RecordDataConfigReq
public boolean sendRecordDataConfigReq(int reqType, int recordType, List<String> topicsNeedToCache) {
MessagePad.RecordDataConfigReq.Builder builder = MessagePad.RecordDataConfigReq
.newBuilder()
.setReqType(0)
.build();
.setReqType(reqType)
.setRecordType(recordType);
if (topicsNeedToCache != null && !topicsNeedToCache.isEmpty())
builder.addAllTopicsNeedToCache(topicsNeedToCache);
MessagePad.RecordDataConfigReq req = builder.build();
return sendPBMessage(MessageType.TYPE_SEND_RECORD_DATA_CONFIG_REQ.typeCode, req.toByteArray());
}
@@ -1112,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());
}
/**
* 向左变道
*
@@ -1194,5 +1301,79 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
public boolean sendOperatorCmdStopHonking() {
return sendOperatorCmdSetHorn(2);
}
/**
* 设置参数命令
*
* @param type 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
* @param value 转成字符串的值
* @return boolean
*/
@Override
public boolean sendSetParamReq(int type, String value) {
MessagePad.SetOneParam oneParam = MessagePad.SetOneParam
.newBuilder().setType(type).setValue(value).build();
MessagePad.SetParamReq req = MessagePad.SetParamReq
.newBuilder()
.addReqs(oneParam)
.build();
return sendPBMessage(MessageType.TYPE_SEND_SET_PARAM_REQ.typeCode, req.toByteArray());
}
/**
* 绕障类功能开关
*
* @param enable 0关闭1开启
* @return boolean
*/
@Override
public boolean sendDetouring(int enable) {
return sendSetParamReq(1, String.valueOf(enable));
}
/**
* 变道绕障的目标障碍物速度阈值
*
* @param speed 速度阈值 m/s
* @return boolean
*/
@Override
public boolean sendDetouringSpeed(double speed) {
return sendSetParamReq(2, String.valueOf(speed));
}
/**
* 发生行程相关
* type=1或2的时 需要参数 lineName
* type=3或4的时 需要参数 lineName departureStopName arrivalStopName isLastStop
* type=5时 不需要任何参数
*
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
* @param lineName 路线名
* @param departureStopName 出站站点名
* @param arrivalStopName 下一站到达站点名
* @param isLastStop 是否最终站
* @return boolean
*/
@Override
public boolean sendTripInfoReq(int type, String lineName, String departureStopName, String arrivalStopName, boolean isLastStop) {
MessagePad.TripInfoEvent.Builder builder = MessagePad.TripInfoEvent
.newBuilder()
.setType(type);
if (type < 5) {
if (lineName != null)
builder.setLineName(lineName);
if (type == 3 || type == 4) {
if (departureStopName != null)
builder.setDepartureStopName(departureStopName);
if (arrivalStopName != null)
builder.setArrivalStopName(arrivalStopName);
builder.setIsLastStop(isLastStop);
}
}
MessagePad.TripInfoEvent req = builder.build();
return sendPBMessage(MessageType.TYPE_SEND_TRIP_INFO_REQ.typeCode, req.toByteArray());
}
}

View File

@@ -12,8 +12,10 @@ import com.zhidao.support.adas.high.common.MessageType;
import com.zhidao.support.adas.high.common.ReceiveTimeoutManager;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import chassis.SpecialVehicleTaskCmdOuterClass;
import mogo.telematics.pad.MessagePad;
/**
@@ -332,6 +334,7 @@ public class AdasManager implements IAdasNetCommApi {
* 同下
*
* @param id
* @param duration
* @param type
* @return
*/
@@ -344,7 +347,9 @@ public class AdasManager implements IAdasNetCommApi {
* 同下
*
* @param id
* @param duration
* @param type
* @param bduration
* @return
*/
@Override
@@ -352,6 +357,48 @@ public class AdasManager implements IAdasNetCommApi {
return mChannel != null && mChannel.startRecordPackage(id, duration, type, bduration);
}
/**
* 同下
*
* @param id
* @param type
* @param topics
* @return
*/
@Override
public boolean startRecordPackage(int id, int type, List<String> topics) {
return mChannel != null && mChannel.startRecordPackage(id, type, topics);
}
/**
* 同下
*
* @param id
* @param duration
* @param type
* @param topics
* @return
*/
@Override
public boolean startRecordPackage(int id, int duration, int type, List<String> topics) {
return mChannel != null && mChannel.startRecordPackage(id, duration, type, topics);
}
/**
* 同下
*
* @param id
* @param duration
* @param type
* @param bduration
* @param topics
* @return
*/
@Override
public boolean startRecordPackage(int id, int duration, int type, int bduration, List<String> topics) {
return mChannel != null && mChannel.startRecordPackage(id, duration, type, bduration, topics);
}
/**
* 同下
*
@@ -375,8 +422,8 @@ public class AdasManager implements IAdasNetCommApi {
* @return boolean
*/
@Override
public boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration) {
return mChannel != null && mChannel.sendRecordData(id, duration, type, isRecord, bduration);
public boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration, List<String> topics) {
return mChannel != null && mChannel.sendRecordData(id, duration, type, isRecord, bduration, topics);
}
/**
@@ -469,11 +516,14 @@ public class AdasManager implements IAdasNetCommApi {
/**
* 数据采集配置查询
*
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
* @param topicsNeedToCache
* @return boolean
*/
@Override
public boolean sendRecordDataConfigReq() {
return mChannel != null && mChannel.sendRecordDataConfigReq();
public boolean sendRecordDataConfigReq(int reqType, int recordType, List<String> topicsNeedToCache) {
return mChannel != null && mChannel.sendRecordDataConfigReq(reqType, recordType, topicsNeedToCache);
}
/**
@@ -540,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();
@@ -570,6 +654,57 @@ public class AdasManager implements IAdasNetCommApi {
return mChannel != null && mChannel.sendOperatorCmdStopHonking();
}
/**
* 设置参数命令
*
* @param type 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
* @param value 转成字符串的值
* @return boolean
*/
@Override
public boolean sendSetParamReq(int type, String value) {
return mChannel != null && mChannel.sendSetParamReq(type, value);
}
/**
* 绕障类功能开关
*
* @param enable 0关闭1开启
* @return boolean
*/
@Override
public boolean sendDetouring(int enable) {
return mChannel != null && mChannel.sendDetouring(enable);
}
/**
* 变道绕障的目标障碍物速度阈值
*
* @param speed 速度阈值 m/s
* @return boolean
*/
@Override
public boolean sendDetouringSpeed(double speed) {
return mChannel != null && mChannel.sendDetouringSpeed(speed);
}
/**
* 发生行程相关
* type=1或2的时 需要参数 lineName
* type=3或4的时 需要参数 lineName departureStopName arrivalStopName isLastStop
* type=5时 不需要任何参数
*
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
* @param lineName 路线名
* @param departureStopName 出站站点名
* @param arrivalStopName 下一站到达站点名
* @param isLastStop 是否最终站
* @return boolean
*/
@Override
public boolean sendTripInfoReq(int type, String lineName, String departureStopName, String arrivalStopName, boolean isLastStop) {
return mChannel != null && mChannel.sendTripInfoReq(type, lineName, departureStopName, arrivalStopName, isLastStop);
}
/**
* 获取工控机固定IP列表

View File

@@ -7,8 +7,10 @@ import com.zhidao.support.adas.high.common.Constants;
import com.zhidao.support.adas.high.common.Define;
import com.zhidao.support.adas.high.common.MessageType;
import java.util.List;
import java.util.Set;
import chassis.SpecialVehicleTaskCmdOuterClass;
import mogo.telematics.pad.MessagePad;
/**
@@ -132,6 +134,38 @@ public interface IAdasNetCommApi {
*/
boolean startRecordPackage(int id, int duration, int type, int bduration);
/**
* 同下
*
* @param id
* @param type
* @param topics
* @return 加入WS发送消息队列是否成功
*/
boolean startRecordPackage(int id, int type, List<String> topics);
/**
* 同下
*
* @param id
* @param type
* @param topics
* @return 加入WS发送消息队列是否成功
*/
boolean startRecordPackage(int id, int duration, int type, List<String> topics);
/**
* 同下
*
* @param id
* @param duration
* @param type
* @param bduration
* @param topics
* @return 加入WS发送消息队列是否成功
*/
boolean startRecordPackage(int id, int duration, int type, int bduration, List<String> topics);
/**
* 同下
*
@@ -151,7 +185,7 @@ public interface IAdasNetCommApi {
* @param bduration 前溯时长
* @return 加入WS发送消息队列是否成功
*/
boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration);
boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration, List<String> topics);
/**
* 设置自动驾驶最大速度
@@ -223,11 +257,13 @@ public interface IAdasNetCommApi {
/**
* 数据采集配置查询
* 0: all, 其他保留
*
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
* @param topicsNeedToCache
* @return 加入WS发送消息队列是否成功
*/
boolean sendRecordDataConfigReq();
boolean sendRecordDataConfigReq(int reqType, int recordType, List<String> topicsNeedToCache);
/**
* 获取已注册接口
@@ -275,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);
/**
* 向左变道
@@ -319,6 +379,48 @@ public interface IAdasNetCommApi {
* @return boolean
*/
boolean sendOperatorCmdStopHonking();
/**
* 设置参数命令
*
* @param type 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
* @param value 转成字符串的值
* @return boolean
*/
boolean sendSetParamReq(int type, String value);
/**
* 绕障类功能开关
*
* @param enable 0关闭1开启
* @return boolean
*/
boolean sendDetouring(int enable);
/**
* 变道绕障的目标障碍物速度阈值
*
* @param speed 速度阈值 m/s
* @return boolean
*/
boolean sendDetouringSpeed(double speed);
/**
* 发生行程相关
* type=1或2的时 需要参数 lineName
* type=3或4的时 需要参数 lineName departureStopName arrivalStopName isLastStop
* type=5时 不需要任何参数
*
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
* @param lineName 路线名
* @param departureStopName 出站站点名
* @param arrivalStopName 下一站到达站点名
* @param isLastStop 是否最终站
* @return boolean
*/
boolean sendTripInfoReq(int type, String lineName, String departureStopName, String arrivalStopName, boolean isLastStop);
// TODO 需求暂停 待讨论
// boolean getRoutes();
@@ -349,6 +451,7 @@ public interface IAdasNetCommApi {
*/
void setEnableLog(boolean isEnableLog);
/**
* 获取与当前连接工控机兼容性
* 连接状态=已连接 时正常返回其他状态全部为null

View File

@@ -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);
}

View File

@@ -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;
}
}

View File

@@ -13,6 +13,10 @@ import system_master.SystemStatusInfo;
/**
* 是否可以启动自动驾驶能力检测
* 目前监控了底盘的一些状态和查询节点状态应答的数据
* 没有使用监控事件报告的原因是因为,部分异常没进行正常恢复通知,例如收到了异常监控数据,但是异常恢复之后没有恢复的通知
*
* 此定时器不能停止 鹰眼中存在UI更新依赖循环查询系统状态
*/
public class AutopilotAbilityManager {
private static final String TAG = AutopilotAbilityManager.class.getSimpleName();

View File

@@ -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);
}
}
}

View File

@@ -110,4 +110,26 @@ public class Constants {
}
/**
* 启动自动驾驶后的状态
*/
public interface AUTOPILOT_START_STATUS {
/**
* 成功
*/
int SUCCESSFUL = 0;
/**
* 失败
*/
int FAILED = 1;
/**
* 取消
*/
int CANCEL = 2;
/**
* 超时
*/
int TIMEOUT = 3;
}
}

View File

@@ -12,7 +12,7 @@ public class CupidLogUtils {
* 默认是打开日志
*/
// private static boolean mIsEnableLog = BuildConfig.DEBUG;
private static boolean mIsEnableLog = true;
private static boolean mIsEnableLog = false;
/**
* @param isEnableLog true开启 false关闭

View File

@@ -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 {
}
}

View File

@@ -49,6 +49,9 @@ public enum MessageType {
TYPE_SEND_RECORD_DATA_CONFIG_REQ(MessagePad.MessageType.MsgTypeRecordDataConfigReq, "数据采集配置查询"),
TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP(MessagePad.MessageType.MsgTypeRecordDataConfigResp, "数据采集配置"),
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决策状态");

View File

@@ -2,15 +2,15 @@ package com.zhidao.support.adas.high.common;
/**
* 监控事件报告中定义的事件以及解释
* 根据260消息定义编写
* 根据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 {
@@ -190,6 +190,20 @@ public class MogoReport {
String EXIT_AUTOPILOT_FOR_LOCATION = "EMAP_EXIT_AUTOPILOT_FOR_LOCATION";//因location掉帧强退自动驾驶
String EXIT_AUTOPILOT_FOR_CHASSIS = "EMAP_EXIT_AUTOPILOT_FOR_CHASSIS";//因底盘消息掉帧强退自动驾驶
String EXIT_AUTOPILOT_FOR_DISTANCE = "EMAP_EXIT_AUTOPILOT_FOR_DISTANCE";//因planning起点距离当前过远强退自动驾驶
String EXIT_AUTOPILOT_FOR_BRAKE = "EMAP_EXIT_AUTOPILOT_FOR_BRAKE";//制动踏板干预而强退自动驾驶
String EXIT_AUTOPILOT_FOR_ACCEL = "EMAP_EXIT_AUTOPILOT_FOR_ACCEL";//加速踏板干预而强退自动驾驶
String EXIT_AUTOPILOT_FOR_STEER = "EMAP_EXIT_AUTOPILOT_FOR_STEER";//方向盘干预而强退自动驾驶
String EXIT_AUTOPILOT_FOR_GEAR_SWITCH = "EMAP_EXIT_AUTOPILOT_FOR_GEAR_SWITCH";//档位切换干预而强退自动驾驶
String EXIT_AUTOPILOT_FOR_CHASSIS_NO_RESPONSE = "EMAP_EXIT_AUTOPILOT_FOR_CHASSIS_NO_RESPONSE";//底盘不响应请求而强退自动驾驶
String EXIT_AUTOPILOT_FOR_CHASSIS_UNKNOWN = "EMAP_EXIT_AUTOPILOT_FOR_CHASSIS_UNKNOWN";//底盘退出原因未知而强退自动驾驶
String ENTRY_AUTOPILOT_FOR_CANADAPTER_TIMEOUT = "EMAP_ENTRY_AUTOPILOT_FOR_CANADAPTER_TIMEOUT";//can_adapter消息超时未进入自驾
String ENTRY_AUTOPILOT_FOR_PLANNING_TIMEOUT = "EMAP_ENTRY_AUTOPILOT_FOR_PLANNING_TIMEOUT";//PLANNING消息超时未进自驾
String ENTRY_AUTOPILOT_FOR_LOCATION_TIMEOUT = "EMAP_ENTRY_AUTOPILOT_FOR_LOCATION_TIMEOUT";//定位消息超时未进自驾
String ENTRY_AUTOPILOT_FOR_BRAKE = "EMAP_ENTRY_AUTOPILOT_FOR_BRAKE";//制动踏板干预未进自驾
String ENTRY_AUTOPILOT_FOR_ACCEL = "EMAP_ENTRY_AUTOPILOT_FOR_ACCEL";//加速踏板干预未进自驾
String ENTRY_AUTOPILOT_FOR_STEER = "EMAP_ENTRY_AUTOPILOT_FOR_STEER";//方向盘干预未进自驾
String ENTRY_AUTOPILOT_FOR_GEAR_SWITCH = "EMAP_ENTRY_AUTOPILOT_FOR_GEAR_SWITCH";//档位切换干预未进自驾
String ENTRY_AUTOPILOT_FOR_OTHER_CTL = "EMAP_ENTRY_AUTOPILOT_FOR_OTHER_CTL";//其他干预未进自驾,请检查仪表盘和开关项(如双闪,制动灯灯等 可在msg中补充原因信息
String HADMAP_ENGINE_NO_ROUTING_INFO = "EMAP_HADMAP_ENGINE_NO_ROUTING_INFO";//hadmap_engine算路失败或未找到轨迹文件导致的轨迹文件信息未发布
String HADMAP_NO_TRAJECTORY = "EMAP_HADMAP_NO_TRAJECTORY";//hadmap未发布全局路径
String HADMAP_PLANNING_NO_TRAJECTORY = "EMAP_HADMAP_PLANNING_NO_TRAJECTORY";//local_planning未发布局部轨迹
@@ -213,6 +227,7 @@ public class MogoReport {
String STEER_INFERENCE = "EVHC_STEER_INFERENCE";//由于方向盘干预退出自动驾驶或无法进入自动驾驶
String ACCEL_INFERENCE = "EVHC_ACCEL_INFERENCE";//由于油门干预退出自动驾驶或无法进入自动驾驶
String CSS = "EVHC_CSS";//底盘不允许进入自动驾驶
String GEAR = "EVHC_GEAR";//档位不是D或N档
}
/**
@@ -226,13 +241,15 @@ public class MogoReport {
String NOT_ALLOW_AUTOPILOT_FOR_REMOTE = "ESYS_NOT_ALLOW_AUTOPILOT_FOR_REMOTE";//系统处于远程驾驶中,拒绝进入自动驾驶
String NOT_ALLOW_REBOOT = "ESYS_NOT_ALLOW_REBOOT";//重启拒绝
String TOPIC_FREQ_DROPED = "ESYS_TOPIC_FREQ_DROPED";//存在topic严重掉频
String AUTOPILOT_TAKEN_OVER_BY_REMOTE = "ESYS_AUTOPILOT_TAKEN_OVER_BY_REMOTE";//自动驾驶被远程驾驶接管
@Deprecated
String RTK_STATUS_FAULT = "ESYS_RTK_STATUS_FAULT";//RTK状态持续错误
String AUTOPILOT_TAKEN_OVER_BY_REMOTE = "ESYS_AUTOPILOT_TAKEN_OVER_BY_REMOTE";//自动驾驶被远程驾驶接管
String ROUTING_REQ_TIMEOUT = "ESYS_ROUTING_REQ_TIMEOUT";//自动驾驶开始前routing请求无响应
String PLANNING_CHANGE_FAILIED = "ESYS_PLANNING_CHANGE_FAILIED";//planning版本切换启动失败
String CHECK_TRAJECTORY_FAILURE = "ESYS_CHECK_TRAJECTORY_FAILURE";//轨迹文件检查超时或检查结果无可用轨迹
String FAULT = "ESYS_FAULT";//master启动10分钟仍有agent未连接
String REBOOT_WARNING = "ESYS_REBOOT_WARNING";//命令重启不完全提示(部分模块没有关闭成功)
String CAN_MSG_LOST = "ESYS_CAN_MSG_LOST";//master接收底盘消息超时
}
interface EAGENT {
@@ -246,6 +263,7 @@ public class MogoReport {
interface ECAM {
String INIT = "ECAM_INIT";//相机初始化失败
String CALIB = "ECAM_CALIB";//标定信息读取失败
String GRAB_FATAL = "ECAM_GRAB_FATAL";//相机数据采集异常
}
/**
@@ -281,7 +299,7 @@ public class MogoReport {
String TRA_LOADED = "IMAP_TRA_LOADED";//轨迹文件加载成功
String TRA_ROUTING = "IMAP_TRA_ROUTING";//算路成功
String TRA_TYPE = "IMAP_TRA_TYPE";//加载轨迹类型通知
String ENTRY_AUTOPILOT = "IMAP_ENTRY_AUTOPILOT";//控制进入自动驾驶成功
}
/**
@@ -311,14 +329,16 @@ public class MogoReport {
String CAN_NORMAL = "ISYS_CAN_NORMAL";//底盘状态正常或恢复正常
String REOMTEPILOT_STARTING = "ISYS_REOMTEPILOT_STARTING";//平行驾驶启动中
String REOMTEPILOT_RUNING = "ISYS_REOMTEPILOT_RUNING";//平行驾驶运行中
String SYSTEM_IN_IDLE = "ISYS_SYSTEM_IN_IDLE";//系统进入空闲状态
String SYSTEM_OUT_IDLE = "ISYS_SYSTEM_OUT_IDLE";//系统退出空闲状态
String INIT_TRAJECTORY_START = "ISYS_INIT_TRAJECTORY_START";//轨迹管理_轨迹开始下载
String INIT_TRAJECTORY_SUCCESS = "ISYS_INIT_TRAJECTORY_SUCCESS";//轨迹管理_轨迹下载成功
String INIT_TRAJECTORY_FAILURE = "ISYS_INIT_TRAJECTORY_FAILURE";//轨迹管理_轨迹下载失败本地无对应轨迹
String INIT_TRAJECTORY_WARNING = "ISYS_INIT_TRAJECTORY_WARNING";//轨迹管理_轨迹下载失败本地有对应轨迹认为成功
String INIT_TRAJECTORY_TIMEOUT = "ISYS_INIT_TRAJECTORY_TIMEOUT";//轨迹管理_轨迹下载超时
String SYSTEM_IN_IDLE = "ISYS_SYSTEM_IN_IDLE";//系统进入空闲状态
String SYSTEM_OUT_IDLE = "ISYS_SYSTEM_OUT_IDLE";//系统退出空闲状态
String CONFIG_UPDATE_HADMAP = "ISYS_CONFIG_UPDATE_HADMAP";//高精地图:需要重启升级高精地图
String CONFIG_UPDATE_HADMAP = "ISYS_CONFIG_UPDATE_HADMAP";//需要重启升级高精地图
String CONFIG_UPDATE_AI_MODEL = "ISYS_CONFIG_UPDATE_AI_MODEL";//需要重启升级AI模型
String CONFIG_UPDATE_SLAM_MAP = "ISYS_CONFIG_UPDATE_SLAM_MAP";//需要重启升级SLAM地图
}
interface IAGENT {

View File

@@ -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());
}

View File

@@ -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) {

View File

@@ -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);//统计启动自动驾驶失败原因
}
}
}
}

View File

@@ -13,6 +13,11 @@ import okio.ByteString;
* @des
* @date 2021/10/20
* 原始数据格式MagicCode(2字节 6d67) 偏移量(2字节 从原始数据头开始一直到Body头) 数据包总长度4字节 Header Body
* 实例:(偏移量从数据第一个字节开始)
* 6d 67 00 10 00 00 00 07 Header 数据
* MG头 偏移量 数据包总长度
* 计算Header长度 = 偏移量- 8MG头长度+偏移量长度+数据包总长度长度)
* 计算数据长度 = 数据包总长度 - 偏移量
*/
public class RawData {
public long receiveTime;//TODO 计算耗时 临时测试

View File

@@ -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部分遮挡

View File

@@ -73,15 +73,17 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
@Override
public void destroy() {
if ( mMogoMarkerOptions != null ) {
mMogoMarkerOptions.deleteObservers();
mMogoMarkerOptions = null;
}
if ( mMarker != null ) {
mMarker.remove();
mMarker.setMObject( null );
mMarker.setOnInfoWindowClickListener( null );
mMarker = null;
synchronized (this) {
if ( mMogoMarkerOptions != null ) {
mMogoMarkerOptions.deleteObservers();
mMogoMarkerOptions = null;
}
if ( mMarker != null ) {
mMarker.remove();
mMarker.setMObject( null );
mMarker.setOnInfoWindowClickListener( null );
mMarker = null;
}
}
mMogoInfoWindowAdapter = null;
mMogoMarkerClickListener = null;