Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0

# Conflicts:
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/SweeperFragment.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java
#	app_ipc_monitoring/src/main/java/com/zhidao/adas/client/DataDistribution.java
#	app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java
#	app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java
#	core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoHandAdasMsgManager.java
#	core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/bindingcar/BindingcarProvider.java
#	core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt
#	core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt
#	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/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java
#	core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java
#	core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt
#	core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt
#	libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java
#	libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/MyMessageFactory.java
#	libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/VehicleStateMessage.java
This commit is contained in:
donghongyu
2023-01-17 18:09:06 +08:00
1903 changed files with 34839 additions and 33745 deletions

View File

@@ -55,6 +55,7 @@ import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicInteger;
import bag_manager.BagManagerOuterClass;
import chassis.SpecialVehicleTaskCmdOuterClass;
import common.HeaderOuterClass;
import mogo.telematics.pad.MessagePad;
@@ -969,6 +970,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
/**
* 发送红绿灯数据到工控机
* TODO MAP290开始此接口弃用
*
* @param crossID roadID
* @param latitude 纬度
@@ -983,6 +985,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
* @param timestamp 当前卫星时间, 单位: ms
* @return
*/
@Deprecated
@Override
public boolean sendTrafficLightData(@NonNull String crossID, double latitude, double longitude,
@NonNull String heading, @NonNull String direction, int lightId, int laneNo,
@@ -1178,6 +1181,20 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
return subscribeInterface != null && subscribeInterface.subscribeInterface(role, type, messageType);
}
/**
* 给Planning发送指令
*
* @param cmd 命令 0: default 1: 靠边停车 2:重新起步
* @return boolean
*/
@Override
public boolean sendPlanningCmd(int cmd) {
MessagePad.PlanningCmd planningCmd = MessagePad.PlanningCmd.newBuilder()
.setPullOverCmd(MessagePad.PullOverCmd.newBuilder().setCmd(cmd))
.build();
return sendPBMessage(MessageType.TYPE_SEND_PLANNING_CMD.typeCode, planningCmd.toByteArray());
}
/**
* 福田清扫车业务指令下发
*
@@ -1206,6 +1223,95 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
return sendSpecialVehicleTaskCmd(cmdBuild);
}
/**
* 金旅M1空调控制
*
* @param switchCmd 0: default, 1: 开启空调, 2: 关闭空调
* @param modeCmd 模式 0: default, 1: 自动模式, 2: 制冷模式, 3: 通风模式(仅送风,无温度)
* @param windSpeedCmd 风速 0: default, 1: 1档2: 2档3:3档
* @param temperatureCmd 温度 0: default, 16-26: 温度
* @return boolean
*/
@Override
public boolean sendRoboBusJinlvM1AirConditionerCmd(int switchCmd, int modeCmd, int windSpeedCmd, int temperatureCmd) {
return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder()
.setAirConditionerCmd(switchCmd)
.setAirConditionerModeCmd(modeCmd)
.setAirConditionerWindSpeedCmd(windSpeedCmd)
.setAirConditionerTemperatureCmd(temperatureCmd)
.build());
}
/**
* 金旅M1暖风机控制
*
* @param switchCmd //0: default, 1: 开启暖风机, 2: 关闭暖风机
* @param windSpeedCmd //风速 0: default, 1: 1档2: 2档
* @return boolean
*/
@Override
public boolean sendRoboBusJinlvM1HeaderCmd(int switchCmd, int windSpeedCmd) {
return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder()
.setHeaderCmd(switchCmd)
.setHeaderWindSpeedCmd(windSpeedCmd)
.build());
}
/**
* 金旅M1顶灯控制
*
* @param switch1Cmd //0: default, 1: 开启顶灯1, 2: 关闭顶灯1
* @param switch2Cmd //0: default, 1: 开启顶灯2, 2: 关闭顶灯2
* @return boolean
*/
@Override
public boolean sendRoboBusJinlvM1MainLampCmd(int switch1Cmd, int switch2Cmd) {
return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder()
.setMainLamp1Cmd(switch1Cmd)
.setMainLamp2Cmd(switch2Cmd)
.build());
}
/**
* 金旅M1小灯(氛围灯)控制
*
* @param switchCmd //0: default, 1: 开启小灯(氛围灯), 2: 关闭小灯(氛围灯)
* @return boolean
*/
@Override
public boolean sendRoboBusJinlvM1SmallLampCmd(int switchCmd) {
return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder()
.setSmallLampCmd(switchCmd)
.build());
}
/**
* 金旅M1车门控制
*
* @param switchCmd //0: default, 1: 开启车门, 2: 关闭车门
* @return boolean
*/
@Override
public boolean sendRoboBusJinlvM1FrontDoorCmd(int switchCmd) {
return sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd.newBuilder()
.setFrontDoorCmd(switchCmd)
.build());
}
/**
* 金旅M1业务指令下发
*
* @param roboBusJinlvM1Cmd 命令
* @return boolean
*/
@Override
public boolean sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd roboBusJinlvM1Cmd) {
SpecialVehicleTaskCmdOuterClass.SpecialVehicleTaskCmd.Builder cmdBuild = SpecialVehicleTaskCmdOuterClass.SpecialVehicleTaskCmd
.newBuilder()
.setRoboBusJinlvM1Cmd(roboBusJinlvM1Cmd);
return sendSpecialVehicleTaskCmd(cmdBuild);
}
/**
* 特种车辆命令下发
*
@@ -1389,5 +1495,17 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
return sendPBMessage(MessageType.TYPE_SEND_TRIP_INFO_REQ.typeCode, req.toByteArray());
}
/**
* 发送包管理请求
*
* @param bagManager 包管理参数
* @return boolean
*/
@Override
public boolean sendBagManagerCmd(BagManagerOuterClass.BagManager bagManager) {
return sendPBMessage(MessageType.TYPE_SEND_BAG_MANAGER_CMD.typeCode, bagManager.toByteArray());
}
}

