[add]增加感知透传障碍物接口,获取基础配置信息修改为延时获取
This commit is contained in:
@@ -3,7 +3,7 @@ package mogo.telematics.pad;
|
||||
|
||||
enum ProtocolVersion{
|
||||
Defaultver = 0;
|
||||
CurrentVersion = 2; //每次修改proto文件增加1
|
||||
CurrentVersion = 3; //每次修改proto文件增加1
|
||||
}
|
||||
|
||||
enum MessageType
|
||||
@@ -18,6 +18,7 @@ enum MessageType
|
||||
MsgTypeReportMessage = 0x10005; //监控事件报告
|
||||
MsgTypePerceptionTrafficLight = 0x10006; //感知红绿灯
|
||||
MsgTypePredictionObstacleTrajectory = 0x10007; //他车轨迹预测
|
||||
MsgTypePerceptionObstacles = 0x10008; //透传的融合障碍物
|
||||
|
||||
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
|
||||
MsgTypeBasicInfoResp = 0x10101; //自动驾驶设备基础信息应答
|
||||
@@ -129,6 +130,9 @@ message AutopilotState
|
||||
// message definition for MessageType: MsgTypePredictionObstacleTrajectory
|
||||
// refer to prediction.proto
|
||||
|
||||
// message definition for MessageType: MsgTypePerceptionObstacles
|
||||
// refer to TrackedObjects in object.proto
|
||||
|
||||
// message definition for MessageType: MsgTypeBasicInfoReq
|
||||
message BasicInfoReq
|
||||
{
|
||||
|
||||
126
libraries/mogo-adas-data/src/main/proto/object.proto
Normal file
126
libraries/mogo-adas-data/src/main/proto/object.proto
Normal file
@@ -0,0 +1,126 @@
|
||||
syntax = "proto2";
|
||||
package perception;
|
||||
|
||||
import "header.proto";
|
||||
import "geometry.proto";
|
||||
|
||||
enum ObjectType {
|
||||
TYPE_UNKNOWN = 0;
|
||||
TYPE_PEDESTRIAN = 3;
|
||||
TYPE_BICYCLE = 4;
|
||||
TYPE_MOTOR = 5;
|
||||
TYPE_RIDER = 6;
|
||||
TYPE_CAR = 7;
|
||||
TYPE_TRUCK = 8;
|
||||
TYPE_BUS = 9;
|
||||
TYPE_TRAIN = 10;
|
||||
TYPE_SIGN = 20;
|
||||
TYPE_LIGHT = 30;
|
||||
TYPE_RED = 31;
|
||||
TYPE_GREEN = 32;
|
||||
TYPE_YELLOW = 33;
|
||||
TYPE_BLACK = 34;
|
||||
TYPE_TRIANGLEROADBLOCK = 35;
|
||||
TYPE_WARNINGTRIANGLE = 36;
|
||||
TYPE_UNKNOWN_SMALL = 91;
|
||||
TYPE_UNKNOWN_BIG = 92;
|
||||
TYPE_UNKNOWN_STATIC = 93;
|
||||
TYPE_UNKNOWN_DYNAMIC = 94;
|
||||
}
|
||||
|
||||
message BBox2D {
|
||||
optional double xmin = 1 [default = nan]; // in pixel.
|
||||
optional double ymin = 2 [default = nan];
|
||||
optional double xmax = 3 [default = nan];
|
||||
optional double ymax = 4 [default = nan];
|
||||
}
|
||||
|
||||
message CameraObjectSupplement {
|
||||
optional bool on_use = 1 [default = false];
|
||||
optional BBox2D box = 2;
|
||||
optional int32 cols = 3;
|
||||
optional int32 rows = 4;
|
||||
}
|
||||
|
||||
message LidarObjectSupplement {
|
||||
optional bool on_use = 1 [default = false];
|
||||
// Format: [x0, y0, z0, x1, y1, z1...]
|
||||
repeated double cloud = 2 [packed = true];
|
||||
}
|
||||
|
||||
message RadarObjectSupplement {
|
||||
optional bool on_use = 1 [default = false];
|
||||
optional float x = 2;
|
||||
optional float y = 3;
|
||||
optional float relative_vel_x = 4;
|
||||
optional float relative_vel_y = 5;
|
||||
optional float absolute_vel_x = 6;
|
||||
optional float absolute_vel_y = 7;
|
||||
}
|
||||
|
||||
message Object {
|
||||
optional uint32 id = 1; // obj id, after tracked
|
||||
optional string sensor_name = 2;
|
||||
|
||||
optional ObjectType type = 3; // obj category
|
||||
|
||||
optional double time_stamp = 4; // sensing time
|
||||
optional float confidence = 5; // probability
|
||||
optional int32 status = 6; // reserved
|
||||
|
||||
optional float x_distance = 7; // longitudinal distance
|
||||
optional float y_distance = 8; // lateral distance
|
||||
optional float angle = 9; // obj angle relative to host vehicle
|
||||
|
||||
optional geometry.Point center = 10; // x,y,z in meter
|
||||
optional geometry.Point centroid = 11;
|
||||
optional geometry.Vector3 size = 12; // length width height(in meter)
|
||||
repeated geometry.Point contour = 13; // contour points
|
||||
|
||||
optional geometry.Vector3 velocity = 14; // sharing with visual/tracked obj
|
||||
optional geometry.Vector3 acceleration = 15;
|
||||
|
||||
optional double tracking_time = 16;
|
||||
|
||||
// camera supplement
|
||||
optional CameraObjectSupplement camera_supplement = 17;
|
||||
// lidar supplement
|
||||
optional LidarObjectSupplement lidar_supplement = 18;
|
||||
// radar supplement
|
||||
optional RadarObjectSupplement radar_supplement = 19;
|
||||
//lidar polygon
|
||||
repeated geometry.Point polygon = 20; // polygon points
|
||||
}
|
||||
|
||||
message TrackedObject {
|
||||
optional Object obj = 1;
|
||||
|
||||
optional float yaw = 2; //box orientation angle from x axis, counter clockwise(in rad),range 0 to 2*pi
|
||||
optional float yaw_rate = 3; //in rad/s
|
||||
optional geometry.Vector3 velocity = 4; // absolute velocity, in m/s, vx, vy, vz
|
||||
repeated geometry.Trace trace = 5; // historical positions
|
||||
repeated geometry.Trace prediction = 6; // predicted global position in future stamp
|
||||
|
||||
optional float absolute_longitude_v = 7; // along lane speed, m/s
|
||||
optional float absolute_longitude_a = 8; // in m/s2, longitudinal acc
|
||||
optional float absolute_lateral_v = 9; // vertical to lane speed, left positive, m/s
|
||||
|
||||
optional double longitude = 10; // longitude , in degrees
|
||||
optional double latitude = 11; // latitude , in degrees
|
||||
optional double alt = 12; // height above mean sea level in meters
|
||||
|
||||
optional double longitude_p = 13; // position in East , in meters
|
||||
optional double latitude_p = 14; // position in North , in meters
|
||||
|
||||
optional double speed = 15; //absolute speed
|
||||
|
||||
//float x_speed // longitudinal speed relative to host vehicle, m/s
|
||||
//float y_speed // lateral speed relative to host vehicle, m/s
|
||||
}
|
||||
|
||||
message TrackedObjects {
|
||||
optional common.Header header = 1;
|
||||
optional string sensor_name = 2;
|
||||
repeated TrackedObject objs = 3;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ import com.zhjt.service.chain.TracingConstants;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
@@ -358,7 +360,13 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
if (adasConnectStatusListener != null) {
|
||||
adasConnectStatusListener.onConnectionIPCStatus(ipcConnectionStatus.get(), "已连接");
|
||||
}
|
||||
sendCarConfigReq();
|
||||
Timer timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
sendCarConfigReq();
|
||||
}
|
||||
}, 1600L); // 延迟1秒,执行一次task
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.zhidao.support.adas.high.common.ProtocolStatus;
|
||||
import chassis.VehicleStateOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import perception.ObjectOuterClass;
|
||||
import perception.TrafficLightOuterClass;
|
||||
import prediction.Prediction;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
@@ -88,6 +89,15 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onPredictionObstacleTrajectory(MessagePad.Header header, Prediction.mPredictionObjects predictionObjects);
|
||||
|
||||
/**
|
||||
* 透传的融合障碍物 他车数据
|
||||
* 当 MessagePad.CarConfigResp.getProtocolVersionValue() >=3 时此回调有数据,老接口“MessagePad.TrackedObjects”不会回调任何数据
|
||||
*
|
||||
* @param header 头
|
||||
* @param trackedObjects 数据
|
||||
*/
|
||||
void onTrackedObjects(MessagePad.Header header, ObjectOuterClass.TrackedObjects trackedObjects);
|
||||
|
||||
/**
|
||||
* 自动驾驶设备基础信息请求
|
||||
*
|
||||
|
||||
@@ -20,6 +20,7 @@ public enum MessageType {
|
||||
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_PERCEPTION_OBSTACLES(MessagePad.MessageType.MsgTypePerceptionObstacles, "透传的融合障碍物"),
|
||||
|
||||
TYPE_RECEIVE_BASIC_INFO_REQ(MessagePad.MessageType.MsgTypeBasicInfoReq, "自动驾驶设备基础信息请求"),
|
||||
TYPE_SEND_BASIC_INFO_RESP(MessagePad.MessageType.MsgTypeBasicInfoResp, "自动驾驶设备基础信息应答"),
|
||||
|
||||
@@ -18,7 +18,8 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg autopilotStateMessage;//自动驾驶状态
|
||||
private IMsg reportMessage;//监控事件报告
|
||||
private IMsg perceptionTrafficLightMessage;//感知红绿灯
|
||||
private IMsg predictionObstacleTrajectory;//他车轨迹预测
|
||||
private IMsg predictionObstacleTrajectoryMessage;//他车轨迹预测
|
||||
private IMsg perceptionObstaclesMessage;//透传的融合障碍物
|
||||
|
||||
private IMsg basicInfoReqMessage;//自动驾驶设备基础信息请求
|
||||
private IMsg carConfigRespMessage;//车机基础信息应答
|
||||
@@ -94,10 +95,16 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
return perceptionTrafficLightMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY.typeCode) {
|
||||
//他车轨迹预测
|
||||
if (predictionObstacleTrajectory == null) {
|
||||
predictionObstacleTrajectory = new PredictionObstacleTrajectoryMessage();
|
||||
if (predictionObstacleTrajectoryMessage == null) {
|
||||
predictionObstacleTrajectoryMessage = new PredictionObstacleTrajectoryMessage();
|
||||
}
|
||||
return predictionObstacleTrajectory;
|
||||
return predictionObstacleTrajectoryMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_PERCEPTION_OBSTACLES.typeCode) {
|
||||
//他车轨迹预测
|
||||
if (perceptionObstaclesMessage == null) {
|
||||
perceptionObstaclesMessage = new PerceptionObstaclesMessage();
|
||||
}
|
||||
return perceptionObstaclesMessage;
|
||||
} 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 perception.ObjectOuterClass;
|
||||
|
||||
/**
|
||||
* 透传的融合障碍物 ProtocolVersion >=3 版本生效
|
||||
*/
|
||||
public class PerceptionObstaclesMessage 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 {
|
||||
ObjectOuterClass.TrackedObjects trackedObjects = ObjectOuterClass.TrackedObjects.parseFrom(msg);
|
||||
if (adasListener != null) {
|
||||
adasListener.onTrackedObjects(header, trackedObjects);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user