[change]pb添加planning障碍物接口和发送轨迹下载请求接口,以及启动自动驾驶接口添加新字段;添加发送轨迹下载请求接口解析和发送功能。

This commit is contained in:
xinfengkun
2022-06-07 10:44:48 +08:00
parent b92b60e9c0
commit c2de7226a6
6 changed files with 87 additions and 12 deletions

View File

@@ -537,7 +537,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
titleFragmentData.add(Constants.TITLE.RECEIVE_ERROR);
titleBtnData.add("启动自动驾驶");
titleBtnData.add("自动驾驶模式");
titleBtnData.add("自动驾驶路径查询");
titleBtnData.add("下发SN");
titleBtnData.add("数据采集5秒");
@@ -1104,6 +1104,15 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
}
switch (position) {
case 0:
// MessagePad.Line.Builder line = MessagePad.Line.newBuilder();
// line.setLineId(10);
// line.setTrajUrl("我是TrajUrl");
// line.setTrajMd5("我是TrajMd5");
// line.setStopUrl("我是StopUrl");
// line.setStopMd5("我是StopMd5");
// line.setTimestamp(60);
// line.setVehicleModel("我是VehicleModel");
// AdasManager.getInstance().sendTrajectoryDownloadReq(line.build());
if (autoPilotModeDialog == null) {
autoPilotModeDialog = new AutoPilotModeDialog(this);
}

View File

@@ -19,6 +19,7 @@ enum MessageType
MsgTypePerceptionTrafficLight = 0x10006; //感知红绿灯
MsgTypePredictionObstacleTrajectory = 0x10007; //他车轨迹预测
MsgTypePointCloud = 0x10008; //点云透传
MsgTypePlanningObjects = 0x10009; //planning障碍物
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
MsgTypeBasicInfoResp = 0x10101; //自动驾驶设备基础信息应答
@@ -36,6 +37,7 @@ enum MessageType
MsgTypeWarn = 0x1010d; //预警数据
MsgTypeArrivalNotification = 0x1010e; //到站提醒
MsgTypeSystemCmdReq = 0x1010f; //系统命令请求, 比如系统重启,启用新镜像
MsgTypeTrajectoryDownloadReq = 0x10110; //轨迹下载请求
}
message Header
@@ -83,7 +85,7 @@ message TrackedObject
double heading = 10; //车辆朝向
double speed = 11; //车辆速度
uint32 drawLevel = 12; //危险等级 1 绿,2 黄,3 红
double driverTime = 13; //驱动感知时间
double driverTime = 13; //驱动感知时间, abandoned
}
message TrackedObjects
@@ -112,13 +114,13 @@ message GnssInfo
// message definition for MessageType: MsgTypeAutopilotState
message AutopilotState
{
uint32 state = 1; //0: 不可用, 1:ready, 2:自动驾驶中
uint32 state = 1; //0: 不可用(abandoned), 1:ready, 2:自动驾驶中
uint32 camera = 2; //camera节点状态 1:开启0:关闭
uint32 radar = 3; //雷达节点状态 1:开启0:关闭
uint32 rtk = 4; //RTK节点状态 1:开启0:关闭
uint32 autopilotMode = 5; //自动驾驶状态 0: 非自动驾驶1: 自动驾驶
double speed = 6; //惯导车速 m/s
string reason = 7; //不可用原因
string reason = 7; //不可用原因(abandoned)
}
// message definition for MessageType: MsgTypeReportMessage
@@ -131,7 +133,36 @@ message AutopilotState
// refer to prediction.proto
// message definition for MessageType: MsgTypePointCloud
// refer to point_cloud.proto
// refer to mogo_point_cloud.proto
// message definition for MessageType: MsgTypePlanningObjects
message PlanningObject
{
uint32 uuid = 1;
uint32 type = 2; //影响自车决策的类型, 和感知的障碍物类型不是一回事
}
message PlanningObjects
{
repeated PlanningObject objs = 1;
}
// message definition for MsgTypeTrajectoryDownloadReq
message Line
{
uint64 lineId = 1; //路线id默认-1
string trajUrl = 2; //轨迹文件下载的cos url默认“”
string trajMd5 = 3; //轨迹文件md5默认“”
string stopUrl = 4; //打点文件下载的cos url默认“”
string stopMd5 = 5; //轨迹文件md5默认“”
uint64 timestamp = 6; //上传轨迹完成时间戳(ms)用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
string vehicleModel = 7; //车型号如红旗H9默认“”暂不加入校验逻辑、用于人工排查问题
}
message TrajectoryDownloadReq
{
Line line = 1; //路线
}
// message definition for MessageType: MsgTypeBasicInfoReq
message BasicInfoReq
@@ -162,9 +193,10 @@ message RouteInfo{
repeated Location wayPoints = 5;
double speedLimit = 6; //单位: km/h
uint32 vehicleType = 7;
bool isSpeakVoice = 8;
bool isSpeakVoice = 8; //abandoned
uint32 routeID = 9;
string routeName = 10;
Line line = 11; //路线信息
}
message SetAutopilotModeReq
@@ -280,7 +312,7 @@ message Warn
// message definition for MsgTypeArrivalNotification
message ArrivalNotification
{
uint32 carType = 1; //deserted
uint32 carType = 1; //abandoned
Location endLocation = 2;
}
@@ -292,7 +324,7 @@ enum SystemCmdType {
message SystemCmdReq
{
SystemCmdType cmdType = 1;
SystemCmdType cmdType = 1; //
}
@@ -301,3 +333,6 @@ message SystemCmdReq

View File

@@ -16,7 +16,6 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.gson.Gson;
import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.ByteUtil;
@@ -40,8 +39,6 @@ import com.zhidao.support.adas.high.thread.DispatchHandler;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
import org.json.JSONObject;
import java.util.HashSet;
import java.util.Timer;
import java.util.TimerTask;
@@ -851,5 +848,19 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
MessagePad.SystemCmdReq req = builder.build();
return sendWsMessage(MessageType.TYPE_SEND_SYSTEM_CMD_REQ.typeCode, req.toByteArray());
}
/**
* 发送 轨迹下载请求
*
* @param line 线路相关参数详情见PB message_pad.proto -> Line
* @return boolean
*/
@Override
public boolean sendTrajectoryDownloadReq(MessagePad.Line line) {
MessagePad.TrajectoryDownloadReq.Builder builder = MessagePad.TrajectoryDownloadReq.newBuilder();
builder.setLine(line);
MessagePad.TrajectoryDownloadReq req = builder.build();
return sendWsMessage(MessageType.TYPE_SEND_TRAJECTORY_DOWNLOAD_REQ.typeCode, req.toByteArray());
}
}

