[obu]鹰眼自用OBU PB编写 以及参照原始PB差异化文档编写
This commit is contained in:
@@ -44,6 +44,8 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
|
||||
import com.google.protobuf.TextFormat;
|
||||
import com.mogo.support.obu.ObuPenetrate;
|
||||
import com.mogo.support.obu.ObuScene;
|
||||
import com.mogo.telematic.MogoProtocolMsg;
|
||||
import com.mogo.telematic.NSDNettyManager;
|
||||
import com.mogo.telematic.client.listener.NettyClientListener;
|
||||
@@ -185,6 +187,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
private boolean isAutopilotAbility = true;
|
||||
private String autopilotAbilityReason;
|
||||
private List<SpecialVehicleBean> specialVehicleBeanList;//特种车辆
|
||||
private long errorDataUpdateTime = 0;
|
||||
// @Override
|
||||
// protected void onStart() {
|
||||
// super.onStart();
|
||||
@@ -1068,6 +1071,26 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onoObuSpatWarning(MessagePad.Header header, ObuScene.SpatWarningData spatWarningData) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onoObuRsiWarning(MessagePad.Header header, ObuScene.RsiWarningData rsiWarningData) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onoObuRsmWarning(MessagePad.Header header, ObuScene.RsmWarningData rsmWarningData) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onoObuRsmWarning(MessagePad.Header header, ObuScene.MapMatchData mapMatchData) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates functionStates) {
|
||||
FSMFunctionStates base = new FSMFunctionStates(header, functionStates, sdf);
|
||||
|
||||
@@ -33,6 +33,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
|
||||
import com.mogo.support.obu.ObuScene;
|
||||
import com.zhidao.adas.magic.R;
|
||||
import com.zhidao.adas.magic.adapter.InfoTitleAdapter;
|
||||
import com.zhidao.adas.magic.base.BaseActivity;
|
||||
@@ -551,6 +552,26 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onoObuSpatWarning(MessagePad.Header header, ObuScene.SpatWarningData spatWarningData) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onoObuRsiWarning(MessagePad.Header header, ObuScene.RsiWarningData rsiWarningData) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onoObuRsmWarning(MessagePad.Header header, ObuScene.RsmWarningData rsmWarningData) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onoObuRsmWarning(MessagePad.Header header, ObuScene.MapMatchData mapMatchData) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates functionStates) {
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerStartAutopilotFailedLis
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.support.obu.ObuScene
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
import com.zhidao.support.adas.high.OnAdasListener
|
||||
import com.zhidao.support.adas.high.bean.AutopilotAbility
|
||||
@@ -535,6 +536,40 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
override fun onObuWarningData(header: MessagePad.Header?, obuWarningData: ObuWarningEvent.ObuWarningData?) {
|
||||
|
||||
}
|
||||
/**
|
||||
* OBU 红绿灯预警信息
|
||||
*
|
||||
* @param header 头
|
||||
* @param spatWarningData 数据
|
||||
*/
|
||||
override fun onoObuSpatWarning(header: MessagePad.Header?, spatWarningData: ObuScene.SpatWarningData?) {
|
||||
}
|
||||
/**
|
||||
* OBU RSI预警信息
|
||||
*
|
||||
* @param header 头
|
||||
* @param rsiWarningData 数据
|
||||
*/
|
||||
override fun onoObuRsiWarning(header: MessagePad.Header?, rsiWarningData: ObuScene.RsiWarningData?) {
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU RSM预警信息
|
||||
*
|
||||
* @param header 头
|
||||
* @param rsmWarningData 数据
|
||||
*/
|
||||
override fun onoObuRsmWarning(header: MessagePad.Header?, rsmWarningData: ObuScene.RsmWarningData?) {
|
||||
}
|
||||
/**
|
||||
* OBU 地图匹配结果
|
||||
*
|
||||
* @param header 头
|
||||
* @param mapMatchData 数据
|
||||
*/
|
||||
override fun onoObuRsmWarning(header: MessagePad.Header?, mapMatchData: ObuScene.MapMatchData?) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 重构后的功能状态
|
||||
*
|
||||
|
||||
@@ -12,4 +12,98 @@
|
||||
~~~
|
||||
1. 选中mogo-adas-data
|
||||
2. 点击Build> Make Moudle 'MoGoEagleEye.libraries.mogo-adas-data'
|
||||
~~~
|
||||
|
||||
# 工控机透传OBU V2I PB转换
|
||||
***鹰眼自用PB文件放在单独文件夹(personal)目的是为了区分工控机PB还是自用PB***
|
||||
|工控机原始PB文件|转换后鹰眼所用PB|
|
||||
|:-|:-|
|
||||
|obu_warning_event.proto|personal/obu_penetrate.proto、personal/obu_scene.proto|
|
||||
|mogo_v2x.proto|personal/obu_base.proto|
|
||||
## PB需要转换精度的字段
|
||||
**MapMatchData**
|
||||
~~~
|
||||
obu_scene.proto/MapMatchData/speedMaxLimit int32 转 double (0.02m/s 转 m/s)
|
||||
obu_scene.proto/MapMatchData/speedMinLimit int32 转 double (0.02m/s 转 m/s)
|
||||
~~~
|
||||
**SpatLight**
|
||||
~~~
|
||||
obu_base.proto/SpatLight/countDown int32 转 double (0.1s 转 s)
|
||||
obu_base.proto/SpatLight/suggestMaxSpeed int32 转 double (0.02m/s 转 m/s)
|
||||
obu_base.proto/SpatLight/suggestMinSpeed int32 转 double (0.02m/s 转 m/s)
|
||||
~~~
|
||||
**Participant**
|
||||
~~~
|
||||
obu_base.proto/Participant/latitude int64 转 double (1e-7° 转 °)
|
||||
obu_base.proto/Participant/longitude int64 转 double (1e-7° 转 °)
|
||||
obu_base.proto/Participant/elevation int64 转 double (0.1m 转 m)
|
||||
obu_base.proto/Participant/speed int64 转 double (0.02m/s 转 m/s)
|
||||
obu_base.proto/Participant/heading int32 转 double (0.0125° 转 °)
|
||||
~~~
|
||||
**AccFourAxes**
|
||||
~~~
|
||||
obu_base.proto/AccFourAxes/accLng int32 转 double (0.01m/s2 转 m/s2)
|
||||
obu_base.proto/AccFourAxes/accLat int32 转 double (0.01m/s2 转 m/s2)
|
||||
obu_base.proto/AccFourAxes/accVert int32 转 double (0.02G 转 G)
|
||||
obu_base.proto/AccFourAxes/accYaw int32 转 double (0.01°/s 转 °/s)
|
||||
~~~
|
||||
**VehicleSize**
|
||||
~~~
|
||||
obu_base.proto/VehicleSize/height int32 转 int32 (5cm 转 cm)
|
||||
~~~
|
||||
**V2xWarning**
|
||||
~~~
|
||||
obu_base.proto/V2xWarning/distance int32 转 double (0.01m 转 m)
|
||||
~~~
|
||||
**RsiWarning**
|
||||
~~~
|
||||
obu_base.proto/RsiWarning/speedMaxLimit int32 转 double (0.02m/s 转 m/s)
|
||||
obu_base.proto/RsiWarning/speedMinLimit int32 转 double (0.02m/s 转 m/s)
|
||||
obu_base.proto/RsiWarning/eventRadius int32 转 double (0.1m 转 m)
|
||||
obu_base.proto/RsiWarning/distance int32 转 double (0.01m 转 m)
|
||||
~~~
|
||||
**VerticalLLV**
|
||||
~~~
|
||||
obu_base.proto/VerticalLLV/present/offset1 int32 转 double (0.1m 转 m)
|
||||
obu_base.proto/VerticalLLV/present/offset2 int32 转 double (0.1m 转 m)
|
||||
obu_base.proto/VerticalLLV/present/offset3 int32 转 double (0.1m 转 m)
|
||||
obu_base.proto/VerticalLLV/present/offset4 int32 转 double (0.1m 转 m)
|
||||
obu_base.proto/VerticalLLV/present/offset5 int32 转 double (0.1m 转 m)
|
||||
obu_base.proto/VerticalLLV/present/offset6 int32 转 double (0.1m 转 m)
|
||||
obu_base.proto/VerticalLLV/present/elevation int32 转 double (0.1m 转 m)
|
||||
~~~
|
||||
**PositionLL1**
|
||||
~~~
|
||||
obu_base.proto/PositionLL1/longitude int64 转 double (1e-7° 转 °)
|
||||
obu_base.proto/PositionLL1/latitude int64 转 double (1e-7° 转 °)
|
||||
~~~
|
||||
**PositionLL2**
|
||||
~~~
|
||||
obu_base.proto/PositionLL2/longitude int64 转 double (1e-7° 转 °)
|
||||
obu_base.proto/PositionLL2/latitude int64 转 double (1e-7° 转 °)
|
||||
~~~
|
||||
**PositionLL3**
|
||||
~~~
|
||||
obu_base.proto/PositionLL3/longitude int64 转 double (1e-7° 转 °)
|
||||
obu_base.proto/PositionLL3/latitude int64 转 double (1e-7° 转 °)
|
||||
~~~
|
||||
**PositionLL4**
|
||||
~~~
|
||||
obu_base.proto/PositionLL4/longitude int64 转 double (1e-7° 转 °)
|
||||
obu_base.proto/PositionLL4/latitude int64 转 double (1e-7° 转 °)
|
||||
~~~
|
||||
**PositionLL5**
|
||||
~~~
|
||||
obu_base.proto/PositionLL5/longitude int64 转 double (1e-7° 转 °)
|
||||
obu_base.proto/PositionLL5/latitude int64 转 double (1e-7° 转 °)
|
||||
~~~
|
||||
**PositionLL6**
|
||||
~~~
|
||||
obu_base.proto/PositionLL6/longitude int64 转 double (1e-7° 转 °)
|
||||
obu_base.proto/PositionLL6/latitude int64 转 double (1e-7° 转 °)
|
||||
~~~
|
||||
**PositionLatLon**
|
||||
~~~
|
||||
obu_base.proto/PositionLatLon/longitude int64 转 double (1e-7° 转 °)
|
||||
obu_base.proto/PositionLatLon/latitude int64 转 double (1e-7° 转 °)
|
||||
~~~
|
||||
167
libraries/mogo-adas-data/src/main/proto/personal/obu_base.proto
Normal file
167
libraries/mogo-adas-data/src/main/proto/personal/obu_base.proto
Normal file
@@ -0,0 +1,167 @@
|
||||
syntax = "proto3";
|
||||
package com.mogo.support.obu;
|
||||
//场景基础数据PB
|
||||
|
||||
//垂直方向偏差 目前OBU发送的数据未偏移,使用的是elevation
|
||||
message VerticalLLV{
|
||||
oneof present{
|
||||
double offset1 = 1;//海拔,单位(m)
|
||||
double offset2 = 2;//海拔,单位(m)
|
||||
double offset3 = 3;//海拔,单位(m)
|
||||
double offset4 = 4;//海拔,单位(m)
|
||||
double offset5 = 5;//海拔,单位(m)
|
||||
double offset6 = 6;//海拔,单位(m)
|
||||
double elevation = 7;//海拔,单位(m)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//经纬度偏差,来描述一个坐标点的相对位置。约定偏差值等于真实值减去参考值。
|
||||
//提供了 7 种尺度的描述方式 目前OBU发送的数据未偏移,使用的是position_LatLon
|
||||
message PositionOffset{
|
||||
oneof present{
|
||||
PositionLL1 positionLL1 = 1;
|
||||
PositionLL2 positionLL2 = 2;
|
||||
PositionLL3 positionLL3 = 3;
|
||||
PositionLL4 positionLL4 = 4;
|
||||
PositionLL5 positionLL5 = 5;
|
||||
PositionLL6 positionLL6 = 6;
|
||||
PositionLatLon positionLatLon = 7;
|
||||
}
|
||||
}
|
||||
message PositionLL1{
|
||||
// (-2048..2047)
|
||||
double longitude = 1;//经度,单位(°)
|
||||
double latitude = 2;//维度,单位(°)
|
||||
}
|
||||
message PositionLL2{
|
||||
// (-8192..8191)
|
||||
double longitude = 1;//经度,单位(°)
|
||||
double latitude = 2;//维度,单位(°)
|
||||
}
|
||||
message PositionLL3{
|
||||
// (-32768..32767)
|
||||
double longitude = 1;//经度,单位(°)
|
||||
double latitude = 2;//维度,单位(°)
|
||||
}
|
||||
message PositionLL4{
|
||||
// (-131072..131071)
|
||||
double longitude = 1;//经度,单位(°)
|
||||
double latitude = 2;//维度,单位(°)
|
||||
}
|
||||
message PositionLL5{
|
||||
// (-2097152..2097151)
|
||||
double longitude = 1;//经度,单位(°)
|
||||
double latitude = 2;//维度,单位(°)
|
||||
}
|
||||
message PositionLL6{
|
||||
// (-8388608..8388607)
|
||||
double longitude = 1;//经度,单位(°)
|
||||
double latitude = 2;//维度,单位(°)
|
||||
}
|
||||
message PositionLatLon{
|
||||
// 定义经度数值。东经为正,西经为负。
|
||||
//分辨率为1e-7°。
|
||||
double longitude = 1;//经度,单位(°)
|
||||
double latitude = 2;//维度,单位(°)
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
//交通标志/事件位置信息
|
||||
message PositionLLV{
|
||||
PositionOffset position = 1;//经纬度
|
||||
VerticalLLV vertical = 2;//垂直方向偏差
|
||||
}
|
||||
|
||||
//交通参与者尺寸信息
|
||||
message VehicleSize {
|
||||
int32 width = 1;//宽度,单位(cm)
|
||||
int32 length = 2;//长度,单位(cm)
|
||||
int32 height = 3;//高度,单位(cm)
|
||||
}
|
||||
|
||||
//四轴加速度
|
||||
message AccFourAxes {
|
||||
double accLng = 1;//纵向加速度,单位(m/s2)
|
||||
double accLat = 2;//横向加速度,单位(m/s2)
|
||||
double accVert = 3;//垂直加速度,单位(G)
|
||||
double accYaw = 4;//横摆角加速度,单位(°/s)
|
||||
}
|
||||
|
||||
//节点信息
|
||||
message NodeId{
|
||||
int32 region = 1;/* 定义地图中划分区域的ID号 */
|
||||
int32 id = 2; /* 定义地图节点ID */
|
||||
}
|
||||
|
||||
//灯色信息
|
||||
message SpatLight{
|
||||
int32 phaseID = 1; /* 信号灯相位ID */
|
||||
int32 maneuvers = 2; /* 允许转向关系,bit0:直行,bit1:左转,bit2:右转,bit3:掉头 */
|
||||
int32 light = 3; /* 灯色,0:不可用,1:黑色,2:红闪,3:红色,4:绿闪,5:permissive_green,6:protected_green,7:黄色,8:黄闪 */
|
||||
double countDown = 4; /* 灯色倒计时,单位(s) */
|
||||
double suggestMaxSpeed = 5; /* 建议最大车速,单位(m/s) */
|
||||
double suggestMinSpeed = 6; /* 建议最小车速,单位(m/s) */
|
||||
}
|
||||
|
||||
//时间
|
||||
message DateTime{
|
||||
int32 year = 1; /* 年份 */
|
||||
int32 month = 2; /* 月份 */
|
||||
int32 day = 3; /* 日期 */
|
||||
int32 hour = 4; /* 小时 */
|
||||
int32 minute = 5; /* 分钟 */
|
||||
int32 millisecond = 6; /* 毫秒 */
|
||||
int32 offset = 7; /* 定义与UTC时间的分钟差 */
|
||||
}
|
||||
|
||||
//预警数据
|
||||
message WarningData{
|
||||
int32 unitMask = 1; /* 描述所属字段有效性 */
|
||||
int32 status = 2; /* 状态信息,0:更新,1:添加,2:删除 */
|
||||
int32 warningType = 3; /* 预警类型,0:前向碰撞预警,1:交叉路口碰撞预警,2:左转辅助预警,3:盲区预警,4:变道预警,
|
||||
5:逆向超车预警,6:紧急制动预警,7:异常车辆提醒,8:失控车辆预警,9:紧急车辆预警,10:弱势交通参与者碰撞预警 */
|
||||
int32 warningLevel = 4; /* 预警等级,0:无效,1:DETECTED,2:INFORM,3:WARNING */
|
||||
int32 warningPriority = 5; /* 预警优先级,默认为0,预留 */
|
||||
}
|
||||
|
||||
//弱势交通参与者预警信息
|
||||
message V2xWarning{
|
||||
int32 unitMask = 1; /* 描述所属字段有效性 */
|
||||
repeated WarningData warningData = 2;
|
||||
DateTime warningTime = 3; /* 预警触发时间 */
|
||||
double distance = 4; /* 预警触发时与自车之间的距离,单位(m) */
|
||||
}
|
||||
|
||||
//弱势交通参与者信息
|
||||
message Participant{
|
||||
int32 ptcType = 1; /* 交通参与者类型,0:未知,1:机动车,2:非机动车,3:行人,4:OBU自身 */
|
||||
int32 ptcId = 2; /* 临时ID,取值范围(1..255) */
|
||||
int32 source = 3; /* 监测信息来源,0:未知,1:RSU自身,2:V2X广播,3:视频传感器,4:微波雷达,5:地磁线圈传感器,6:激光雷达传感器,7:两类或以上感知数据融合 */
|
||||
int64 secMark = 4; /* UTC时间,单位(ms) */
|
||||
double latitude = 5; /* 维度,单位(°) */
|
||||
double longitude = 6; /* 经度,单位(°) */
|
||||
double elevation = 7; /* 海拔,单位(m) */
|
||||
double speed = 8; /* 速度,单位(m/s) */
|
||||
double heading = 9; /* 航向角,单位(°) */
|
||||
AccFourAxes accFourAxes = 10; /* 四轴加速度 */
|
||||
VehicleSize ptcSize = 11; /* 交通参与者尺寸信息 */
|
||||
int32 vehicleClass = 12; /* 车辆类型,参考《OBU软件SDK使用文档》附录A中的表1 */
|
||||
int32 targetPosition = 13; /* 目标方位,参考mg_veh_target_position_t */
|
||||
}
|
||||
|
||||
message RsiWarning {
|
||||
int32 unitMask = 1; /* 描述所属字段有效性 */
|
||||
int32 sceneType = 2; /* 预警类型,0:无效,1:限速信息,2:道路危险,3:车内标牌,4:前方拥堵 */
|
||||
PositionLLV position = 3; /* 交通标志/事件位置信息 */
|
||||
int32 signSerialNum = 4; /* 交通标志类型序号,根据预警类型匹配,0:无效,参照国标《GB 5768.2-2009中“交通标志中文名称索引》表序号 */
|
||||
int32 eventSerialNum = 5; /* 交通事件类型序号,根据预警类型匹配,0:无效,参考国标《GB/T 29100-2012》中定义的事件分类代码 */
|
||||
double speedMaxLimit = 6; /* 建议最大车速,单位(0.02m/s) */
|
||||
double speedMinLimit = 7; /* 建议最小车速,单位(0.02m/s) */
|
||||
double eventRadius = 8; /* 交通事件触发半径,根据预警类型匹配,0:无效,单位(0.1m) */
|
||||
int32 warningLevel = 9; /* 预警等级,0:无效,1:DETECTED,2:INFORM,3:WARNING */
|
||||
int32 targetPosition = 10; /* 目标方位,参考mg_rti_target_position_t */
|
||||
double distance = 11; /* 预警触发时与自车之间的距离,单位(0.01m) */
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
syntax = "proto3";
|
||||
package com.mogo.support.obu;
|
||||
|
||||
import "header.proto";
|
||||
import "personal/obu_scene.proto";
|
||||
|
||||
//工控机透传PB
|
||||
message PenetrateWarningData{
|
||||
common.Header header = 1;
|
||||
int32 msgDataType = 2; /*1:rsiEvent; 2:rsmEvent; 3:spatEvent; 4:mapMatchData*/
|
||||
RsiWarningData rsiEvent = 3;
|
||||
RsmWarningData rsmEvent = 4;
|
||||
SpatWarningData spatEvent = 5;
|
||||
MapMatchData mapMatchData = 6;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
syntax = "proto3";
|
||||
package com.mogo.support.obu;
|
||||
|
||||
import "personal/obu_base.proto";
|
||||
//场景PB 目前只有V2I(Rsi、Rsm、Spat、Map)相关场景,后期会添加V2V相关场景
|
||||
|
||||
//预警事件 RSI Warning event
|
||||
message RsiWarningData {
|
||||
int32 status = 1; /* 状态信息,0:更新,1:添加,2:删除 */
|
||||
//int32 warning_num = 2; /* 预警信息数量 */
|
||||
repeated RsiWarning warningMsg = 2; /* 预警信息集合 */
|
||||
}
|
||||
|
||||
//RSM Warning Msg
|
||||
message RsmWarningData{
|
||||
int32 status = 1; /* 状态信息,0:更新,1:添加,2:删除 */
|
||||
Participant participant = 2; /* 弱势交通参与者信息 */
|
||||
V2xWarning warningMsg = 3; /* 弱势交通参与者预警信息 */
|
||||
}
|
||||
|
||||
//SPAT Msg
|
||||
message SpatWarningData{
|
||||
int32 status = 1; /* 状态信息,0:更新,1:添加,2:删除 */
|
||||
int32 warningType = 2; /* 预警类型信息 */
|
||||
repeated SpatLight lights = 3; /* 灯色信息集合 */
|
||||
}
|
||||
|
||||
message MapMatchData{
|
||||
int32 status = 1;/* 状态信息,0:更新,1:添加,2:删除 */
|
||||
int32 unitMask = 2;/* 描述所属字段有效性 */
|
||||
NodeId currentNodeID = 3;/* 前方节点信息 */
|
||||
NodeId upstreamNodeID = 4;/* 上游节点信息 */
|
||||
int32 matchingLaneID = 5;/* 匹配车道ID,0:无效 */
|
||||
double speedMaxLimit = 6;/* 建议最大车速,单位(m/s) */
|
||||
double speedMinLimit = 7;/* 建议最小车速,单位(m/s) */
|
||||
}
|
||||
@@ -205,6 +205,9 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeTrajectory, new DispatchHandler(MessagePad.MessageType.MsgTypeTrajectory, this));
|
||||
//障碍物信息
|
||||
dispatchHandlers.put(MessagePad.MessageType.MsgTypeTrackedObjects, new DispatchHandler(MessagePad.MessageType.MsgTypeTrackedObjects, this));
|
||||
//透传OBU V2I事件(OBU通过UDP发送数据如果多场景同时出发,接收频率太高。工控机只是透传未做任何频率限制)
|
||||
dispatchHandlers.put(MessagePad.MessageType.MsgTypeObuWarningData, new DispatchHandler(MessagePad.MessageType.MsgTypeObuWarningData, this));
|
||||
|
||||
//惯导信息
|
||||
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeGnssInfo, new DispatchHandler(MessagePad.MessageType.MsgTypeGnssInfo, this));
|
||||
//底盘信息
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zhidao.support.adas.high;
|
||||
|
||||
import com.mogo.support.obu.ObuScene;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotAbility;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics;
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus;
|
||||
@@ -203,6 +204,38 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onObuWarningData(MessagePad.Header header, ObuWarningEvent.ObuWarningData obuWarningData);
|
||||
|
||||
/**
|
||||
* OBU 红绿灯预警信息
|
||||
*
|
||||
* @param header 头
|
||||
* @param spatWarningData 数据
|
||||
*/
|
||||
void onoObuSpatWarning(MessagePad.Header header, ObuScene.SpatWarningData spatWarningData);
|
||||
|
||||
/**
|
||||
* OBU RSI预警信息
|
||||
*
|
||||
* @param header 头
|
||||
* @param rsiWarningData 数据
|
||||
*/
|
||||
void onoObuRsiWarning(MessagePad.Header header, ObuScene.RsiWarningData rsiWarningData);
|
||||
|
||||
/**
|
||||
* OBU RSM预警信息
|
||||
*
|
||||
* @param header 头
|
||||
* @param rsmWarningData 数据
|
||||
*/
|
||||
void onoObuRsmWarning(MessagePad.Header header, ObuScene.RsmWarningData rsmWarningData);
|
||||
|
||||
/**
|
||||
* OBU 地图匹配结果
|
||||
*
|
||||
* @param header 头
|
||||
* @param mapMatchData 数据
|
||||
*/
|
||||
void onoObuRsmWarning(MessagePad.Header header, ObuScene.MapMatchData mapMatchData);
|
||||
|
||||
/**
|
||||
* 重构后的功能状态
|
||||
*
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.google.protobuf.UnknownFieldSet;
|
||||
import com.zhidao.support.adas.high.AdasChannel;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
@@ -27,5 +29,30 @@ public class ObuWarningDataMessage extends MyAbstractMessageHandler {
|
||||
adasListener.onObuWarningData(raw.getHeader(), obuWarningData);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("OBU预警事件", nowTime);
|
||||
|
||||
|
||||
|
||||
// ObuPenetrate.WarningData warningData = ObuPenetrate.WarningData.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
|
||||
// UnknownFieldSet set = warningData.getMapMatchData().getUnknownFields();
|
||||
//
|
||||
// Log.i("ddd", "set.getField(7).getVarintList()=" + set.getField(7).getVarintList());
|
||||
// Long a = set.getField(7).getVarintList().get(0);
|
||||
//
|
||||
// ObuScene.MapMatchData.Builder MapMatchDataBuilder = warningData.getMapMatchData().toBuilder().setSpeedMinLimit(a * 0.02D);
|
||||
// MapMatchDataBuilder.setUnknownFields(UnknownFieldSet.getDefaultInstance());
|
||||
// ObuPenetrate.WarningData.Builder builder = warningData.toBuilder();
|
||||
// builder.setMapMatchData(MapMatchDataBuilder);
|
||||
// warningData = builder.build();
|
||||
//// Log.i("ddd","a="+a);
|
||||
//
|
||||
//
|
||||
// AdasChannel.calculateTimeConsumingOnDispatchRaw("OBU预警事件", raw.receiveTime);
|
||||
// long nowTime = 0;
|
||||
// if (CupidLogUtils.isEnableLog())
|
||||
// nowTime = SystemClock.elapsedRealtime();
|
||||
// if (adasListener != null) {
|
||||
// adasListener.onObuWarningData(raw.getHeader(), warningData);
|
||||
// }
|
||||
// AdasChannel.calculateTimeConsumingBusiness("OBU预警事件", nowTime);
|
||||
}
|
||||
}
|
||||
|
||||
1
libraries/mogo-obu/.gitignore
vendored
Normal file
1
libraries/mogo-obu/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
4
libraries/mogo-obu/README.md
Normal file
4
libraries/mogo-obu/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
#### 说明
|
||||
# OBU LIB
|
||||
## OBU SDK 数据融合
|
||||
|
||||
61
libraries/mogo-obu/build.gradle
Normal file
61
libraries/mogo-obu/build.gradle
Normal file
@@ -0,0 +1,61 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'com.google.protobuf'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode rootProject.versionCode as int
|
||||
versionName rootProject.versionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
sourceSets {
|
||||
main {
|
||||
proto {
|
||||
srcDir 'src/main/proto'
|
||||
include '**/*.proto'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protobuf {
|
||||
protoc {
|
||||
artifact = rootProject.ext.dependencies.protoc
|
||||
}
|
||||
|
||||
generateProtoTasks {
|
||||
all().each { task ->
|
||||
task.builtins {
|
||||
remove java
|
||||
}
|
||||
task.builtins {
|
||||
java {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api project(':libraries:mogo-adas-data')
|
||||
api rootProject.ext.dependencies.protobuf_java
|
||||
api rootProject.ext.dependencies.protobuf_java_util
|
||||
api rootProject.ext.dependencies.mogoobu
|
||||
}
|
||||
0
libraries/mogo-obu/consumer-rules.pro
Normal file
0
libraries/mogo-obu/consumer-rules.pro
Normal file
3
libraries/mogo-obu/gradle.properties
Normal file
3
libraries/mogo-obu/gradle.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
GROUP=com.mogo.obu
|
||||
POM_ARTIFACT_ID=mogo-obu
|
||||
VERSION_CODE=1
|
||||
21
libraries/mogo-obu/proguard-rules.pro
vendored
Normal file
21
libraries/mogo-obu/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
4
libraries/mogo-obu/src/main/AndroidManifest.xml
Normal file
4
libraries/mogo-obu/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.support.obu" >
|
||||
|
||||
</manifest>
|
||||
3
libraries/mogo-obu/src/main/res/values/strings.xml
Normal file
3
libraries/mogo-obu/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">mogo-obu</string>
|
||||
</resources>
|
||||
@@ -47,6 +47,7 @@ include ':libraries:mogo-map-api'
|
||||
include ':libraries:mogo-map'
|
||||
include ':libraries:mogo-adas'
|
||||
include ':libraries:mogo-adas-data'
|
||||
include ':libraries:mogo-obu'
|
||||
|
||||
// 语音
|
||||
include ':tts:tts-base'
|
||||
|
||||
Reference in New Issue
Block a user