diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapView.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapView.java index 2a22758289..efb1b653eb 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapView.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapView.java @@ -24,7 +24,7 @@ public class CustomMapView implements IMogoMapViewCreator { @Override public IMogoMapView create( Context context ) { if ( mapView == null ) { - MapAutoApi.INSTANCE.init( context, MapParams.Companion.init().setDebugMode( true ) + MapAutoApi.INSTANCE.init( context, MapParams.Companion.init().setDebugMode( false ) .setCoordinateType( MapParams.COORDINATETYPE_GCJ02 ) .setPerspectiveMode( MapParams.MAP_PERSPECTIVE_2D ) .setZoom( 16 ) diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/AdasRecognizedType.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/AdasRecognizedType.java index c9effe1b6f..4e1cf1166a 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/AdasRecognizedType.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/AdasRecognizedType.java @@ -9,21 +9,21 @@ public */ enum AdasRecognizedType { //背景 - classIdBackground( "background",0 ), + classIdBackground( "background", 0 ), //人 - classIdPerson( "person",1 ), + classIdPerson( "person", 1 ), //自行车 - classIdBicycle( "bicycle",2 ), + classIdBicycle( "bicycle", 2 ), //小轿车 - classIdCar( "car",3 ), + classIdCar( "car", 3 ), //摩托车 - classIdMoto( "moto",4 ), + classIdMoto( "moto", 4 ), //红绿灯 - classIdTrafficSign( "traffic_sign",5 ), + classIdTrafficSign( "traffic_sign", 5 ), //bus - classIdTrafficBus( "traffic_bus",6 ), + classIdTrafficBus( "traffic_bus", 6 ), //track - classIdTrafficTruck( "traffic_truck",8 ); + classIdTrafficTruck( "traffic_truck", 8 ); AdasRecognizedType( int code ) { this.code = code; @@ -42,6 +42,9 @@ enum AdasRecognizedType { } public static AdasRecognizedType valueFrom( int code ) { + if ( code == 0 ) { + return classIdCar; + } for ( AdasRecognizedType value : AdasRecognizedType.values() ) { if ( value.code == code ) { return value; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/SafeType.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/SafeType.java index 43f3be25ea..38a0625a2f 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/SafeType.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/SafeType.java @@ -8,16 +8,22 @@ public * 描述 */ enum SafeType { - Normal( "安全" ), - SpeedWarm( "注意/超速" ), - DistanceWarm( "注意/保持车距" ), - SpeedDangerous( "危险/严重超速" ), - DistanceDangerous( "危险/距离过近" ); + Normal( "normal", "安全" ), + SpeedWarm( "warm", "注意/超速" ), + DistanceWarm( "warm", "注意/保持车距" ), + SpeedDangerous( "dangerous", "危险/严重超速" ), + DistanceDangerous( "dangerous", "危险/距离过近" ); private String msg; + private String res; - SafeType( String msg ) { + SafeType( String res, String msg ) { this.msg = msg; + this.res = res; + } + + public String getRes() { + return res; } public String getMsg() { diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/VisionMode.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/VisionMode.java index 0b908e5765..bb15f594cd 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/VisionMode.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/VisionMode.java @@ -9,7 +9,7 @@ public */ enum VisionMode { - Machine( "user" ), + Machine( "machine" ), User( "user" ); private String res; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/AdasRecognizedResultDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/AdasRecognizedResultDrawer.java index d17fedcf92..12bfb506b6 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/AdasRecognizedResultDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/AdasRecognizedResultDrawer.java @@ -9,6 +9,7 @@ import android.widget.ImageView; import android.widget.TextView; import com.mogo.commons.AbsMogoApplication; +import com.mogo.commons.data.BaseData; import com.mogo.map.MogoLatLng; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.MogoMarkerOptions; @@ -36,7 +37,7 @@ public * * 绘制adas近景识别到的车辆 */ -class AdasRecognizedResultDrawer { +class AdasRecognizedResultDrawer extends BaseDrawer { private static volatile AdasRecognizedResultDrawer sInstance; @@ -183,39 +184,17 @@ class AdasRecognizedResultDrawer { private View inflateView( ADASRecognizedListResult data, boolean machineVision, double curSpeed ) { View rootView = LayoutInflater.from( AbsMogoApplication.getApp() ).inflate( R.layout.module_commons_layout_car, null ); - SafeType safeType = getSafeType( data, curSpeed ); + SafeType safeType = getSafeType( data.distanceX, data.distanceY, data.speed, curSpeed ); TextView tv = rootView.findViewById( R.id.module_commons_marker_car_speed ); tv.setText( safeType.getMsg() ); ImageView iv = rootView.findViewById( R.id.module_commons_marker_car_model ); iv.setImageResource( MarkerResourceManager.getMarkerDrawableResId( machineVision ? VisionMode.Machine : VisionMode.User, AdasRecognizedType.valueFrom( data.type ), - getCarModelType() + getCarModelType(), + safeType ) ); return rootView; } - private SafeType getSafeType( ADASRecognizedListResult data, double curSpeed ) { - if ( data == null ) { - return SafeType.Normal; - } - if ( data.distanceY < 0.5 || data.distanceY < 0.5 ) { - return SafeType.DistanceDangerous; - } - if ( data.speed > curSpeed * 1.5 ) { - return SafeType.SpeedDangerous; - } - if ( data.distanceY < 1 || data.distanceY < 1 ) { - return SafeType.DistanceDangerous; - } - if ( data.speed > curSpeed * 1.1 ) { - return SafeType.DistanceWarm; - } - return SafeType.Normal; - } - - private CarModelType getCarModelType() { - return CarModelType.Self; - } - } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java new file mode 100644 index 0000000000..2976345808 --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java @@ -0,0 +1,72 @@ +package com.mogo.module.common.drawer; + +import com.mogo.module.common.constants.CarModelType; +import com.mogo.module.common.constants.SafeType; + +public +/** + * @author congtaowang + * @since 2020/10/30 + *

+ * 描述 + */ +class BaseDrawer { + + public static final double BOUND_DISTANCE_DANGEROUS = 0.5; + public static final double BOUND_SPEED_DANGEROUS = 1.5; + + public static final double BOUND_DISTANCE_WARM = 1; + public static final double BOUND_SPEED_WARM = 1.1; + + /** + * 安全类型 + * + * @param distance + * @param speed + * @param curSpeed + * @return + */ + protected SafeType getSafeType( double distance, double speed, double curSpeed ) { + if ( distance < BOUND_DISTANCE_DANGEROUS ) { + return SafeType.DistanceDangerous; + } + if ( speed > curSpeed * BOUND_SPEED_DANGEROUS ) { + return SafeType.SpeedDangerous; + } + if ( distance < BOUND_DISTANCE_WARM ) { + return SafeType.DistanceDangerous; + } + if ( speed > curSpeed * BOUND_SPEED_WARM ) { + return SafeType.DistanceWarm; + } + return SafeType.Normal; + } + + + protected SafeType getSafeType( double distanceX, double distanceY, double speed, double curSpeed ) { + if ( distanceX < BOUND_DISTANCE_DANGEROUS || distanceY < BOUND_DISTANCE_DANGEROUS ) { + return SafeType.DistanceDangerous; + } + if ( speed > curSpeed * BOUND_SPEED_DANGEROUS ) { + return SafeType.SpeedDangerous; + } + if ( distanceX < BOUND_DISTANCE_WARM || distanceY < BOUND_DISTANCE_WARM ) { + return SafeType.DistanceWarm; + } + if ( speed > curSpeed * BOUND_SPEED_WARM ) { + return SafeType.SpeedWarm; + } + return SafeType.Normal; + } + + + /** + * 车模 + * + * @return + */ + protected CarModelType getCarModelType() { + // 根据车道、行驶方向等计算出选用哪个车模图片 + return CarModelType.Other; + } +} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java index d3099dfb34..8fea64910c 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java @@ -122,7 +122,9 @@ class MarkerDrawer { if ( !existMap.containsKey( sn ) ) { IMogoMarker dirtyMarker = allMap.get( sn ); allCarsList.remove( dirtyMarker ); - dirtyMarker.destroy(); + if ( dirtyMarker != null ) { + dirtyMarker.destroy(); + } } } allMap.clear(); diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/SnapshotSetDataDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/SnapshotSetDataDrawer.java index a30fe47fe0..dea5549593 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/SnapshotSetDataDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/SnapshotSetDataDrawer.java @@ -1,9 +1,11 @@ package com.mogo.module.common.drawer; import android.content.Context; +import android.graphics.Bitmap; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; @@ -37,7 +39,7 @@ public * * 云端数据绘制 */ -class SnapshotSetDataDrawer { +class SnapshotSetDataDrawer extends BaseDrawer { private static final String TAG = "SnapshotSetDataDrawer"; @@ -110,6 +112,8 @@ class SnapshotSetDataDrawer { continue; } mCloudSnapshotMarkersCaches.put( uniqueKey, marker ); + } else { + marker.setIcon( fromView( inflateView( cloudRoadData, machineVision, data.curSpeed ) ) ); } if ( marker.getObject() instanceof MogoLatLng ) { marker.setPosition( ( ( MogoLatLng ) marker.getObject() ).lat, ( ( MogoLatLng ) marker.getObject() ).lon ); @@ -197,39 +201,41 @@ class SnapshotSetDataDrawer { private View inflateView( CloudRoadData data, boolean machineVision, double curSpeed ) { View rootView = LayoutInflater.from( AbsMogoApplication.getApp() ).inflate( R.layout.module_commons_layout_car, null ); - SafeType safeType = getSafeType( data, curSpeed ); + SafeType safeType = getSafeType( data.getDistance(), data.getSpeed(), curSpeed ); TextView tv = rootView.findViewById( R.id.module_commons_marker_car_speed ); - tv.setText( safeType.getMsg() ); + // 机器视觉展示速度,用户视觉展示安全类型 + tv.setText( machineVision ? String.valueOf( data.getSpeed() ) : safeType.getMsg() ); ImageView iv = rootView.findViewById( R.id.module_commons_marker_car_model ); iv.setImageResource( MarkerResourceManager.getMarkerDrawableResId( machineVision ? VisionMode.Machine : VisionMode.User, AdasRecognizedType.valueFrom( data.getType() ), - getCarModelType() + getCarModelType(), + safeType ) ); return rootView; } - private SafeType getSafeType( CloudRoadData data, double curSpeed ) { - if ( data == null ) { - return SafeType.Normal; - } - if ( data.getDistance() < 0.5 ) { - return SafeType.DistanceDangerous; - } - if ( data.getSpeed() > curSpeed * 1.5 ) { - return SafeType.SpeedDangerous; - } - if ( data.getDistance() < 1 ) { - return SafeType.DistanceDangerous; - } - if ( data.getSpeed() > curSpeed * 1.1 ) { - return SafeType.DistanceWarm; - } - return SafeType.Normal; + private Bitmap fromView( View view ) { + view.setDrawingCacheEnabled( true ); + processChildView( view ); + view.destroyDrawingCache(); + view.measure( View.MeasureSpec.makeMeasureSpec( 0, View.MeasureSpec.UNSPECIFIED ), View.MeasureSpec.makeMeasureSpec( 0, View.MeasureSpec.UNSPECIFIED ) ); + view.layout( 0, 0, view.getMeasuredWidth(), view.getMeasuredHeight() ); + Bitmap bitmap = null; + return ( bitmap = view.getDrawingCache() ) != null ? bitmap.copy( Bitmap.Config.ARGB_8888, false ) : null; } - private CarModelType getCarModelType() { - // 根据车道、行驶方向等计算出选用哪个车模图片 - return CarModelType.Other; + private void processChildView( View view ) { + if ( !( view instanceof ViewGroup ) ) { + if ( view instanceof TextView ) { + ( ( TextView ) view ).setHorizontallyScrolling( false ); + } + + } else { + for ( int var1 = 0; var1 < ( ( ViewGroup ) view ).getChildCount(); ++var1 ) { + processChildView( ( ( ViewGroup ) view ).getChildAt( var1 ) ); + } + + } } } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MarkerResourceManager.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MarkerResourceManager.java index e2bfbf2bf2..6c7aa6cf2b 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MarkerResourceManager.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MarkerResourceManager.java @@ -4,7 +4,9 @@ import com.mogo.commons.AbsMogoApplication; import com.mogo.module.common.R; import com.mogo.module.common.constants.AdasRecognizedType; import com.mogo.module.common.constants.CarModelType; +import com.mogo.module.common.constants.SafeType; import com.mogo.module.common.constants.VisionMode; +import com.mogo.utils.logger.Logger; public /** @@ -15,6 +17,8 @@ public */ class MarkerResourceManager { + private static final String TAG = "MarkerResourceManager"; + /** * @param mode * @param adasRecognizedType @@ -23,7 +27,8 @@ class MarkerResourceManager { */ public static int getMarkerDrawableResId( VisionMode mode, AdasRecognizedType adasRecognizedType, - CarModelType type ) { + CarModelType type, + SafeType safeType ) { if ( mode == null ) { mode = VisionMode.User; } @@ -34,20 +39,31 @@ class MarkerResourceManager { type = CarModelType.Other; } - if ( mode == VisionMode.Machine ) { - return R.drawable.module_common_online_car_vr_machine_middle; + if ( safeType == null ) { + safeType = SafeType.Normal; } StringBuilder builder = new StringBuilder(); builder.append( "module_commons" ) .append( "_" ).append( mode.getRes() ) .append( "_" ).append( adasRecognizedType.getRes() ) - .append( "_" ).append( type.getRes() ); + .append( "_" ).append( type.getRes() ) + .append( "_" ).append( safeType.getRes() ); + + Logger.d( TAG, "res name = %s", builder.toString() ); + int id = AbsMogoApplication.getApp().getResources().getIdentifier( builder.toString(), "drawable", AbsMogoApplication.getApp().getPackageName() ); - return id == 0 ? R.drawable.module_commons_user_car_other : id; + if ( id == 0 ) { + if ( mode == VisionMode.User ) { + return R.drawable.module_commons_user_car_other_normal; + } else { + return R.drawable.module_commons_machine_car_other_normal; + } + } + return id; } } diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_left_normal.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_left_normal.png new file mode 100755 index 0000000000..b92447c45e Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_left_normal.png differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_left_reverse_normal.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_left_reverse_normal.png new file mode 100755 index 0000000000..b92447c45e Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_left_reverse_normal.png differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_normal.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_normal.png new file mode 100755 index 0000000000..8278fb5fe6 Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_normal.png differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_reverse_normal.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_reverse_normal.png new file mode 100755 index 0000000000..8278fb5fe6 Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_reverse_normal.png differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_right_normal.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_right_normal.png new file mode 100755 index 0000000000..56081c308c Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_right_normal.png differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_right_reverse_normal.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_right_reverse_normal.png new file mode 100755 index 0000000000..56081c308c Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_machine_car_other_right_reverse_normal.png differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_dangerous.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_dangerous.png new file mode 100644 index 0000000000..07e90599a9 Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_dangerous.png differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left_normal.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left.png rename to modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left_normal.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left_normal_dangerous.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left_normal_dangerous.png new file mode 100644 index 0000000000..862d30edd7 Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left_normal_dangerous.png differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left_reverse_dangerous.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left_reverse_dangerous.png new file mode 100644 index 0000000000..7a770fac99 Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left_reverse_dangerous.png differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left_reverse.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left_reverse_normal.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left_reverse.png rename to modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_left_reverse_normal.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_normal.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other.png rename to modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_normal.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_reverse_dangerous.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_reverse_dangerous.png new file mode 100644 index 0000000000..ecd5fdef07 Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_reverse_dangerous.png differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_reverse.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_reverse_normal.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_reverse.png rename to modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_reverse_normal.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right_dangerous.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right_dangerous.png new file mode 100644 index 0000000000..f6486f2e3f Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right_dangerous.png differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right_normal.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right.png rename to modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right_normal.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right_reverse_dangerous.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right_reverse_dangerous.png new file mode 100644 index 0000000000..a6db05eea4 Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right_reverse_dangerous.png differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right_reverse.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right_reverse_normal.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right_reverse.png rename to modules/mogo-module-common/src/main/res/drawable-xhdpi/module_commons_user_car_other_right_reverse_normal.png diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/vrmode/VrModeController.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/vrmode/VrModeController.java index 6f8521dab3..97f52cf54d 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/vrmode/VrModeController.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/vrmode/VrModeController.java @@ -50,6 +50,8 @@ class VrModeController { return sInstance; } + private boolean mIsBinding = false; + public void onVrModeChanged( boolean isVrMode ) { if ( isVrMode ) { bindVrModeService(); @@ -59,6 +61,10 @@ class VrModeController { } private void bindVrModeService() { + if ( mIsBinding ) { + return; + } + mIsBinding = true; Intent intent = new Intent(); intent.setComponent( new ComponentName( "com.mogo.launcher.f", "com.mogo.module.machine.vision.MachineVisionMapService" ) ); AbsMogoApplication.getApp().bindService( intent, mServiceConnection = new ServiceConnection() { @@ -85,6 +91,7 @@ class VrModeController { } private void unbindVrModeService() { + mIsBinding = false; if ( mServiceConnection != null ) { try { AbsMogoApplication.getApp().unbindService( mServiceConnection ); diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/websocket/LocationResult.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/websocket/LocationResult.java index 4b8d133085..98ea2be926 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/websocket/LocationResult.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/websocket/LocationResult.java @@ -13,9 +13,23 @@ public */ class LocationResult { + /** + * sn + */ public String sn; + + /** + * 最后一个定位点的莫顿码 + */ public long mortonCode; + /** + * 最后一个定位点 + */ public CloudLocationInfo lastCoordinate; + + /** + * 1s 内的连续定位点 + */ public List< CloudLocationInfo > coordinates; } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/websocket/OnePerSecondSendContent.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/websocket/OnePerSecondSendContent.java index 16cf7f4798..9324bc2b52 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/websocket/OnePerSecondSendContent.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/websocket/OnePerSecondSendContent.java @@ -13,6 +13,13 @@ public */ class OnePerSecondSendContent { + /** + * 自车定位点 + */ public LocationResult self; + + /** + * adas 识别物体:1s 识别到的最后帧 + */ public List< ADASRecognizedResult > adas; } diff --git a/modules/mogo-modules-mvision/src/main/java/com/mogo/module/machine/vision/MachineVisionMapService.java b/modules/mogo-modules-mvision/src/main/java/com/mogo/module/machine/vision/MachineVisionMapService.java index a177659e42..7bb820473b 100644 --- a/modules/mogo-modules-mvision/src/main/java/com/mogo/module/machine/vision/MachineVisionMapService.java +++ b/modules/mogo-modules-mvision/src/main/java/com/mogo/module/machine/vision/MachineVisionMapService.java @@ -164,6 +164,7 @@ class MachineVisionMapService extends Service { mMapView.setLayoutParams(mMapView.getLayoutParams()); mMachineVisionMapViewManager.exchangeSizeAndPosition(width, height, x, y); + Logger.d(TAG, "zoom out map view"); }); } diff --git a/modules/mogo-modules-mvision/src/main/java/com/mogo/module/machine/vision/MachineVisionMapView.java b/modules/mogo-modules-mvision/src/main/java/com/mogo/module/machine/vision/MachineVisionMapView.java index e85354580c..2410e87788 100644 --- a/modules/mogo-modules-mvision/src/main/java/com/mogo/module/machine/vision/MachineVisionMapView.java +++ b/modules/mogo-modules-mvision/src/main/java/com/mogo/module/machine/vision/MachineVisionMapView.java @@ -56,7 +56,6 @@ class MachineVisionMapView extends MogoBaseMapView { onCreate( null ); postDelayed( ()->{ getMap().getUIController().showMyLocation( true ); - getMap().getUIController().setAnchorScale( 1, 2.5f ); }, 1000 ); } diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/adas/entity/ADASRecognizedListResult.java b/services/mogo-service-api/src/main/java/com/mogo/service/adas/entity/ADASRecognizedListResult.java index 8ac2e16ceb..7196126e4b 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/adas/entity/ADASRecognizedListResult.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/adas/entity/ADASRecognizedListResult.java @@ -11,12 +11,36 @@ public */ class ADASRecognizedListResult { + /** + * 识别物体类型 + */ public int type; + + /** + * 识别物体唯一标识 + */ public String uuid; + /** + * 方向 + */ public double heading; + /** + * 速度 + */ public double speed; + /** + * x 轴距离 + */ public double distanceX; + + /** + * y 轴距离 + */ public double distanceY; + + /** + * 同一个uuid 1s内所对应的连续坐标 + */ public List< LatLon > latLonList; public static class LatLon { diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/adas/entity/ADASRecognizedResult.java b/services/mogo-service-api/src/main/java/com/mogo/service/adas/entity/ADASRecognizedResult.java index e2e870ddb6..774eff545a 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/adas/entity/ADASRecognizedResult.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/adas/entity/ADASRecognizedResult.java @@ -9,17 +9,64 @@ public */ class ADASRecognizedResult { + /** + * 识别物体类型 + */ public int type; + + /** + * 识别物体唯一标识 + */ public String uuid; + + /** + * 红绿灯颜色 + */ public String color; - public String cardId; + + /** + * + */ + public String carId; + + /** + * 识别物体的纬度 + */ public double lat; + + /** + * 识别物体的经度 + */ public double lon; + + /** + * 朝向 + */ public double heading; + + /** + * 系统时间 + */ public long systemTime; + + /** + * 定位卫星时间 + */ public long satelliteTime; + + /** + * 海拔 + */ public double alt; + + /** + * 速度 + */ public double speed; + + /** + * 莫顿码 + */ public long mortonCode; } diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/AdasObjectUtils.java b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/AdasObjectUtils.java index ab47038f90..8ea296d4a5 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/AdasObjectUtils.java +++ b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/AdasObjectUtils.java @@ -9,7 +9,6 @@ import com.zhidao.support.adas.high.bean.WarnMessageInfo; import java.util.ArrayList; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; @@ -74,7 +73,7 @@ class AdasObjectUtils { result.alt = rectBean.getAlt(); result.color = rectBean.getColor(); result.speed = rectBean.getSpeed(); - result.cardId = rectBean.getCarId(); + result.carId = rectBean.getCarId(); result.mortonCode = MortonCode.wrapEncodeMorton( result.lon, result.lat ); return result; }