[add]增加感知透传障碍物接口,获取基础配置信息修改为延时获取
This commit is contained in:
@@ -9,6 +9,7 @@ import com.zhidao.adas.client.bean.ErrorData;
|
||||
import com.zhidao.adas.client.bean.GlobalPathResp;
|
||||
import com.zhidao.adas.client.bean.GnssInfo;
|
||||
import com.zhidao.adas.client.bean.MogoReportMessage;
|
||||
import com.zhidao.adas.client.bean.PerceptionObstacles;
|
||||
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
|
||||
import com.zhidao.adas.client.bean.PredictionObstacleTrajectory;
|
||||
import com.zhidao.adas.client.bean.RecordPanel;
|
||||
@@ -101,6 +102,7 @@ public class DataDistribution {
|
||||
public final List<String> listMogoReportMessage = new ArrayList<>();
|
||||
public final List<String> listPerceptionTrafficLight = new ArrayList<>();
|
||||
public final List<String> listPredictionObstacleTrajectory = new ArrayList<>();
|
||||
public final List<String> listPerceptionObstacles = new ArrayList<>();
|
||||
public final List<String> listBasicInfoReq = new ArrayList<>();
|
||||
public final List<String> listRecordPanel = new ArrayList<>();
|
||||
public final List<String> listGlobalPathResp = new ArrayList<>();
|
||||
@@ -222,6 +224,19 @@ public class DataDistribution {
|
||||
// for (OnAdasClientListener listener : listeners) {
|
||||
// listener.onRefresh();
|
||||
// }
|
||||
// }
|
||||
} else if (data instanceof PerceptionObstacles) {
|
||||
listPerceptionObstacles.add(0, time + str);
|
||||
if (listPerceptionObstacles.size() > LIST_SIZE) {
|
||||
listPerceptionObstacles.remove(listPerceptionObstacles.size() - 1);
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onRefresh();
|
||||
}
|
||||
// if (!listeners.isEmpty()) {
|
||||
// for (OnAdasClientListener listener : listeners) {
|
||||
// listener.onRefresh();
|
||||
// }
|
||||
// }
|
||||
} else if (data instanceof BasicInfoReq) {
|
||||
listBasicInfoReq.add(0, time + str);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.zhidao.adas.client.bean;
|
||||
|
||||
import com.google.protobuf.TextFormat;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import perception.ObjectOuterClass;
|
||||
import prediction.Prediction;
|
||||
|
||||
public class PerceptionObstacles extends BaseInfo {
|
||||
public final ObjectOuterClass.TrackedObjects bean;
|
||||
|
||||
public PerceptionObstacles(MessagePad.Header header, ObjectOuterClass.TrackedObjects bean) {
|
||||
super("接收", bean.getSerializedSize(), header);
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -149,6 +149,9 @@ public class InfoFragment extends BaseFragment {
|
||||
case Constants.TITLE.RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY:
|
||||
adapter.setData(DataDistribution.getInstance().listPredictionObstacleTrajectory);
|
||||
break;
|
||||
case Constants.TITLE.RECEIVE_PERCEPTION_OBSTACLES:
|
||||
adapter.setData(DataDistribution.getInstance().listPerceptionObstacles);
|
||||
break;
|
||||
case Constants.TITLE.RECEIVE_ERROR:
|
||||
adapter.setData(DataDistribution.getInstance().listErrorData);
|
||||
break;
|
||||
|
||||
@@ -56,6 +56,7 @@ import com.zhidao.adas.client.bean.GnssInfo;
|
||||
import com.zhidao.adas.client.bean.IPCConnectState;
|
||||
import com.zhidao.adas.client.bean.MogoReportMessage;
|
||||
import com.zhidao.adas.client.bean.MySSHResult;
|
||||
import com.zhidao.adas.client.bean.PerceptionObstacles;
|
||||
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
|
||||
import com.zhidao.adas.client.bean.PredictionObstacleTrajectory;
|
||||
import com.zhidao.adas.client.bean.RecordPanel;
|
||||
@@ -91,6 +92,7 @@ import chassis.VehicleStateOuterClass;
|
||||
import io.netty.channel.Channel;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import perception.ObjectOuterClass;
|
||||
import perception.TrafficLightOuterClass;
|
||||
import prediction.Prediction;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
@@ -143,6 +145,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
private InfoFragment reportMessageFragment;
|
||||
private InfoFragment perceptionTrafficLightFragment;
|
||||
private InfoFragment predictionObstacleTrajectoryFragment;
|
||||
private InfoFragment perceptionObstaclesFragment;
|
||||
private VersionFragment versionFragment;
|
||||
private FragmentManager manager;
|
||||
private FragmentTransaction transaction;
|
||||
@@ -449,6 +452,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_GNSS_INFO);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_TRAJECTORY);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_TRACKED_OBJECTS);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_PERCEPTION_OBSTACLES);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_VEHICLE_STATE);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_AUTOPILOT_STATE);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_REPORT_MESSAGE);
|
||||
@@ -494,6 +498,22 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
btnAdapter.setOnItemClickListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 感知接口 提示
|
||||
*
|
||||
* @param isSeriaNet 是否是透传接口
|
||||
*/
|
||||
private void hintTrackedObjects(boolean isSeriaNet) {
|
||||
int value = 0;
|
||||
MessagePad.CarConfigResp carConfigResp = AdasManager.getInstance().getCarConfig();
|
||||
if (carConfigResp != null) {
|
||||
value = carConfigResp.getProtocolVersionValue();
|
||||
}
|
||||
if (isSeriaNet && value < 3 && value > 0 || value > 2) {
|
||||
showToastCenter("当前工控机协议版本:" + value + ",此接口不受支持");
|
||||
}
|
||||
}
|
||||
|
||||
private void initFragmentRecyclerView() {
|
||||
//创建默认的线性LayoutManager 横向的GridLayoutManager
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
|
||||
@@ -528,6 +548,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
}
|
||||
break;
|
||||
case Constants.TITLE.RECEIVE_TRACKED_OBJECTS:
|
||||
hintTrackedObjects(false);
|
||||
if (viewFragment == null)
|
||||
viewFragment = new InfoFragment(data);
|
||||
if (!viewFragment.isVisible()) {
|
||||
@@ -616,6 +637,15 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
transaction.commit();
|
||||
}
|
||||
break;
|
||||
case Constants.TITLE.RECEIVE_PERCEPTION_OBSTACLES:
|
||||
hintTrackedObjects(true);
|
||||
if (perceptionObstaclesFragment == null)
|
||||
perceptionObstaclesFragment = new InfoFragment(data);
|
||||
if (!perceptionObstaclesFragment.isVisible()) {
|
||||
transaction.replace(R.id.fl_info, perceptionObstaclesFragment);
|
||||
transaction.commit();
|
||||
}
|
||||
break;
|
||||
case Constants.TITLE.RECEIVE_CAR_CONFIG_RESP:
|
||||
AdasManager.getInstance().sendCarConfigReq();
|
||||
if (versionFragment == null)
|
||||
@@ -709,7 +739,6 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onError(ProtocolStatus status, byte[] bytes) {
|
||||
ErrorData base = new ErrorData(status, bytes);
|
||||
@@ -764,6 +793,12 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrackedObjects(MessagePad.Header header, ObjectOuterClass.TrackedObjects trackedObjects) {
|
||||
PerceptionObstacles base = new PerceptionObstacles(header, trackedObjects);
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBasicInfoReq(MessagePad.Header header, MessagePad.BasicInfoReq basicInfoReq) {
|
||||
BasicInfoReq info = new BasicInfoReq(header, basicInfoReq);
|
||||
|
||||
@@ -151,6 +151,7 @@ public class Constants {
|
||||
String RECEIVE_REPORT_MESSAGE = "监控事件";
|
||||
String RECEIVE_PERCEPTION_TRAFFIC_LIGHT = "感知红绿灯";
|
||||
String RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY = "他车轨迹预测";
|
||||
String RECEIVE_PERCEPTION_OBSTACLES = "透传的融合障碍物";
|
||||
|
||||
// String RECEIVE_BASIC_INFO_REQ = "自动驾驶设备基础信息请求";
|
||||
String RECEIVE_CAR_CONFIG_RESP = "信息与配置";
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo_msg.MogoReportMsg
|
||||
import perception.ObjectOuterClass
|
||||
import perception.TrafficLightOuterClass
|
||||
import prediction.Prediction
|
||||
import record_cache.RecordPanelOuterClass
|
||||
@@ -97,6 +98,19 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 透传的融合障碍物 他车数据
|
||||
* 当 MessagePad.CarConfigResp.getProtocolVersionValue() >=3 时此回调有数据,老接口“MessagePad.TrackedObjects”不会回调任何数据
|
||||
*
|
||||
* @param header 头
|
||||
* @param trackedObjects 数据
|
||||
*/
|
||||
override fun onTrackedObjects(
|
||||
header: MessagePad.Header?,
|
||||
trackedObjects: ObjectOuterClass.TrackedObjects?
|
||||
) {
|
||||
}
|
||||
|
||||
//自车定位信息
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
|
||||
@@ -175,7 +189,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
if (autopilotStatusInfo.connectIP == null) {
|
||||
autopilotStatusInfo.connectIP = AdasManager.getInstance().ipcConnectedIp
|
||||
}
|
||||
if(autopilotStatusInfo.connectPort == null){
|
||||
if (autopilotStatusInfo.connectPort == null) {
|
||||
autopilotStatusInfo.connectPort = AdasManager.getInstance().ipcConnectedPort
|
||||
}
|
||||
if (autopilotStatusInfo.dockVersion == null) {
|
||||
|
||||
@@ -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