[adas] 添加M1拼接视频接收接口
This commit is contained in:
@@ -31,6 +31,7 @@ enum MessageType
|
||||
MsgTypeChassisStates = 0x1000b; //重构后的底盘状态, 透传
|
||||
MsgTypeFunctionStates = 0x1000c; //重构后的功能状态, 透传
|
||||
MsgTypeBackCameraVideo = 0x1000d; //清扫车后部摄像头视频 10hz
|
||||
MsgTypeM1StitchedVideo = 0x1000e; //m1拼接视频 10hz
|
||||
|
||||
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
|
||||
MsgTypeBasicInfoResp = 0x10101; //自动驾驶设备基础信息应答
|
||||
@@ -646,6 +647,9 @@ message PlanningCmd
|
||||
//message definition for MsgTypeBackCameraVideo
|
||||
//payload:jpeg data
|
||||
|
||||
//message definition for MsgTypeM1StitchedVideo
|
||||
//payload:jpeg data
|
||||
|
||||
//message definition for MsgTypeV2nCongestionEvent
|
||||
//refer to RSI_PB in mogo_v2x.proto for details
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.support.obu.ObuScene;
|
||||
import com.zhidao.support.adas.high.common.MessageType;
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask;
|
||||
@@ -357,6 +358,18 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onBagManagerCmd(MessagePad.Header header, BagManagerOuterClass.BagManager bagManager);
|
||||
|
||||
/**
|
||||
* M1拼接视频 10Hz
|
||||
* 此接口需要订阅,默认不发送数据
|
||||
* 订阅调用:{@link AdasManager#subscribeInterface(int, int, MessageType)}
|
||||
* 订阅参数:AdasManager.getInstance().subscribeInterface(Constants.TERMINAL_ROLE.DRIVER, Constants.SUBSCRIBE_TYPE.SUBSCRIBE, MessageType。TYPE_RECEIVE_M1_STITCHED_VIDEO);
|
||||
* 取消订阅参数:AdasManager.getInstance().subscribeInterface(Constants.TERMINAL_ROLE.DRIVER, Constants.SUBSCRIBE_TYPE.UNSUBSCRIBE, MessageType。TYPE_RECEIVE_M1_STITCHED_VIDEO);
|
||||
*
|
||||
* @param header 头
|
||||
* @param data 数据
|
||||
*/
|
||||
void onM1StitchedVideo(@NonNull MessagePad.Header header, @NonNull byte[] data);
|
||||
|
||||
/**
|
||||
* 是否有能力启动自动驾驶
|
||||
*
|
||||
|
||||
@@ -26,6 +26,7 @@ public enum MessageType {
|
||||
TYPE_RECEIVE_CHASSIS_STATES(MessagePad.MessageType.MsgTypeChassisStates, "底盘状态"),
|
||||
TYPE_RECEIVE_FUNCTION_STATES(MessagePad.MessageType.MsgTypeFunctionStates, "重构后功能状态"),
|
||||
TYPE_RECEIVE_BACK_CAMERA_VIDEO(MessagePad.MessageType.MsgTypeBackCameraVideo, "清扫车后摄像头"),
|
||||
TYPE_RECEIVE_M1_STITCHED_VIDEO(MessagePad.MessageType.MsgTypeM1StitchedVideo, "M1拼接视频"),
|
||||
|
||||
TYPE_RECEIVE_BASIC_INFO_REQ(MessagePad.MessageType.MsgTypeBasicInfoReq, "自动驾驶设备基础信息请求"),
|
||||
TYPE_SEND_BASIC_INFO_RESP(MessagePad.MessageType.MsgTypeBasicInfoResp, "自动驾驶设备基础信息应答"),
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
/**
|
||||
* 清扫车后摄像头
|
||||
* 清扫车后摄像头 10Hz
|
||||
*/
|
||||
public class BackCameraVideoMessage extends MyAbstractMessageHandler {
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* M1拼接视频 10Hz
|
||||
*/
|
||||
public class M1StitchedVideoMessage extends MyAbstractMessageHandler {
|
||||
|
||||
public M1StitchedVideoMessage() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
int len = raw.getPackageLengthValue() - raw.getOffsetValue();
|
||||
byte[] data = new byte[len];
|
||||
System.arraycopy(raw.originalData.toByteArray(), raw.getOffsetValue(), data, 0, len);
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("M1StitchedVideoMessage", raw.receiveTime);
|
||||
long nowTime = 0;
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
adasListener.onM1StitchedVideo(raw.getHeader(), data);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("M1StitchedVideoMessage", nowTime);
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg backCameraVideoMessage;//清扫车后摄像头
|
||||
private IMsg pointCloudMessage;//3D点云
|
||||
private IMsg sweeperCloudTaskMessage;//云控下发清扫车任务指令
|
||||
private IMsg m1StitchedVideoMessage;//M1拼接视频
|
||||
|
||||
private final AutopilotReview autopilotReview;
|
||||
|
||||
@@ -204,7 +205,13 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
sweeperCloudTaskMessage = new SweeperCloudTaskMessage();
|
||||
}
|
||||
return sweeperCloudTaskMessage;
|
||||
} else {
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_M1_STITCHED_VIDEO.typeCode) {
|
||||
//清扫车后摄像头
|
||||
if (m1StitchedVideoMessage == null) {
|
||||
m1StitchedVideoMessage = new M1StitchedVideoMessage();
|
||||
}
|
||||
return m1StitchedVideoMessage;
|
||||
} else {
|
||||
//MessageType.TYPE_DEFAULT.typeCode
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user