Merge branch 'qa_merge_shunyi_vr_map' into qa_1.1.9
This commit is contained in:
@@ -67,7 +67,7 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.7.4'
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.7.7'
|
||||
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.4.5-log-1'
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
private boolean mIsVrMode = false;
|
||||
|
||||
private long mLastReceiveTime = 0L;
|
||||
private long mAnimationDuration = 500L;
|
||||
|
||||
/**
|
||||
* 其他车辆、rsu 车辆数据
|
||||
@@ -84,6 +85,12 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
*/
|
||||
public void renderSnapshotData( MogoSnapshotSetData data,
|
||||
boolean machineVision ) {
|
||||
if ( mLastReceiveTime != 0 ) {
|
||||
mAnimationDuration = SystemClock.elapsedRealtime() - mLastReceiveTime;
|
||||
} else {
|
||||
mAnimationDuration = 500L;
|
||||
}
|
||||
mLastReceiveTime = SystemClock.elapsedRealtime();
|
||||
if ( data == null || (
|
||||
( data.getAllList() == null || data.getAllList().isEmpty() ) &&
|
||||
( data.getNearList() == null || data.getNearList().isEmpty() ) ) ) {
|
||||
@@ -128,9 +135,11 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
if ( mIsVrMode != MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
mIsVrMode = MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode();
|
||||
if ( mIsVrMode ) {
|
||||
Logger.d( TAG, "3D模型" );
|
||||
marker.getMogoMarkerOptions().set3DMode( true );
|
||||
marker.use3DResource( getVrModel( cloudRoadData ) );
|
||||
} else {
|
||||
Logger.d( TAG, "2D贴图" );
|
||||
marker.getMogoMarkerOptions().set3DMode( false );
|
||||
marker.setIcon( ViewUtils.fromView( inflateView( cloudRoadData, machineVision, 0 ) ) );
|
||||
}
|
||||
@@ -141,12 +150,14 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
// double lastPos[] = transformGcj02ToFitMap( lastPosition.lat, lastPosition.lon );
|
||||
if ( lastPosition != null ) {
|
||||
if ( lastPosition.equals( target ) ) {
|
||||
Logger.d( TAG, "保持位置 - %s", uniqueKey );
|
||||
marker.setPosition( lastPosition.lat, lastPosition.lon );
|
||||
} else {
|
||||
List< MogoLatLng > points = new ArrayList<>();
|
||||
points.add( new MogoLatLng( lastPosition.lat, lastPosition.lon ) );
|
||||
points.add( new MogoLatLng( target.lat, target.lon ) );
|
||||
marker.startSmoothInMs( points, 1000 );
|
||||
marker.startSmoothInMs( points, mAnimationDuration );
|
||||
Logger.d( TAG, "平滑移动 - %s duration = %s", uniqueKey, mAnimationDuration );
|
||||
}
|
||||
} else {
|
||||
marker.setRotateAngle( 360 - ( float ) cloudRoadData.getHeading() );
|
||||
@@ -154,7 +165,6 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
}
|
||||
}
|
||||
mLastPositions.put( uniqueKey, target );
|
||||
mLastReceiveTime = SystemClock.elapsedRealtime();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,9 +255,11 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
.position( new MogoLatLng( data.getLat(), data.getLon() ) );
|
||||
if ( mIsVrMode = MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
options.set3DMode( true );
|
||||
Logger.d( TAG, "3D模型" );
|
||||
options.icon3DRes( getVrModel( data ) );
|
||||
} else {
|
||||
options.set3DMode( false );
|
||||
Logger.d( TAG, "2D贴图" );
|
||||
options.icon( inflateView( data, machineVision, curSpeed ) );
|
||||
}
|
||||
return MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( mContext ).addMarker( DataTypes.TYPE_MARKER_CLOUD_DATA, options );
|
||||
|
||||
@@ -159,14 +159,14 @@ public class EventDispatchCenter implements
|
||||
this.mMapLoadedCallback = callback;
|
||||
}
|
||||
|
||||
private boolean mIsMapLoaded = false;
|
||||
// private boolean mIsMapLoaded = false;
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
if ( mIsMapLoaded ) {
|
||||
return;
|
||||
}
|
||||
mIsMapLoaded = true;
|
||||
// if ( mIsMapLoaded ) {
|
||||
// return;
|
||||
// }
|
||||
// mIsMapLoaded = true;
|
||||
if ( mMapLoadedCallback != null ) {
|
||||
mMapLoadedCallback.run();
|
||||
mMapLoadedCallback = null;
|
||||
|
||||
@@ -161,13 +161,16 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
if ( data == null ) {
|
||||
return;
|
||||
}
|
||||
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
// return;
|
||||
}
|
||||
|
||||
if ( MogoServices.getInstance().getLastCarLocation() != null ) {
|
||||
data.curSpeed = MogoServices.getInstance().getLastCarLocation().getSpeed();
|
||||
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageLaunched() ) {
|
||||
return;
|
||||
}
|
||||
// if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
//// return;
|
||||
// }
|
||||
//
|
||||
// if ( MogoServices.getInstance().getLastCarLocation() != null ) {
|
||||
// data.curSpeed = MogoServices.getInstance().getLastCarLocation().getSpeed();
|
||||
// }
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData( data, false );
|
||||
// VrModeController.getInstance().renderMogoSnapshotSetData( data );
|
||||
}
|
||||
|
||||
@@ -90,13 +90,13 @@ class SnapshotUploadInTime implements MogoRTKLocation.RTKLocationListener {
|
||||
locationResult.lastCoordinate = lastInfo;
|
||||
locationResult.mortonCode = MortonCode.wrapEncodeMorton( lastInfo.getLon(), lastInfo.getLat() );
|
||||
}
|
||||
locationResult.coordinates = new ArrayList<>();
|
||||
// locationResult.coordinates = new ArrayList<>();
|
||||
locationResult.sn = com.mogo.commons.network.Utils.getSn();
|
||||
if ( cloudLocationInfo == null ) {
|
||||
locationResult.coordinates.addAll( new ArrayList<>() );
|
||||
} else {
|
||||
locationResult.coordinates.addAll( cloudLocationInfo );
|
||||
}
|
||||
// if ( cloudLocationInfo == null ) {
|
||||
// locationResult.coordinates.addAll( new ArrayList<>() );
|
||||
// } else {
|
||||
// locationResult.coordinates.addAll( cloudLocationInfo );
|
||||
// }
|
||||
}
|
||||
List< ADASRecognizedResult > recognizedResults = MarkerServiceHandler.getADASController().getLastADASRecognizedResult();
|
||||
OnePerSecondSendContent content = new OnePerSecondSendContent();
|
||||
|
||||
@@ -179,6 +179,9 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
|
||||
private void invokeCallbackPerSecond( List< RectInfo > data ) {
|
||||
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageLaunched() ) {
|
||||
return;
|
||||
}
|
||||
List< RectInfo > newRef = data;
|
||||
List< ADASRecognizedListResult > recognizedListResults = AdasObjectUtils.regroupData( newRef );
|
||||
if ( recognizedListResults == null || recognizedListResults.isEmpty() ) {
|
||||
|
||||
Reference in New Issue
Block a user