View File

@@ -15,6 +15,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import bag_manager.BagManagerOuterClass;
import chassis.SpecialVehicleTaskCmdOuterClass;
import mogo.telematics.pad.MessagePad;
@@ -449,6 +450,7 @@ public class AdasManager implements IAdasNetCommApi {
/**
* 发送红绿灯数据到工控机
* TODO MAP290开始此接口弃用
*
* @param crossID roadID
* @param latitude
@@ -463,6 +465,7 @@ public class AdasManager implements IAdasNetCommApi {
* @param timestamp 当前卫星时间, 单位: ms
* @return
*/
@Deprecated
@Override
public boolean sendTrafficLightData(@NonNull String crossID, double latitude, double longitude, @NonNull String heading, @NonNull String direction, int lightId, int laneNo, int arrowNo, int flashYellow, MessagePad.TrafficLightDetail laneDetail, long timestamp) {
return mChannel != null && mChannel.sendTrafficLightData(crossID, latitude, longitude, heading, direction, lightId, laneNo, arrowNo, flashYellow, laneDetail, timestamp);
@@ -600,6 +603,17 @@ public class AdasManager implements IAdasNetCommApi {
return mChannel != null && mChannel.subscribeInterface(role, type, messageType);
}
/**
* 给Planning发送指令
*
* @param cmd 命令 0: default 1: 靠边停车 2:重新起步
* @return boolean
*/
@Override
public boolean sendPlanningCmd(int cmd) {
return mChannel != null && mChannel.sendPlanningCmd(cmd);
}
/**
* 福田清扫车业务指令下发
*
@@ -622,6 +636,77 @@ public class AdasManager implements IAdasNetCommApi {
return mChannel != null && mChannel.sendRoboVanSkywellTaskCmd(vanSkywellTaskCmd);
}
/**
* 金旅M1空调控制
*
* @param switchCmd 0: default, 1: 开启空调, 2: 关闭空调
* @param modeCmd 模式 0: default, 1: 自动模式, 2: 制冷模式, 3: 通风模式(仅送风,无温度)
* @param windSpeedCmd 风速 0: default, 1: 1档2: 2档3:3档
* @param temperatureCmd 温度 0: default, 16-26: 温度
* @return boolean
*/
@Override
public boolean sendRoboBusJinlvM1AirConditionerCmd(int switchCmd, int modeCmd, int windSpeedCmd, int temperatureCmd) {
return mChannel != null && mChannel.sendRoboBusJinlvM1AirConditionerCmd(switchCmd, modeCmd, windSpeedCmd, temperatureCmd);
}
/**
* 金旅M1暖风机控制
*
* @param switchCmd //0: default, 1: 开启暖风机, 2: 关闭暖风机
* @param windSpeedCmd //风速 0: default, 1: 1档2: 2档
* @return boolean
*/
@Override
public boolean sendRoboBusJinlvM1HeaderCmd(int switchCmd, int windSpeedCmd) {
return mChannel != null && mChannel.sendRoboBusJinlvM1HeaderCmd(switchCmd, windSpeedCmd);
}
/**
* 金旅M1顶灯控制
*
* @param switch1Cmd //0: default, 1: 开启顶灯1, 2: 关闭顶灯1
* @param switch2Cmd //0: default, 1: 开启顶灯2, 2: 关闭顶灯2
* @return boolean
*/
@Override
public boolean sendRoboBusJinlvM1MainLampCmd(int switch1Cmd, int switch2Cmd) {
return mChannel != null && mChannel.sendRoboBusJinlvM1MainLampCmd(switch1Cmd, switch2Cmd);
}
/**
* 金旅M1车门控制
*
* @param switchCmd //0: default, 1: 开启车门, 2: 关闭车门
* @return boolean
*/
@Override
public boolean sendRoboBusJinlvM1SmallLampCmd(int switchCmd) {
return mChannel != null && mChannel.sendRoboBusJinlvM1SmallLampCmd(switchCmd);
}
/**
* 金旅M1车门控制
*
* @param switchCmd //0: default, 1: 开启车门, 2: 关闭车门
* @return boolean
*/
@Override
public boolean sendRoboBusJinlvM1FrontDoorCmd(int switchCmd) {
return mChannel != null && mChannel.sendRoboBusJinlvM1FrontDoorCmd(switchCmd);
}
/**
* 金旅M1业务指令下发
*
* @param roboBusJinlvM1Cmd 命令
* @return boolean
*/
@Override
public boolean sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd roboBusJinlvM1Cmd) {
return mChannel != null && mChannel.sendRoboBusJinlvM1TaskCmd(roboBusJinlvM1Cmd);
}
/**
* 特种车辆命令下发
*
@@ -716,6 +801,17 @@ public class AdasManager implements IAdasNetCommApi {
return mChannel != null && mChannel.sendTripInfoReq(type, lineName, departureStopName, arrivalStopName, isLastStop);
}
/**
* 发送包管理请求
*
* @param bagManager 包管理参数
* @return boolean
*/
@Override
public boolean sendBagManagerCmd(BagManagerOuterClass.BagManager bagManager) {
return mChannel != null && mChannel.sendBagManagerCmd(bagManager);
}
/**
* 获取工控机固定IP列表
*

View File

@@ -10,6 +10,7 @@ import com.zhidao.support.adas.high.common.MessageType;
import java.util.List;
import java.util.Set;
import bag_manager.BagManagerOuterClass;
import chassis.SpecialVehicleTaskCmdOuterClass;
import mogo.telematics.pad.MessagePad;
@@ -204,6 +205,7 @@ public interface IAdasNetCommApi {
/**
* 发送红绿灯数据到工控机
* TODO MAP290开始此接口弃用
*
* @param crossID roadID
* @param latitude 纬度
@@ -218,6 +220,7 @@ public interface IAdasNetCommApi {
* @param timestamp 当前卫星时间, 单位: ms
* @return 加入WS发送消息队列是否成功
*/
@Deprecated
boolean sendTrafficLightData(@NonNull String crossID, double latitude, double longitude,
@NonNull String heading, @NonNull String direction, int lightId, int laneNo,
int arrowNo, int flashYellow, MessagePad.TrafficLightDetail laneDetail, long timestamp);
@@ -318,6 +321,14 @@ public interface IAdasNetCommApi {
*/
boolean subscribeInterface(@Define.TerminalRole int role, @Define.SubscribeType int type, @NonNull MessageType messageType);
/**
* 给Planning发送指令
*
* @param cmd 命令 0: default 1: 靠边停车 2:重新起步
* @return boolean
*/
boolean sendPlanningCmd(int cmd);
/**
* 福田清扫车业务指令下发
*
@@ -334,6 +345,59 @@ public interface IAdasNetCommApi {
*/
boolean sendRoboVanSkywellTaskCmd(SpecialVehicleTaskCmdOuterClass.RoboVanSkywellTaskCmd vanSkywellTaskCmd);
/**
* 金旅M1空调控制
*
* @param switchCmd 0: default, 1: 开启空调, 2: 关闭空调
* @param modeCmd 模式 0: default, 1: 自动模式, 2: 制冷模式, 3: 通风模式(仅送风,无温度)
* @param windSpeedCmd 风速 0: default, 1: 1档2: 2档3:3档
* @param temperatureCmd 温度 0: default, 16-26: 温度
* @return boolean
*/
boolean sendRoboBusJinlvM1AirConditionerCmd(int switchCmd, int modeCmd, int windSpeedCmd, int temperatureCmd);
/**
* 金旅M1暖风机控制
*
* @param switchCmd //0: default, 1: 开启暖风机, 2: 关闭暖风机
* @param windSpeedCmd //风速 0: default, 1: 1档2: 2档
* @return boolean
*/
boolean sendRoboBusJinlvM1HeaderCmd(int switchCmd, int windSpeedCmd);
/**
* 金旅M1顶灯控制
*
* @param switch1Cmd //0: default, 1: 开启顶灯1, 2: 关闭顶灯1
* @param switch2Cmd //0: default, 1: 开启顶灯2, 2: 关闭顶灯2
* @return boolean
*/
boolean sendRoboBusJinlvM1MainLampCmd(int switch1Cmd, int switch2Cmd);
/**
* 金旅M1小灯(氛围灯)控制
*
* @param switchCmd //0: default, 1: 开启小灯(氛围灯), 2: 关闭小灯(氛围灯)
* @return boolean
*/
boolean sendRoboBusJinlvM1SmallLampCmd(int switchCmd);
/**
* 金旅M1车门控制
*
* @param switchCmd //0: default, 1: 开启车门, 2: 关闭车门
* @return boolean
*/
boolean sendRoboBusJinlvM1FrontDoorCmd(int switchCmd);
/**
* 金旅M1业务指令下发
*
* @param roboBusJinlvM1Cmd 命令
* @return boolean
*/
boolean sendRoboBusJinlvM1TaskCmd(SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd roboBusJinlvM1Cmd);
/**
* 特种车辆命令下发
*
@@ -427,6 +491,13 @@ public interface IAdasNetCommApi {
*/
boolean sendTripInfoReq(int type, String lineName, String departureStopName, String arrivalStopName, boolean isLastStop);
/**
* 发送包管理请求
*
* @param bagManager 包管理参数
* @return boolean
*/
boolean sendBagManagerCmd(BagManagerOuterClass.BagManager bagManager);
// TODO 需求暂停 待讨论
// boolean getRoutes();

View File

@@ -4,6 +4,7 @@ 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 bag_manager.BagManagerOuterClass;
import chassis.ChassisStatesOuterClass;
import function_state_management.FunctionStates;
import mogo.telematics.pad.MessagePad;
@@ -52,6 +53,15 @@ public interface OnAdasListener {
*/
void onGnssInfo(MessagePad.Header header, MessagePad.GnssInfo gnssInfo);
/**
* 老底盘信息,透传底盘状态pb参考底盘
* TODO 目前由于M1车型不会在新底盘PB添加新的字段 所以临时保留
* TODO 后期会优化掉具体时间未知需要工控机端新老底盘PB字段对齐
*
* @param header 头
* @param vehicleState 数据
*/
void onVehicleState(MessagePad.Header header, VehicleStateOuterClass.VehicleState vehicleState);
/**
* 底盘状态
@@ -199,6 +209,14 @@ public interface OnAdasListener {
*/
void onSweeperTaskIndexData(MessagePad.Header header, RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex roboSweeperTaskIndex);
/**
* Bag管理应答
*
* @param header 头
* @param bagManager 数据
*/
void onBagManagerCmd(MessagePad.Header header, BagManagerOuterClass.BagManager bagManager);
/**
* 是否有能力启动自动驾驶
*

View File

@@ -37,7 +37,10 @@ public class AutopilotStatistics {
*/
public final MogoReportMsg.MogoReportMessage failedMessage;
public AutopilotStatistics(@Define.AutopilotStartStatus int status, long usedTime, MessagePad.SetAutopilotModeReq req, 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;

View File

@@ -38,6 +38,7 @@ public enum MessageType {
TYPE_SEND_SET_AUTOPILOT_SPEED_REQ(MessagePad.MessageType.MsgTypeSetAutopilotSpeedReq, "设置自动驾驶最大速度"),
TYPE_SEND_GLOBAL_PATH_REQ(MessagePad.MessageType.MsgTypeGlobalPathReq, "自动驾驶路径请求"),
TYPE_RECEIVE_GLOBAL_PATH_RESP(MessagePad.MessageType.MsgTypeGlobalPathResp, "自动驾驶路径应答"),
@Deprecated//MAP290开始此接口弃用
TYPE_SEND_TRAFFIC_LIGHT_DATA(MessagePad.MessageType.MsgTypeTrafficLightData, "发送红绿灯数据到工控机"),
@Deprecated
TYPE_RECEIVE_WARN(MessagePad.MessageType.MsgTypeWarn, "预警数据"),
@@ -47,13 +48,16 @@ public enum MessageType {
TYPE_SEND_STATUS_QUERY_REQ(MessagePad.MessageType.MsgTypeStatusQueryReq, "状态查询请求"),
TYPE_RECEIVE_STATUS_QUERY_RESP(MessagePad.MessageType.MsgTypeStatusQueryResp, "状态查询应答"),
TYPE_SEND_SET_RAIN_MODE_REQ(MessagePad.MessageType.MsgTypeSetRainModeReq, "设置雨天模式"),
TYPE_SEND_OPERATOR_CMD_REQ(MessagePad.MessageType.MsgTypeOperatorCmdReq, "操控指令"),
TYPE_SEND_RECORD_DATA_CONFIG_REQ(MessagePad.MessageType.MsgTypeRecordDataConfigReq, "数据采集配置查询"),
TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP(MessagePad.MessageType.MsgTypeRecordDataConfigResp, "数据采集配置"),
TYPE_SEND_OPERATOR_CMD_REQ(MessagePad.MessageType.MsgTypeOperatorCmdReq, "操控指令"),
TYPE_SEND_SUBSCRIBE_DATA_REQ(MessagePad.MessageType.MsgTypeSubscribeDataReq, "数据订阅、取消订阅请求"),
TYPE_SEND_SPECIAL_VEHICLE_TASK_CMD(MessagePad.MessageType.MsgTypeSpecialVehicleTaskCmd, "特种车辆命令"),
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, "特种车辆命令"),
TYPE_SEND_BAG_MANAGER_CMD(MessagePad.MessageType.MsgTypeBagManagerCmd, "Bag管理请求"),
TYPE_RECEIVE_BAG_MANAGER_CMD(MessagePad.MessageType.MsgTypeBagManagerCmd, "Bag管理应答"),
TYPE_SEND_PLANNING_CMD(MessagePad.MessageType.MsgTypePlanningCmd, "给Planning指令"),
//TODO 透传原始pb文件中不存在以下type。由于Java中无法强转,所以在mogo-adas-data/message_pad.proto中放开注释
TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态"),
TYPE_RECEIVE_SWEEPER_TASK_INDEX_DATA(MessagePad.MessageType.MsgTypeSweeperTaskIndexData, "清扫车指标数据"),

View File

@@ -0,0 +1,33 @@
package com.zhidao.support.adas.high.msg;
import android.os.SystemClock;
import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.AdasChannel;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.protocol.RawData;
import bag_manager.BagManagerOuterClass;
/**
* Bag管理应答
*/
public class BagManagerMessage extends MyAbstractMessageHandler {
public BagManagerMessage() {
}
@Override
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
BagManagerOuterClass.BagManager bagManager = BagManagerOuterClass.BagManager.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
AdasChannel.calculateTimeConsumingOnDispatchRaw("Bag管理应答", raw.receiveTime);
long nowTime = 0;
if (CupidLogUtils.isEnableLog())
nowTime = SystemClock.elapsedRealtime();
if (adasListener != null) {
adasListener.onBagManagerCmd(raw.getHeader(), bagManager);
}
AdasChannel.calculateTimeConsumingBusiness("Bag管理应答", nowTime);
}
}

View File

@@ -34,6 +34,7 @@ public class MyMessageFactory implements IMyMessageFactory {
private IMsg planningDecisionStateMessage;//planning决策状态
private IMsg functionStatesMessage;//重构后的功能状态
private IMsg sweeperTaskIndexDataMessage;//清扫车指标数据
private IMsg bagManagerMessage;//Bag管理应答
private final AutopilotReview autopilotReview;
@@ -169,6 +170,12 @@ public class MyMessageFactory implements IMyMessageFactory {
functionStatesMessage = new FunctionStatesMessage();
}
return functionStatesMessage;
} else if (messageType == MessageType.TYPE_RECEIVE_BAG_MANAGER_CMD.typeCode) {
//Bag管理应答
if (bagManagerMessage == null) {
bagManagerMessage = new BagManagerMessage();
}
return bagManagerMessage;
} else {
//MessageType.TYPE_DEFAULT.typeCode
return null;

View File

@@ -28,7 +28,9 @@ public class VehicleStateMessage extends MyAbstractMessageHandler {
if (CupidLogUtils.isEnableLog())
nowTime = SystemClock.elapsedRealtime();
if (adasListener != null) {
compatibility(adasListener, raw, vehicleState);
//TODO 暂时关闭新老兼容
//compatibility(adasListener, raw, vehicleState);
adasListener.onVehicleState(raw.getHeader(), vehicleState);
}
AdasChannel.calculateTimeConsumingBusiness("底盘信息", nowTime);
// CupidLogUtils.e("底盘信息--->" + vehicleState.toString());
@@ -41,6 +43,8 @@ public class VehicleStateMessage extends MyAbstractMessageHandler {
* parking_brake longitude_driving_mode eps_steering_mode
* steering_sign location_missing trajectory_missing
* chassis_status_missing pilot_mode_condition_met vehicletakeoverstatus
* fuel_value robo_taxi_state robo_bus_state
* robo_bus_jinlv_m1_state
*/
private void compatibility(OnAdasListener adasListener, RawData raw, VehicleStateOuterClass.VehicleState vehicleState) throws InvalidProtocolBufferException {
/**************老地盘转换成新地盘PB***************/