opt
This commit is contained in:
@@ -293,7 +293,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void setAdasRecognizedResult(String result) {
|
||||
Log.d("liyz", "------- setAdasRecognizedResult ------>");
|
||||
Log.d("liyz", "------- setAdasRecognizedResult ------>result = " + result);
|
||||
mAdasResultConvert = GsonUtil.objectFromJson(result, ADASRecognizedResultConvert.class);
|
||||
}
|
||||
|
||||
@@ -773,15 +773,15 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
if (mSelfMarker == null) { //TODO mAdasResultConvert
|
||||
Log.d("liyz", "-------1------>");
|
||||
// Log.d("liyz", "-------1------>");
|
||||
try {
|
||||
mSelfMarker = mMapView.getMapAutoViewHelper().getMyLocationStyle().getSelfMarker();
|
||||
mSelfMarker.setInfoWindowEnable(true);
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
} else {
|
||||
Log.d("liyz", "-------2------>");
|
||||
// } else {
|
||||
// Log.d("liyz", "-------2------>");
|
||||
// mSelfMarker.marker3DIcon(R.raw.people);
|
||||
// WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
// mSelfMarker.marker3DIcon(R.raw.people);
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description adas识别数据需要转换一下
|
||||
* @since 2021/4/23
|
||||
*/
|
||||
public class ADASRecognizedResultConvert {
|
||||
|
||||
/**
|
||||
* 识别物体类型
|
||||
*/
|
||||
public int type;
|
||||
|
||||
/**
|
||||
* 识别物体唯一标识
|
||||
*/
|
||||
public String uuid;
|
||||
|
||||
/**
|
||||
* 红绿灯颜色
|
||||
*/
|
||||
public String color;
|
||||
|
||||
/**
|
||||
* 车ID
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
* 实际距离
|
||||
* 使用distanceX和distanceY计算
|
||||
*/
|
||||
public double distance;
|
||||
|
||||
/**
|
||||
* 数据来源精度
|
||||
* 0:普通定位
|
||||
* 1:高精定位
|
||||
*/
|
||||
public int dataAccuracy;
|
||||
|
||||
/**
|
||||
* 道路ID
|
||||
*/
|
||||
private String roadId;
|
||||
|
||||
/**
|
||||
* 车道ID-2D路段
|
||||
*/
|
||||
private String laneId;
|
||||
|
||||
/**
|
||||
* 车道号:中心线编号为0,中心线右侧编号为负数,3车道通行Road的车道编号,0,-1,-2,-3
|
||||
*/
|
||||
private int laneNum;
|
||||
|
||||
/**
|
||||
* 限速
|
||||
*/
|
||||
private double rateLimiting;
|
||||
|
||||
/**
|
||||
* 车道宽度
|
||||
*/
|
||||
private double roadWidth;
|
||||
}
|
||||
@@ -271,8 +271,6 @@ public class MediaWindow implements MediaView{
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if (mWindowPlayPause != null){
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
|
||||
@@ -78,8 +78,7 @@ import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_
|
||||
public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
IMogoOnMessageListener< MarkerResponse >,
|
||||
IMogoBizActionDoneListener,
|
||||
IMogoADASControlStatusChangedListener,
|
||||
IMogoCarLocationChangedListener2 {
|
||||
IMogoADASControlStatusChangedListener {
|
||||
private static final String TAG = "MapMarkerManager";
|
||||
|
||||
private Context mContext;
|
||||
@@ -126,7 +125,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
CloudPoiManager.getInstance().updateFromConfig( context );
|
||||
MarkerServiceHandler.getActionManager().registerBizActionDoneListener( this );
|
||||
MarkerServiceHandler.getApis().getRegisterCenterApi().registerADASControlStatusChangedListener( TAG, this );
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerCarLocationChangedListener(TAG, this);
|
||||
|
||||
if ( CallChatApi.getInstance().getApiProvider() != null ) {
|
||||
CallChatApi.getInstance().getApiProvider().registerUserWindowStatusListener( TAG, mContext, new ICallChatResponse() {
|
||||
|
||||
@@ -166,79 +165,20 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
MarkerServiceHandler.getApis().getAdasControllerApi().addAdasRecognizedDataCallback( resultList -> {
|
||||
// 绘制近景识别到的车辆
|
||||
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( resultList );
|
||||
//绘制他车的线 liyz TODO
|
||||
//绘制他车的线 liyz
|
||||
|
||||
//添加自车的定位图标,碰撞只有一个预警 TODO
|
||||
ADASRecognizedResult result = null;
|
||||
for (int i = 0; i < resultList.size(); i++) {
|
||||
result = resultList.get(i);
|
||||
}
|
||||
|
||||
//通过这个传值 ADASRecognizedResult
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().setAdasRecognizedResult(GsonUtil.jsonFromObject(result));
|
||||
// ADASRecognizedResult result = null;
|
||||
// for (int i = 0; i < resultList.size(); i++) {
|
||||
// result = resultList.get(i);
|
||||
// }
|
||||
//
|
||||
// //通过这个传值 ADASRecognizedResult
|
||||
// MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().setAdasRecognizedResult(GsonUtil.jsonFromObject(result));
|
||||
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location latLng) {
|
||||
Log.d("liyz", "long =" + latLng.getLongitude() + "---lat = " + latLng.getLatitude());
|
||||
MarkerLocation location = new MarkerLocation();
|
||||
location.setLat(latLng.getLatitude());
|
||||
location.setLon(latLng.getLongitude());
|
||||
|
||||
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
markerShowEntity.setMarkerLocation(location);
|
||||
markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA);
|
||||
|
||||
IMogoMarker marker = drawMarker(markerShowEntity);
|
||||
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
int resId = getModelRes(6);
|
||||
marker.use3DResource( resId );
|
||||
}, 10000);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MogoLatLng latLng) {
|
||||
|
||||
}
|
||||
|
||||
public IMogoMarker drawMarker(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(6)); //TODO
|
||||
|
||||
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
iMarkerView.setMarker(marker);
|
||||
marker.setToTop();
|
||||
|
||||
return marker;
|
||||
}
|
||||
|
||||
public int getModelRes(int type) {
|
||||
AdasRecognizedType recognizedType = AdasRecognizedType.valueFrom(type);
|
||||
if (recognizedType == AdasRecognizedType.classIdCar
|
||||
|| recognizedType == AdasRecognizedType.classIdTrafficTruck) {
|
||||
return com.mogo.module.common.R.raw.othercar;
|
||||
} else if (recognizedType == AdasRecognizedType.classIdTrafficBus) {
|
||||
return com.mogo.module.common.R.raw.bus;
|
||||
} else if (recognizedType == AdasRecognizedType.classIdBicycle
|
||||
|| recognizedType == AdasRecognizedType.classIdMoto) {
|
||||
return com.mogo.module.common.R.raw.motorbike;
|
||||
} else if (recognizedType == AdasRecognizedType.classIdStopLine) {
|
||||
return com.mogo.module.common.R.raw.stopline;
|
||||
} else if (recognizedType == AdasRecognizedType.classIdWarningArrows) {
|
||||
return com.mogo.module.common.R.raw.arraw;
|
||||
}
|
||||
return com.mogo.module.common.R.raw.people;
|
||||
}
|
||||
|
||||
private Handler mSnapshotHandler = new Handler( WorkThreadHandler.newInstance( "snapshot-thread" ).getLooper() ) {
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
|
||||
Reference in New Issue
Block a user