[add]更新PB,添加他车轨迹预测接口
This commit is contained in:
84
libraries/mogo-adas-data/src/main/proto/geometry.proto
Normal file
84
libraries/mogo-adas-data/src/main/proto/geometry.proto
Normal file
@@ -0,0 +1,84 @@
|
||||
syntax = "proto2";
|
||||
package geometry;
|
||||
|
||||
message Vector3 {
|
||||
optional double x = 1;
|
||||
optional double y = 2;
|
||||
optional double z = 3;
|
||||
}
|
||||
|
||||
message Vector3f {
|
||||
optional float x = 1;
|
||||
optional float y = 2;
|
||||
optional float z = 3;
|
||||
}
|
||||
|
||||
message Point2D {
|
||||
optional double x = 1 [default = nan];
|
||||
optional double y = 2 [default = nan];
|
||||
}
|
||||
|
||||
message Point3D {
|
||||
optional double x = 1 [default = nan];
|
||||
optional double y = 2 [default = nan];
|
||||
optional double z = 3 [default = nan];
|
||||
}
|
||||
|
||||
message Trace {
|
||||
optional double timestamp = 1;
|
||||
optional Point3D position = 2;
|
||||
optional Point3D velocity = 3;
|
||||
optional Point3D acceleration = 4;
|
||||
optional Point3D heading = 5;
|
||||
}
|
||||
|
||||
message PointLLH {
|
||||
// Longitude in degrees, ranging from -180 to 180.
|
||||
optional double lon = 1 [default = nan];
|
||||
// Latitude in degrees, ranging from -90 to 90.
|
||||
optional double lat = 2 [default = nan];
|
||||
// WGS-84 ellipsoid height in meters.
|
||||
optional double height = 3 [default = 0.0];
|
||||
}
|
||||
|
||||
message Point {
|
||||
optional double x = 1;
|
||||
optional double y = 2;
|
||||
optional double z = 3;
|
||||
}
|
||||
|
||||
message Quaternion {
|
||||
optional double x = 1 [default = nan];
|
||||
optional double y = 2 [default = nan];
|
||||
optional double z = 3 [default = nan];;
|
||||
optional double w = 4 [default = nan];
|
||||
}
|
||||
|
||||
message Polygon {
|
||||
repeated Point points = 1;
|
||||
}
|
||||
|
||||
message Transform {
|
||||
optional Vector3 translation = 1;
|
||||
optional Quaternion rotation = 2;
|
||||
}
|
||||
|
||||
//pose in free space, composed of position and orientation
|
||||
message Pose {
|
||||
optional Point position = 1;
|
||||
optional Quaternion orientation = 2;
|
||||
}
|
||||
|
||||
//acceleration in free space broken into its linear and angular parts
|
||||
message Accel {
|
||||
optional Vector3 linear = 1;
|
||||
optional Vector3 angular = 2;
|
||||
}
|
||||
|
||||
//velocity in free space broken into its linear and angular parts
|
||||
message Twist {
|
||||
optional Vector3 linear = 1;
|
||||
optional Vector3 angular = 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package mogo.telematics.pad;
|
||||
|
||||
enum ProtocolVersion{
|
||||
Defaultver = 0;
|
||||
CurrentVersion = 1; //每次修改proto文件增加1
|
||||
CurrentVersion = 2; //每次修改proto文件增加1
|
||||
}
|
||||
|
||||
enum MessageType
|
||||
@@ -17,6 +17,7 @@ enum MessageType
|
||||
MsgTypeAutopilotState = 0x10004; //自动驾驶状态
|
||||
MsgTypeReportMessage = 0x10005; //监控事件报告
|
||||
MsgTypePerceptionTrafficLight = 0x10006; //感知红绿灯
|
||||
MsgTypePredictionObstacleTrajectory = 0x10007; //他车轨迹预测
|
||||
|
||||
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
|
||||
MsgTypeBasicInfoResp = 0x10101; //自动驾驶设备基础信息应答
|
||||
@@ -124,6 +125,9 @@ message AutopilotState
|
||||
// message definition for MessageType: MsgTypePerceptionTrafficLight
|
||||
// refer to traffic_light.proto
|
||||
|
||||
// message definition for MessageType: MsgTypePredictionObstacleTrajectory
|
||||
// refer to prediction.proto
|
||||
|
||||
// message definition for MessageType: MsgTypeBasicInfoReq
|
||||
message BasicInfoReq
|
||||
{
|
||||
|
||||
33
libraries/mogo-adas-data/src/main/proto/prediction.proto
Normal file
33
libraries/mogo-adas-data/src/main/proto/prediction.proto
Normal file
@@ -0,0 +1,33 @@
|
||||
syntax = "proto2";
|
||||
|
||||
package prediction;
|
||||
|
||||
// common
|
||||
import "header.proto";
|
||||
import "geometry.proto";
|
||||
|
||||
|
||||
// estimated obstacle intent
|
||||
|
||||
message mPredictionObject {
|
||||
optional int64 m_nid =1; //target id
|
||||
optional int32 m_nquality =2; //target tracking life quality
|
||||
optional int32 classtype =3; //target classtype
|
||||
optional int32 m_preconfidence=4; //target predciton confidence
|
||||
|
||||
repeated geometry.Point prediction_trajectory = 5; //target prediction trajectory :vector : meter
|
||||
repeated geometry.Point prediction_pose = 6; //targe prediciton pose vector angle:°
|
||||
optional geometry.Vector3 objsize = 7; //length width height :meter
|
||||
|
||||
}
|
||||
|
||||
message mPredictionObjects {
|
||||
optional common.Header header = 1;
|
||||
optional int32 m_nnum0 =2; // all target number
|
||||
optional int64 allcyclenum =3;//process cycle number
|
||||
optional double m_ftime=4; //time stamp
|
||||
optional double fdeltat=5; // deltatime prediciton time stamp default:0.1s
|
||||
repeated mPredictionObject objs=6; //obj capcity
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import chassis.VehicleStateOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import perception.TrafficLightOuterClass;
|
||||
import prediction.Prediction;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
/**
|
||||
@@ -80,6 +81,14 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onPerceptionTrafficLight(MessagePad.Header header, TrafficLightOuterClass.TrafficLights trafficLights);
|
||||
|
||||
/**
|
||||
* 他车轨迹预测
|
||||
*
|
||||
* @param header 头
|
||||
* @param predictionObjects 他车轨迹预测数据
|
||||
*/
|
||||
void onPredictionObstacleTrajectory(MessagePad.Header header, Prediction.mPredictionObjects predictionObjects);
|
||||
|
||||
/**
|
||||
* 自动驾驶设备基础信息请求
|
||||
*
|
||||
|
||||
@@ -19,6 +19,7 @@ public enum MessageType {
|
||||
TYPE_RECEIVE_AUTOPILOT_STATE(MessagePad.MessageType.MsgTypeAutopilotState, "自动驾驶状态"),
|
||||
TYPE_RECEIVE_REPORT_MESSAGE(MessagePad.MessageType.MsgTypeReportMessage, "监控事件报告"),
|
||||
TYPE_RECEIVE_PERCEPTION_TRAFFIC_LIGHT(MessagePad.MessageType.MsgTypePerceptionTrafficLight, "感知红绿灯"),
|
||||
TYPE_RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY(MessagePad.MessageType.MsgTypePredictionObstacleTrajectory, "他车轨迹预测"),
|
||||
|
||||
TYPE_RECEIVE_BASIC_INFO_REQ(MessagePad.MessageType.MsgTypeBasicInfoReq, "自动驾驶设备基础信息请求"),
|
||||
TYPE_SEND_BASIC_INFO_RESP(MessagePad.MessageType.MsgTypeBasicInfoResp, "自动驾驶设备基础信息应答"),
|
||||
|
||||
@@ -18,6 +18,7 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg autopilotStateMessage;//自动驾驶状态
|
||||
private IMsg reportMessage;//监控事件报告
|
||||
private IMsg perceptionTrafficLightMessage;//感知红绿灯
|
||||
private IMsg predictionObstacleTrajectory;//他车轨迹预测
|
||||
|
||||
private IMsg basicInfoReqMessage;//自动驾驶设备基础信息请求
|
||||
private IMsg carConfigRespMessage;//车机基础信息应答
|
||||
@@ -91,6 +92,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
perceptionTrafficLightMessage = new PerceptionTrafficLightMessage();
|
||||
}
|
||||
return perceptionTrafficLightMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY.typeCode) {
|
||||
//他车轨迹预测
|
||||
if (predictionObstacleTrajectory == null) {
|
||||
predictionObstacleTrajectory = new PredictionObstacleTrajectoryMessage();
|
||||
}
|
||||
return predictionObstacleTrajectory;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_BASIC_INFO_REQ.typeCode) {
|
||||
//自动驾驶设备基础信息请求
|
||||
if (basicInfoReqMessage == null) {
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import prediction.Prediction;
|
||||
|
||||
/**
|
||||
* 他车轨迹预测
|
||||
*/
|
||||
public class PredictionObstacleTrajectoryMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@Override
|
||||
public void handlerMsg(Gson gson, OnAdasListener adasListener, String msg) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerMsg(MessagePad.Header header, byte[] msg, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
Prediction.mPredictionObjects objects = Prediction.mPredictionObjects.parseFrom(msg);
|
||||
if (adasListener != null) {
|
||||
adasListener.onPredictionObstacleTrajectory(header, objects);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user