View File

@@ -395,6 +395,17 @@ public class AdasManager implements IAdasNetCommApi {
return mChannel != null && mChannel.sendSystemCmdReq(type);
}
/**
* 发送 轨迹下载请求
*
* @param line 线路相关参数详情见PB message_pad.proto -> Line
* @return boolean
*/
@Override
public boolean sendTrajectoryDownloadReq(MessagePad.Line line) {
return mChannel != null && mChannel.sendTrajectoryDownloadReq(line);
}
/**
* 获取工控机固定IP列表
*

View File

@@ -180,6 +180,14 @@ public interface IAdasNetCommApi {
*/
boolean sendSystemCmdReq(@NonNull MessagePad.SystemCmdType type);
/**
* 发送 轨迹下载请求
*
* @param line 线路相关参数详情见PB message_pad.proto -> Line
* @return boolean
*/
boolean sendTrajectoryDownloadReq(MessagePad.Line line);
// TODO 需求暂停 待讨论
// boolean getRoutes();

View File

@@ -38,7 +38,8 @@ public enum MessageType {
@Deprecated
TYPE_RECEIVE_WARN(MessagePad.MessageType.MsgTypeWarn, "预警数据"),
TYPE_RECEIVE_ARRIVAL_NOTIFICATION(MessagePad.MessageType.MsgTypeArrivalNotification, "到站提醒"),
TYPE_SEND_SYSTEM_CMD_REQ(MessagePad.MessageType.MsgTypeSystemCmdReq, "系统命令请求, 比如系统重启,启用新镜像");
TYPE_SEND_SYSTEM_CMD_REQ(MessagePad.MessageType.MsgTypeSystemCmdReq, "系统命令请求, 比如系统重启,启用新镜像"),
TYPE_SEND_TRAJECTORY_DOWNLOAD_REQ(MessagePad.MessageType.MsgTypeTrajectoryDownloadReq, "轨迹下载请求");
/**
* 消息action code