merge origin dev2_aiSdk

This commit is contained in:
zhongchao
2021-04-23 15:59:06 +08:00
76 changed files with 489 additions and 845 deletions

View File

@@ -23,7 +23,11 @@ enum AdasRecognizedType {
//bus
classIdTrafficBus( "traffic_bus", 6 ),
//truck
classIdTrafficTruck( "traffic_truck", 8 );
classIdTrafficTruck( "traffic_truck", 8 ),
//stopLine
classIdStopLine("warning_stop_line",9),
//预警箭头
classIdWarningArrows("warning_arrows",10);
AdasRecognizedType( int code ) {
this.code = code;
@@ -38,7 +42,7 @@ enum AdasRecognizedType {
}
public static AdasRecognizedType[] VAL = {
classIdBackground,
classIdBackground,//0
classIdPerson,
classIdBicycle,
classIdCar,
@@ -47,6 +51,8 @@ enum AdasRecognizedType {
classIdTrafficBus,
null,
classIdTrafficTruck,
classIdStopLine,
classIdWarningArrows,
};
public String getRes() {

View File

@@ -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";

View File

@@ -226,6 +226,10 @@ class BaseDrawer {
} else if (recognizedType == AdasRecognizedType.classIdBicycle
|| recognizedType == AdasRecognizedType.classIdMoto) {
return R.raw.motorbike;
} else if (recognizedType == AdasRecognizedType.classIdStopLine) {
return R.raw.stopline;
} else if (recognizedType == AdasRecognizedType.classIdWarningArrows) {
return R.raw.arraw;
}
return R.raw.people;
}

View File

@@ -1,6 +1,7 @@
package com.mogo.module.common.drawer;
import android.util.Log;
import android.widget.LinearLayout;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
@@ -21,6 +22,9 @@ import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.ViewUtils;
import com.mogo.utils.logger.Logger;
import java.util.ArrayList;
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;
@@ -87,8 +91,8 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
MogoLatLng mogoLatLng = new MogoLatLng(data.getCollisionLat(), data.getCollisionLon());
//2D资源图片位置调整
MogoLatLng stopLineNew = Trigonometric.getNewLocation(data.getStopLines().get(1), 8, 180);
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 8, 180);
MogoLatLng stopLineNew = Trigonometric.getNewLocation(data.getStopLines().get(1), 5, 180);
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 5, 180);
IMogoMarker marker = drawMarker(markerShowEntity);
Log.d("liyz", "renderWarnData marker != null direction = " + data.getDirection());
@@ -115,7 +119,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
.latitude(markerShowEntity.getMarkerLocation().getLat())
.longitude(markerShowEntity.getMarkerLocation().getLon());
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
options.icon3DRes(getModelRes(2)); //TODO
options.icon3DRes(getModelRes(1)); //TODO
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
@@ -125,18 +129,17 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
return marker;
}
public void drawerMarkerWithLocation(MarkerShowEntity markerShowEntity, MogoLatLng location) {
public void drawerArrowsMarkerWithLocation(MogoLatLng location, String markerType, int type, int rotate) {
MogoMarkerOptions options = new MogoMarkerOptions()
.object(markerShowEntity)
.latitude(location.getLat())
.longitude(location.getLon());
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
options.icon3DRes(getModelRes(2)); //TODO
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
iMarkerView.setMarker(marker);
marker.setToTop();
.longitude(location.getLon())
.set3DMode(true)
.controlAngle(true)
.icon3DRes(getModelRes(type))
.anchorColor("#FB3C3CFF")
.flat(true);
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerType, options);
marker.setRotateAngle(rotate);
}
/*
@@ -144,7 +147,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
* */
private IMogoMarker drawMarkerWith2Resource(MarkerShowEntity markerShowEntity) {
MogoLatLng mogoLatLng = new MogoLatLng(markerShowEntity.getMarkerLocation().getLat(), markerShowEntity.getMarkerLocation().getLon());
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 8, 180);
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 5, 180);
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
.latitude(newLocation.getLat())
.longitude(newLocation.getLon())
@@ -182,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(1)); //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();