[change] badcase 功能添加查询和接收配置接口,启动录制bag包接口加入前溯时间参数
This commit is contained in:
@@ -3,7 +3,7 @@ package mogo.telematics.pad;
|
||||
|
||||
enum ProtocolVersion{
|
||||
Defaultver = 0;
|
||||
CurrentVersion = 3; //每次修改proto文件增加1
|
||||
CurrentVersion = 4; //每次修改proto文件增加1
|
||||
}
|
||||
|
||||
enum MessageType
|
||||
@@ -20,6 +20,7 @@ enum MessageType
|
||||
MsgTypePredictionObstacleTrajectory = 0x10007; //他车轨迹预测
|
||||
MsgTypePointCloud = 0x10008; //点云透传
|
||||
MsgTypePlanningObjects = 0x10009; //planning障碍物
|
||||
MsgTypeOBU = 0x1000a; //OBU
|
||||
|
||||
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
|
||||
MsgTypeBasicInfoResp = 0x10101; //自动驾驶设备基础信息应答
|
||||
@@ -41,6 +42,8 @@ enum MessageType
|
||||
MsgTypeStatusQueryReq = 0x10111; //状态查询请求
|
||||
MsgTypeStatusQueryResp = 0x10112; //状态查询应答
|
||||
MsgTypeSetRainModeReq = 0x10113; //设置雨天模式
|
||||
MsgTypeRecordDataConfigReq = 0x10114; //数据采集配置查询请求
|
||||
MsgTypeRecordDataConfigResp = 0x10115; //数据采集配置查询应答
|
||||
}
|
||||
|
||||
message Header
|
||||
@@ -150,6 +153,9 @@ message PlanningObjects
|
||||
repeated PlanningObject objs = 1;
|
||||
}
|
||||
|
||||
// message definition for MessageType: MsgTypeOBU
|
||||
// refer to obu.proto
|
||||
|
||||
// message definition for MsgTypeTrajectoryDownloadReq
|
||||
message Line
|
||||
{
|
||||
@@ -250,6 +256,7 @@ message RecordData
|
||||
uint32 type = 3; //采集类型, 1:badcase, 2: map; 3: rests
|
||||
bool isRecord = 4; //采集指令, true: 采集, false: 停止采集
|
||||
bool sustain = 5; //是否持续采集
|
||||
uint32 bduration = 6; //前溯时长
|
||||
}
|
||||
|
||||
// message definition for MsgTypeRecordResult
|
||||
@@ -299,7 +306,7 @@ message TrafficLightData
|
||||
int32 arrowNo = 8; //当前车道对应地面要素转向
|
||||
int32 flashYellow = 9; //黄灯总时间
|
||||
TrafficLightDetail laneDetail = 10; //灯态具体信息
|
||||
uint64 timestamp =11;//当前卫星时间, 单位: ms
|
||||
uint64 timestamp = 11;//当前卫星时间, 单位: ms
|
||||
}
|
||||
|
||||
// message definition for MsgTypeWarn
|
||||
@@ -345,3 +352,21 @@ message SetRainModeReq
|
||||
uint32 enable = 1; //1: enable, 0: disable
|
||||
}
|
||||
|
||||
// message definition for MsgTypeRecordDataConfigReq
|
||||
message RecordDataConfigReq
|
||||
{
|
||||
uint32 reqType = 1; // 0: all, 其他保留
|
||||
}
|
||||
|
||||
// message definition for MsgTypeRecordDataConfigResp
|
||||
message RecordDataType
|
||||
{
|
||||
uint32 id = 1; //采集类型id
|
||||
string desc = 2; //采集类型描述
|
||||
}
|
||||
|
||||
message RecordDataConfig
|
||||
{
|
||||
repeated RecordDataType recordTypes = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,4 +14,4 @@ message MogoPointCloud
|
||||
optional double self_yaw = 7;
|
||||
repeated uint32 del_data = 8 [packed=true];
|
||||
repeated double add_data = 9 [packed=true];
|
||||
}
|
||||
}
|
||||
|
||||
17
libraries/mogo-adas-data/src/main/proto/obu.proto
Normal file
17
libraries/mogo-adas-data/src/main/proto/obu.proto
Normal file
@@ -0,0 +1,17 @@
|
||||
syntax = "proto3";
|
||||
package mogo.telematics.pad;
|
||||
//第三方OBU接入
|
||||
|
||||
import "header.proto";
|
||||
|
||||
enum Type{
|
||||
Default = 0;
|
||||
DF_OBU = 1;//宜宾东风OBU msg格式:Json字符串
|
||||
}
|
||||
message Obu
|
||||
{
|
||||
common.Header header = 1;
|
||||
Type type = 2;//第三方类型 目前只有东风OBU
|
||||
bytes msg = 3;//OBU 数据
|
||||
}
|
||||
|
||||
@@ -729,17 +729,22 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int type) {
|
||||
return sendRecordData(id, 0, type, true);
|
||||
return sendRecordData(id, 0, type, true, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int duration, int type) {
|
||||
return sendRecordData(id, duration, type, true);
|
||||
return sendRecordData(id, duration, type, true, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int duration, int type, int bduration) {
|
||||
return sendRecordData(id, duration, type, true, bduration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stopRecordPackage(int id, int type) {
|
||||
return sendRecordData(id, 0, type, false);
|
||||
return sendRecordData(id, 0, type, false, -1);
|
||||
}
|
||||
|
||||
|
||||
@@ -747,14 +752,16 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* 数据采集请求 主动录制Bag包
|
||||
* sustain为true时 duration无效
|
||||
*
|
||||
* @param id 采集id
|
||||
* @param duration 采集时间长 Max:5*60 秒
|
||||
* @param type 采集类型, 1:badCase, 2: map; 3: rests
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param id 采集id
|
||||
* @param duration 采集时间长 Max:5*60 秒
|
||||
* @param type 采集类型, 1:badCase, 2: map; 3: rests
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param bduration 前溯时长
|
||||
* @param sustain 是否持续采集
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRecordData(int id, int duration, int type, boolean isRecord) {
|
||||
public boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration) {
|
||||
boolean sustain = false;
|
||||
if (isRecord) {
|
||||
if (duration <= 0) {
|
||||
@@ -762,14 +769,17 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
sustain = true;
|
||||
}
|
||||
}
|
||||
MessagePad.RecordData req = MessagePad.RecordData
|
||||
MessagePad.RecordData.Builder builder = MessagePad.RecordData
|
||||
.newBuilder()
|
||||
.setId(id)
|
||||
.setDuration(duration)
|
||||
.setType(type)
|
||||
.setIsRecord(isRecord)
|
||||
.setSustain(sustain)
|
||||
.build();
|
||||
.setSustain(sustain);
|
||||
if (bduration > -1) {
|
||||
builder.setBduration(bduration);
|
||||
}
|
||||
MessagePad.RecordData req = builder.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_RECORD_DATA.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
@@ -921,5 +931,19 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_SET_RAIN_MODE_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据采集配置查询
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRecordDataConfigReq() {
|
||||
MessagePad.RecordDataConfigReq req = MessagePad.RecordDataConfigReq
|
||||
.newBuilder()
|
||||
.setReqType(0)
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_RECORD_DATA_CONFIG_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -342,6 +342,18 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.startRecordPackage(id, duration, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
* @param id
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int duration, int type, int bduration) {
|
||||
return mChannel != null && mChannel.startRecordPackage(id, duration, type, bduration);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
@@ -357,16 +369,16 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
/**
|
||||
* 数据采集请求 主动录制Bag包
|
||||
*
|
||||
* @param id 采集id
|
||||
* @param duration 采集时间长
|
||||
* @param type 采集类型, 1:badcase, 2: map; 3: rests
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param sustain 是否持续采集
|
||||
* @return
|
||||
* @param id 采集id
|
||||
* @param duration 采集时间长
|
||||
* @param type 采集类型, 1:badcase, 2: map; 3: rests
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param bduration 前溯时长
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRecordData(int id, int duration, int type, boolean isRecord) {
|
||||
return mChannel != null && mChannel.sendRecordData(id, duration, type, isRecord);
|
||||
public boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration) {
|
||||
return mChannel != null && mChannel.sendRecordData(id, duration, type, isRecord, bduration);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -456,6 +468,16 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.sendRainModeReq(enable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据采集配置查询
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRecordDataConfigReq() {
|
||||
return mChannel != null && mChannel.sendRecordDataConfigReq();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工控机固定IP列表
|
||||
*
|
||||
|
||||
@@ -116,6 +116,17 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
boolean startRecordPackage(int id, int duration, int type);
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
* @param id
|
||||
* @param duration
|
||||
* @param type
|
||||
* @param bduration
|
||||
* @return
|
||||
*/
|
||||
boolean startRecordPackage(int id, int duration, int type, int bduration);
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
@@ -128,13 +139,14 @@ public interface IAdasNetCommApi {
|
||||
/**
|
||||
* 数据采集请求 主动录制Bag包
|
||||
*
|
||||
* @param id 采集id
|
||||
* @param duration 采集时间长
|
||||
* @param type 采集类型, 1:badcase, 2: map; 3: rests
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param id 采集id
|
||||
* @param duration 采集时间长
|
||||
* @param type 采集类型, 1:badcase, 2: map; 3: rests
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param bduration 前溯时长
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRecordData(int id, int duration, int type, boolean isRecord);
|
||||
boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration);
|
||||
|
||||
/**
|
||||
* 设置自动驾驶最大速度
|
||||
@@ -203,6 +215,15 @@ public interface IAdasNetCommApi {
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRainModeReq(int enable);
|
||||
|
||||
/**
|
||||
* 数据采集配置查询
|
||||
* 0: all, 其他保留
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRecordDataConfigReq();
|
||||
|
||||
// TODO 需求暂停 待讨论
|
||||
// boolean getRoutes();
|
||||
|
||||
|
||||
@@ -171,6 +171,14 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onStatusQueryResp(MessagePad.Header header, SystemStatusInfo.StatusInfo statusInfo);
|
||||
|
||||
/**
|
||||
* 数据采集配置应答
|
||||
*
|
||||
* @param header 头
|
||||
* @param config 数据
|
||||
*/
|
||||
void onRecordDataConfigResp(MessagePad.Header header, MessagePad.RecordDataConfig config);
|
||||
|
||||
/**
|
||||
* 数据错误
|
||||
*
|
||||
|
||||
@@ -43,7 +43,9 @@ public enum MessageType {
|
||||
TYPE_SEND_TRAJECTORY_DOWNLOAD_REQ(MessagePad.MessageType.MsgTypeTrajectoryDownloadReq, "轨迹下载请求"),
|
||||
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_SET_RAIN_MODE_REQ(MessagePad.MessageType.MsgTypeSetRainModeReq, "设置雨天模式"),
|
||||
TYPE_SEND_RECORD_DATA_CONFIG_REQ(MessagePad.MessageType.MsgTypeRecordDataConfigReq, "数据采集配置查询"),
|
||||
TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP(MessagePad.MessageType.MsgTypeRecordDataConfigResp, "数据采集配置");
|
||||
|
||||
/**
|
||||
* 消息action code
|
||||
|
||||
@@ -29,6 +29,7 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg warnMessage;//预警数据
|
||||
private IMsg arrivalNotificationMessage;//到站提醒
|
||||
private IMsg statusQueryRespMessage;//状态查询应答
|
||||
private IMsg recordDataConfigRespMessage;//数据采集配置应答
|
||||
|
||||
|
||||
@Override
|
||||
@@ -135,6 +136,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
statusQueryRespMessage = new StatusQueryRespMessage();
|
||||
}
|
||||
return statusQueryRespMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP.typeCode) {
|
||||
//数据采集配置应答
|
||||
if (recordDataConfigRespMessage == null) {
|
||||
recordDataConfigRespMessage = new RecordDataConfigRespMessage();
|
||||
}
|
||||
return recordDataConfigRespMessage;
|
||||
} else {
|
||||
//MessageType.TYPE_DEFAULT.typeCode
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* 数据采集配置应答
|
||||
*/
|
||||
public class RecordDataConfigRespMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
MessagePad.RecordDataConfig config = MessagePad.RecordDataConfig.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
|
||||
if (adasListener != null) {
|
||||
adasListener.onRecordDataConfigResp(raw.getHeader(), config);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user