Merge branch 'dev2_aiSdk' into dev2_adas
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// 网约车服务:仅小巴车、出租车渠道用
|
||||
project.dependencies {
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
bydautoImplementation rootProject.ext.dependencies.mogoochnoop
|
||||
|
||||
@@ -96,7 +96,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_GAODE_AIMLESS_SHARE, "GaoDeAimlessShare"));
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor"));
|
||||
MogoModulePaths.addModule(new MogoModule(PushUIConstants.PATH, PushUIConstants.NAME));
|
||||
// 碰撞报警模块
|
||||
// 碰撞报警模块
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_CRASH_WARNING, "CrashWarning"));
|
||||
// MogoModulePaths.addModule( new MogoModule( IMogoMachineVisionProvider.path, "IMogoMachineVisionProvider" ) );
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.7'
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.8'
|
||||
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-test-3.4'
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class DataTypes {
|
||||
public static final String TYPE_MARKER_CLOUD_DATA = "TYPE_MARKER_CLOUD_DATA";
|
||||
|
||||
/**
|
||||
* 云端下发警告数据
|
||||
* 云端下发识别目标物警告数据
|
||||
*/
|
||||
public static final String TYPE_MARKER_CLOUD_WARN_DATA = "TYPE_MARKER_CLOUD_WARN_DATA";
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
private static final String TAG = "V2XWarnDataDrawer";
|
||||
private static volatile V2XWarnDataDrawer sInstance;
|
||||
private boolean mChangeCarModeStatus;
|
||||
private List<IMogoMarker> stopLineMarker = new ArrayList();
|
||||
|
||||
private V2XWarnDataDrawer() {
|
||||
super();
|
||||
@@ -169,11 +168,6 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
* @param data
|
||||
*/
|
||||
public void renderStopLineData(V2XWarningEntity data) {
|
||||
if (stopLineMarker.size() > 0) {
|
||||
for (int i = 0; i < stopLineMarker.size(); i++) {
|
||||
stopLineMarker.get(i).remove();
|
||||
}
|
||||
}
|
||||
MarkerLocation location = new MarkerLocation();
|
||||
location.setLat(data.getLat());
|
||||
location.setLon(data.getLon());
|
||||
@@ -191,15 +185,18 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止线绘制
|
||||
*/
|
||||
public IMogoMarker drawStopLineMarker(MarkerShowEntity markerShowEntity) {
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(markerShowEntity)
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
||||
options.icon3DRes(getModelRes(9)); //TODO
|
||||
options.icon3DRes(getModelRes(9));
|
||||
|
||||
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
|
||||
options.anchorColor("#FB3C3CFF");
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
iMarkerView.setMarker(marker);
|
||||
marker.setToTop();
|
||||
|
||||
@@ -62,7 +62,7 @@ import java.util.List;
|
||||
* @author congtaowang
|
||||
* @since 2020-04-17
|
||||
* <p>
|
||||
* 描述
|
||||
* 使用控制台发送广播,这里接收intent来处理场景
|
||||
*/
|
||||
public class MockIntentHandler implements IntentHandler {
|
||||
|
||||
@@ -90,7 +90,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
TipToast.shortTip( msg );
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case 4:// 测试左侧按钮1
|
||||
TextView button1 = MarkerServiceHandler.getApis().getEntranceButtonController().getButton( ButtonIndex.BUTTON1 );
|
||||
if ( button1 != null ) {
|
||||
button1.setVisibility( View.VISIBLE );
|
||||
@@ -99,18 +99,18 @@ public class MockIntentHandler implements IntentHandler {
|
||||
} );
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
TextView button2 = MarkerServiceHandler.getApis().getEntranceButtonController().getButton( ButtonIndex.BUTTON1 );
|
||||
case 5:// 测试左侧按钮2
|
||||
TextView button2 = MarkerServiceHandler.getApis().getEntranceButtonController().getButton( ButtonIndex.BUTTON2 );
|
||||
if ( button2 != null ) {
|
||||
button2.setOnClickListener( null );
|
||||
button2.setVisibility( View.GONE );
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
case 6://
|
||||
boolean status1 = intent.getBooleanExtra( "status", false );
|
||||
MarkerServiceHandler.getMogoStatusManager().setUploadingStatus( TAG, status1 );
|
||||
break;
|
||||
case 7:
|
||||
case 7:// 打开微信
|
||||
TextView button11 = MarkerServiceHandler.getApis().getEntranceButtonController().getButton( ButtonIndex.BUTTON1 );
|
||||
if ( button11 != null ) {
|
||||
button11.setVisibility( View.VISIBLE );
|
||||
@@ -130,11 +130,11 @@ public class MockIntentHandler implements IntentHandler {
|
||||
} );
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
case 8:// 测试修改车头角度
|
||||
float bearing = intent.getFloatExtra( "bearing", 0 );
|
||||
MarkerServiceHandler.getMapUIController().changeBearing( bearing );
|
||||
break;
|
||||
case 9:
|
||||
case 9:// 测试弹窗
|
||||
new WMDialog.Builder( context )
|
||||
.setOkButton( "确认", ( dlg, which ) -> {
|
||||
dlg.dismiss();
|
||||
@@ -146,7 +146,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
.build()
|
||||
.show();
|
||||
break;
|
||||
case 10:
|
||||
case 10://测试GEO查询
|
||||
IMogoGeoSearch geoSearch = MarkerServiceHandler.getMapService().getGeoSearch( context );
|
||||
geoSearch.setGeoSearchListener( new IMogoGeoSearchListener() {
|
||||
@Override
|
||||
@@ -165,10 +165,10 @@ public class MockIntentHandler implements IntentHandler {
|
||||
query.setRadius( 1000 );
|
||||
geoSearch.getFromLocationAsyn( query );
|
||||
break;
|
||||
case 11:
|
||||
case 11:// 控制ADAS中的设置页面
|
||||
MarkerServiceHandler.getADASController().setSettingStatus( intent.getBooleanExtra( "status", false ) );
|
||||
break;
|
||||
case 12: {
|
||||
case 12: {// 控制ADAS显示隐藏
|
||||
boolean status2 = intent.getBooleanExtra( "status", false );
|
||||
if ( status2 ) {
|
||||
MarkerServiceHandler.getADASController().showADAS();
|
||||
@@ -177,7 +177,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 13: {
|
||||
case 13: {// 唤起高德地图
|
||||
double lat = intent.getFloatExtra( "lat", 0.0f );
|
||||
double lon = intent.getFloatExtra( "lon", 0.0f );
|
||||
boolean real = intent.getBooleanExtra( "real", false );
|
||||
@@ -225,7 +225,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
} );
|
||||
MarkerServiceHandler.getNavi().naviTo( new MogoLatLng( lat, lon ) );
|
||||
}
|
||||
case 14: {
|
||||
case 14: {//测试点的动画移动,模拟周边车辆移动
|
||||
List< MogoLatLng > mogoLatLngs = new ArrayList<>();
|
||||
mogoLatLngs.add( new MogoLatLng( 39.615986, 116.396716 ) );
|
||||
mogoLatLngs.add( new MogoLatLng( 39.616007, 116.396995 ) );
|
||||
@@ -355,30 +355,30 @@ public class MockIntentHandler implements IntentHandler {
|
||||
// case 16:
|
||||
// MarkerServiceHandler.getGpsSimulatorManager().close();
|
||||
// break;
|
||||
case 17:
|
||||
case 17:// 查询在线车辆数据
|
||||
DebugConfig.setRequestOnlineCarData( intent.getBooleanExtra( "status", true ) );
|
||||
break;
|
||||
case 18:
|
||||
case 18:// 设置是否使用自研地图
|
||||
TipToast.shortTip( "设置完成,下次启动生效" );
|
||||
SharedPrefsMgr.getInstance( context ).putBoolean( "useCustomMap", intent.getBooleanExtra( "useCustomMap", false ) );
|
||||
break;
|
||||
case 30:
|
||||
case 30:// 强制刷新地图
|
||||
MarkerServiceHandler.getMapService().getMapUIController().forceRender();
|
||||
break;
|
||||
case 31:
|
||||
case 31://
|
||||
Intent intent3 = new Intent();
|
||||
intent3.setAction( "AUTONAVI_STANDARD_BROADCAST_RECV" );
|
||||
intent3.putExtra( "KEY_TYPE", 12404 );
|
||||
intent3.putExtra( "EXTRA_REQUEST_AUTO_STATE", 0 );
|
||||
context.sendBroadcast( intent3 );
|
||||
break;
|
||||
case 32:
|
||||
case 32:// 控制实时路况
|
||||
MarkerServiceHandler.getMapService().getMapUIController().setTrafficEnabled( true );
|
||||
break;
|
||||
case 33:
|
||||
case 33:// 测试小智语音
|
||||
AIAssist.getInstance( context ).speakTTSVoice( "庞帆说这个是一个 hard coding." );
|
||||
break;
|
||||
case 34:
|
||||
case 34:// 修改地图模式VR OR 2D
|
||||
int type = intent.getIntExtra( "type", 0 );
|
||||
if ( type != 0 ) {
|
||||
MogoApisHandler.getInstance().getApis().getMapFrameControllerApi().changeToVRMode();
|
||||
@@ -386,10 +386,10 @@ public class MockIntentHandler implements IntentHandler {
|
||||
MogoApisHandler.getInstance().getApis().getMapFrameControllerApi().changeTo2dMode();
|
||||
}
|
||||
break;
|
||||
case 35:
|
||||
case 35://测试GPS数据
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().testGpsData();
|
||||
break;
|
||||
case 36:
|
||||
case 36:// 测试打点功能
|
||||
MogoLatLng center = MogoApisHandler.getInstance().getApis()
|
||||
.getMapServiceApi().getMapUIController()
|
||||
.getWindowCenterLocation();
|
||||
@@ -399,16 +399,16 @@ public class MockIntentHandler implements IntentHandler {
|
||||
.position( center )
|
||||
.icon( BitmapFactory.decodeResource( context.getResources(), R.drawable.bg_map_marker_red ) ) );
|
||||
break;
|
||||
case 37:
|
||||
case 37:// 销毁测试打点
|
||||
if ( centerMarker != null ) {
|
||||
centerMarker.destroy();
|
||||
}
|
||||
break;
|
||||
case 38:
|
||||
case 38:// 控制RTK
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController()
|
||||
.rtkEnable( false );
|
||||
break;
|
||||
case 39:
|
||||
case 39:// 使用自动驾驶车的定位数据
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController()
|
||||
.syncLocation2Map( null );
|
||||
break;
|
||||
@@ -494,12 +494,12 @@ public class MockIntentHandler implements IntentHandler {
|
||||
Logger.d( TAG, "偏差值:%s", delta );
|
||||
}
|
||||
break;
|
||||
case 41:
|
||||
case 41://
|
||||
// adb shell am broadcast -a com.mogo.mock --ei oper 41 --ei type 0 平滑移动
|
||||
// adb shell am broadcast -a com.mogo.mock --ei oper 41 --ei type 1 直接打点
|
||||
DebugConfig.setNotSmooth( intent.getIntExtra( "type", 0 ) == 1 );
|
||||
break;
|
||||
case 42:
|
||||
case 42://
|
||||
WorkThreadHandler.getInstance().post( () -> {
|
||||
try {
|
||||
InputStream is = context.getAssets().open( "coors.json" );
|
||||
@@ -531,13 +531,13 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
} );
|
||||
break;
|
||||
case 43:
|
||||
case 43://
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getAdasControllerApi()
|
||||
.onAutopilotArriveLike( intent.getIntExtra( "type", 8 ) );
|
||||
break;
|
||||
case 44:
|
||||
case 44:// 控制自动驾驶
|
||||
RemoteControlAutoPilotParameters parameters = new RemoteControlAutoPilotParameters();
|
||||
parameters.vehicleType = 9;
|
||||
parameters.startLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat( 40.1690522746, 116.567374558 );
|
||||
@@ -547,21 +547,21 @@ public class MockIntentHandler implements IntentHandler {
|
||||
.getAdasControllerApi()
|
||||
.aiCloudToAdasData( parameters );
|
||||
break;
|
||||
case 45:
|
||||
case 45:// 测试开启鹰眼模式
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getMapServiceApi()
|
||||
.getMapUIController()
|
||||
.openVrMode( false );
|
||||
break;
|
||||
case 46:
|
||||
case 46:// 模拟 自车周边数据
|
||||
String json = "{\"allList\":[{\"type\":3,\"uuid\":\"10009-5152\",\"lat\":40.1990809296,\"lon\":116.7393252195,\"speed\":0.0,\"heading\":0.0,\"systemTime\":1614329151909,\"vehicleType\":0,\"distance\":576.0,\"fromType\":3,\"isOnline\":0},{\"type\":3,\"uuid\":\"10009-5161\",\"lat\":40.1990827227,\"lon\":116.739325826,\"speed\":0.0,\"heading\":0.0,\"systemTime\":1614329151909,\"vehicleType\":0,\"distance\":576.0,\"fromType\":3,\"isOnline\":0}],\"nearList\":[],\"time\":1614329152238}";
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData( GsonUtil.objectFromJson( json, MogoSnapshotSetData.class ) );
|
||||
break;
|
||||
case 47:
|
||||
case 47:// 模拟鹰眼模式下绘制车辆周边的数据
|
||||
mTimeTickHandler.sendEmptyMessageDelayed( 1, 0L );
|
||||
break;
|
||||
case 48:
|
||||
case 48:// 模拟3D模型绘制
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner( DataTypes.TYPE_MARKER_ADAS )
|
||||
.anchor( 0.5f, 0.5f )
|
||||
@@ -577,7 +577,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
latLngs.add( new MogoLatLng( 39.981990561932, 116.412893641626 ) );
|
||||
marker.startSmoothInMs( latLngs, 20_000L );
|
||||
break;
|
||||
case 49:
|
||||
case 49:// 绘制marker
|
||||
// 39.96741320378243, 116.41045709250723
|
||||
// 39.98232698552779,116.41879656379113;
|
||||
MogoMarkerOptions options1 = new MogoMarkerOptions()
|
||||
@@ -611,17 +611,17 @@ public class MockIntentHandler implements IntentHandler {
|
||||
.rotate( ( float ) 358.526123 );
|
||||
IMogoMarker marker3 = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( context ).addMarker( DataTypes.TYPE_MARKER_ADAS, options3 );
|
||||
break;
|
||||
case 50:
|
||||
case 50://
|
||||
DebugConfig.setSelfCarSpeedYOffset( intent.getIntExtra( "yOffset", 20 ) );
|
||||
break;
|
||||
case 51:
|
||||
case 51:// 模拟路口车辆移动
|
||||
mLocationMockHandler.sendEmptyMessageDelayed( 100, 0L );
|
||||
mLocationMockHandler.sendEmptyMessageDelayed( 101, 1000L );
|
||||
break;
|
||||
case 52:
|
||||
case 52:// 打开连调工控机、ADAS的控制面板
|
||||
EnvStatusManager.getInstance().showPanel( context );
|
||||
break;
|
||||
case 53:
|
||||
case 53:// 控制 Adas识别 是否可用
|
||||
boolean isUseAdasRecognize = intent.getBooleanExtra( "status", false );
|
||||
DebugConfig.setUseAdasRecognize( isUseAdasRecognize );
|
||||
break;
|
||||
|
||||
@@ -153,6 +153,11 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
MarkerServiceHandler.getApis().getAdasControllerApi().addAdasRecognizedDataCallback( resultList -> {
|
||||
// 绘制近景识别到的车辆
|
||||
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( resultList );
|
||||
//绘制他车的线 lixp TODO
|
||||
|
||||
//添加自车的定位图标 TODO
|
||||
|
||||
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA;
|
||||
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA;
|
||||
import static com.mogo.module.v2x.V2XServiceManager.getContext;
|
||||
|
||||
/**
|
||||
@@ -84,13 +86,14 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(cloundWarningInfo.getType(), MogoReceiver.ACTION_V2X_FRONT_WARNING);
|
||||
isSelfLineClear = false;
|
||||
isFirstLocation = false;
|
||||
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(WARNING_ARROWS);
|
||||
if (cloundWarningInfo.getDirection() == 1) { //前方 TODO
|
||||
middleLocationInStopLine = getMiddleLocationInStopLine();
|
||||
MogoLatLng warningLocation = Trigonometric.getNewLocation(middleLocationInStopLine, 50, cloundWarningInfo.getAngle());
|
||||
//停止线前方画线
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
//二轮车和行人的渲染和移动
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
|
||||
//绘制识别物与交汇点连线,并且更新连线数据
|
||||
drawRedWarningLineFrontOfStopLine(cloundWarningInfo, middleLocationInStopLine, warningLocation);
|
||||
@@ -112,6 +115,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
//绘制识别物与交汇点连线,并且更新连线数据
|
||||
drawOtherObjectLine(cloundWarningInfo);
|
||||
//二轮车和行人的渲染和移动
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
|
||||
|
||||
//车辆静止的时候
|
||||
@@ -135,6 +139,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
private void handleStopLine() {
|
||||
try {
|
||||
if (mCloundWarningInfo != null) {
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_STOP_LINE_DATA);
|
||||
for (int i = 0; i < fillPoints.size(); i++) {
|
||||
V2XWarningEntity entity = new V2XWarningEntity();
|
||||
MogoLatLng latLng = (MogoLatLng) fillPoints.get(i);
|
||||
|
||||
@@ -23,7 +23,7 @@ public
|
||||
* @author congtaowang
|
||||
* @since 2020/8/12
|
||||
*
|
||||
* 描述
|
||||
* 高德地图启动的时候才会用到这个模块
|
||||
*/
|
||||
@Route( path = MogoWidgetsProvider.PATH )
|
||||
class MogoWidgetsProvider implements IMogoModuleProvider {
|
||||
|
||||
Reference in New Issue
Block a user