[add] 测试数据 指引箭头3D资源替换

This commit is contained in:
liujing
2021-04-20 16:19:18 +08:00
parent faaa832cb4
commit 4fd26996d1
9 changed files with 97 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
package com.mogo.map.impl.custom;
import android.content.Context;
import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.debug.DebugConfig;
@@ -92,8 +93,9 @@ class CustomMapApiBuilder implements IMogoMapApiBuilder {
@Override
public IMogoMapView getMapView( Context context ) {
Log.d(TAG,"setDebugMode==true");
NavAutoApi.INSTANCE.init( context, MapParams.Companion.init()
.setDebugMode( false )
.setDebugMode( true )
.setCoordinateType( MapParams.COORDINATETYPE_GCJ02 )
.setPerspectiveMode( MapParams.MAP_PERSPECTIVE_2D )
.setZoom( 20 )

View File

@@ -136,7 +136,6 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
.flat(true);
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerType, options);
marker.setRotateAngle(rotate);
marker.setToTop();
}
/*

View File

@@ -1,6 +1,7 @@
package com.mogo.module.v2x;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.mogo.map.MogoLatLng;
@@ -80,12 +81,22 @@ public class V2XWaringManager {
/**
* 测试数据
*/
private void testData() {
private void testData(String adasResult) {
try {
int id = R.raw.scenario_warning_event_data;
switch (adasResult) {
case "left":
id = R.raw.scenario_warning_event_data_left;
break;
case "pedestrians":
id = R.raw.scenario_warning_event_data_pedestrians;
break;
default:
}
InputStream inputStream = V2XUtils.getApp()
.getResources()
.openRawResource(R.raw.scenario_warning_event_data);
.openRawResource(id);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int len = -1;
byte[] buffer = new byte[1024];
@@ -124,7 +135,7 @@ public class V2XWaringManager {
.getMoGoSocketManager()
.registerOnMessageListener(
401018,
v2XWarnMessageListener );
v2XWarnMessageListener);
}
public V2XWarnMessageListener getV2XMessageListener() {
@@ -135,11 +146,11 @@ public class V2XWaringManager {
/**
* 处理adas返回的数据
*/
public void handleAdasData() {
public void handleAdasData(Intent intent) {
Log.d(V2XConst.LOG_NAME_WARN, "V2XWaringManager ---- handleAdasData ");
String adasResult = (String) intent.getSerializableExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY);
//测试数据
testData();
testData(adasResult);
// adas 每隔一秒传递的他车或行人数据,避免重复。
// V2XServiceManager.getmIMogoADASController().addAdasRecognizedDataCallback(resultList -> {
@@ -158,6 +169,7 @@ public class V2XWaringManager {
/**
* 添加2d的碰撞 marker
*
* @param markerShowEntity
* @return
*/

View File

@@ -23,7 +23,7 @@ public class AdasDataBroadcastReceiver extends BroadcastReceiver {
// Logger.d(V2XConst.LOG_NAME_WARN, "AdasDataBroadcastReceiver -->" + GsonUtil.jsonFromObject(adasResult));
String adasResult = (String) intent.getSerializableExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY);
Log.d(V2XConst.LOG_NAME_WARN, "AdasDataBroadcastReceiver -----> ");
V2XWaringManager.getInstance().handleAdasData();
V2XWaringManager.getInstance().handleAdasData(intent);
} catch (Exception e) {
e.printStackTrace();

View File

@@ -362,17 +362,21 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
});
/*
*障碍物绕行
*车路云场景预警-左侧
* */
btnTriggerObstacleDetour.setOnClickListener(v -> {
Intent intent = new Intent(V2XConst.BROADCAST_ADAS_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY, "left");
getContext().sendBroadcast(intent);
});
/*
*行人预警,行人路线预测
*行人预警,行人路线预测 车路云预警-前方行人
* */
btnTriggerPedestrianWarning.setOnClickListener(v -> {
Intent intent = new Intent(V2XConst.BROADCAST_ADAS_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY, "pedestrians");
getContext().sendBroadcast(intent);
});
/*

View File

@@ -426,7 +426,7 @@
android:layout_marginBottom="@dimen/dp_10"
android:background="#00BCD4"
android:padding="@dimen/dp_10"
android:text="障碍物绕行"
android:text="车路云场景预警-左侧"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_22"
app:layout_constraintBottom_toBottomOf="parent"
@@ -440,7 +440,7 @@
android:layout_marginBottom="@dimen/dp_10"
android:background="#009688"
android:padding="@dimen/dp_10"
android:text="行人预警,行人路线预测"
android:text="车路云场景预警-前方行人"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_22"
app:layout_constraintBottom_toBottomOf="parent"
@@ -482,7 +482,7 @@
android:layout_marginBottom="@dimen/dp_10"
android:background="#8BC34A"
android:padding="@dimen/dp_10"
android:text="车路云场景预警"
android:text="车路云场景预警-右侧"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_22"
app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -0,0 +1,32 @@
{
"type": 10013,
"lat": 39.977148,
"lon": 116.417478,
"distance": 2,
"collisionLat": 39.977094,
"collisionLon": 116.417634,
"stopLines": [
{
"lat": 39.976858,
"lon": 116.417651
},
{
"lat": 39.976874,
"lon": 116.417757
}
],
"from": 1,
"angle": 0,
"direction": 3,
"speed": 11.108121,
"targetColor": "#FF4040",
"stopLineDistance": 60,
"warningContent": "小心行人",
"heading": 0,
"showTime": 8000,
"roadwidth": 4.0,
"carLocation": {
"lat": 39.97665425,
"lon": 116.41769983
}
}

View File

@@ -0,0 +1,32 @@
{
"type": 10013,
"lat": 39.977148,
"lon": 116.417886,
"distance": 2,
"collisionLat": 39.977094,
"collisionLon": 116.417634,
"stopLines": [
{
"lat": 39.976858,
"lon": 116.417651
},
{
"lat": 39.976874,
"lon": 116.417757
}
],
"from": 1,
"angle": 0,
"direction": 1,
"speed": 11.108121,
"targetColor": "#FF4040",
"stopLineDistance": 60,
"warningContent": "小心行人",
"heading": 0,
"showTime": 8000,
"roadwidth": 4.0,
"carLocation": {
"lat": 39.97665425,
"lon": 116.41769983
}
}