Merge remote-tracking branch 'origin/dev2_aiSdk' into dev2_aiSdk

This commit is contained in:
tongchenfei
2021-03-03 11:43:52 +08:00
9 changed files with 51 additions and 34 deletions

View File

@@ -67,7 +67,7 @@ dependencies {
implementation project(':foudations:mogo-commons')
}
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.1.7'
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.1.8'
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-test-3.4'
}

View File

@@ -54,6 +54,7 @@ import com.zhidaoauto.map.sdk.open.location.RTKAutopilotLocationBean;
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory;
import com.zhidaoauto.map.sdk.open.marker.Marker;
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions;
import com.zhidaoauto.map.sdk.open.marker.MultiPointOverlayOptions;
import com.zhidaoauto.map.sdk.open.marker.OnInfoWindowClickListener;
import com.zhidaoauto.map.sdk.open.marker.OnMarkClickListener;
import com.zhidaoauto.map.sdk.open.query.LonLatPoint;
@@ -1022,20 +1023,29 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public double[] matchRoad( double lon, double lat, double angle, boolean isGpsLocation, boolean isRTK ) {
SinglePointRoadInfo singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad( ( ( float ) lon ), ( ( float ) lat ), ( ( float ) angle ), isGpsLocation, isRTK );
double wgs[] = CoordinateUtils.transformGcj02toWgs84( lat, lon );
SinglePointRoadInfo singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad( ( ( float ) wgs[0] ), ( ( float ) wgs[1] ), ( ( float ) angle ), isGpsLocation, isRTK );
if ( singlePointRoadInfo != null
&& singlePointRoadInfo.getCoords() != null
&& !singlePointRoadInfo.getCoords().isEmpty() ) {
double matchedPoint[] = PointInterpolatorUtil.mergeToRoad( lon, lat, singlePointRoadInfo.getCoords() );
double matchedPoint[] = PointInterpolatorUtil.mergeToRoad( wgs[0], wgs[1], singlePointRoadInfo.getCoords() );
// return CoordinateUtils.transformWgsToGcj( matchedPoint[1], matchedPoint[0] );
matchedPoint = CoordinateUtils.transformWgsToGcj( matchedPoint[1], matchedPoint[0] );
MarkerOptions options
= new MarkerOptions( );
options.markerIcon( R.drawable.marker_blue )
.position( new LonLatPoint( matchedPoint[0],matchedPoint[1] ) )
= new MarkerOptions();
options.markerIcon( R.drawable.red )
.position( new LonLatPoint( matchedPoint[0], matchedPoint[1] ) )
.setGps( false );
mMapView.getMapAutoViewHelper().addMarker( options );
MarkerOptions options2
= new MarkerOptions();
options2.markerIcon( R.drawable.blue )
.position( new LonLatPoint( lon, lat ) )
.setGps( true );
mMapView.getMapAutoViewHelper().addMarker( options2 );
return matchedPoint;
}
return null;

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

View File

@@ -93,16 +93,16 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
}
final long start = System.currentTimeMillis();
double[] matchedPoint = matchRoad( recognizedListResult.lon,
recognizedListResult.lat,
recognizedListResult.heading,
recognizedListResult.dataAccuracy == 1
);
Log.i("match-road-timer", "cost " + (System.currentTimeMillis() - start) + "ms");
if ( matchedPoint != null ) {
recognizedListResult.lon = matchedPoint[0];
recognizedListResult.lat = matchedPoint[1];
}
// double[] matchedPoint = matchRoad( recognizedListResult.lon,
// recognizedListResult.lat,
// recognizedListResult.heading,
// recognizedListResult.dataAccuracy == 1
// );
// Log.i("match-road-timer", "cost " + (System.currentTimeMillis() - start) + "ms");
// if ( matchedPoint != null ) {
// recognizedListResult.lon = matchedPoint[0];
// recognizedListResult.lat = matchedPoint[1];
// }
IMogoMarker marker = mAdasRecognizedMarkersCaches.remove( uniqueKey );

View File

@@ -190,11 +190,10 @@ class BaseDrawer {
* @return
*/
protected double[] matchRoad( double lon, double lat, double angle, boolean isRtk ) {
double wgs[] = CoordinateUtils.transformGcj02toWgs84( lat, lon );
return MogoApisHandler.getInstance()
.getApis()
.getMapServiceApi()
.getMapUIController()
.matchRoad( wgs[0], wgs[1], angle, true, isRtk );
.matchRoad( lon, lat, angle, true, isRtk );
}
}

View File

@@ -160,15 +160,15 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
continue;
}
double[] matchedPoint = matchRoad( cloudRoadData.getLon(),
cloudRoadData.getLat(),
cloudRoadData.getHeading(),
true
);
if ( matchedPoint != null ) {
cloudRoadData.setLon( matchedPoint[0] );
cloudRoadData.setLat( matchedPoint[1] );
}
// double[] matchedPoint = matchRoad( cloudRoadData.getLon(),
// cloudRoadData.getLat(),
// cloudRoadData.getHeading(),
// true
// );
// if ( matchedPoint != null ) {
// cloudRoadData.setLon( matchedPoint[0] );
// cloudRoadData.setLat( matchedPoint[1] );
// }
IMogoMarker marker = mCloudSnapshotMarkersCaches.remove( uniqueKey );
CloudRoadData lastPosition = mLastPositions.put( uniqueKey, cloudRoadData );

File diff suppressed because one or more lines are too long

View File

@@ -556,9 +556,9 @@ public class MockIntentHandler implements IntentHandler {
SnapshotSetDataDrawer.getInstance().renderSnapshotData( GsonUtil.objectFromJson( json, MogoSnapshotSetData.class ) );
break;
case 47:
mLocationMockHandler.sendEmptyMessageDelayed( 1, 100L );
mLocationMockHandler.sendEmptyMessageDelayed( 2, 200L );
// mLocationMockHandler.sendEmptyMessageDelayed( 3, 100L );
mLocationMockHandler.sendEmptyMessageDelayed( 1, 200L );
mLocationMockHandler2.sendEmptyMessageDelayed( 2, 0 );
// mLocationMockHandler.sendEmptyMessageDelayed( 3, 300L );
break;
}
}
@@ -601,7 +601,15 @@ public class MockIntentHandler implements IntentHandler {
}
br = null;
}
} else if ( msg.what == 2 ) {
}
}
};
private Handler mLocationMockHandler2 = new Handler( WorkThreadHandler.newInstance( "loc-mock-thread2" ).getLooper() ) {
@Override
public void handleMessage( Message msg ) {
super.handleMessage( msg );
if ( msg.what == 2 ) {
try {
handleMockSnapshotIntent();
} catch ( Exception e ) {
@@ -670,7 +678,7 @@ public class MockIntentHandler implements IntentHandler {
final long start = System.currentTimeMillis();
SnapshotSetDataDrawer.getInstance().renderSnapshotData( data );
Log.i( "mock-timer-snapshot", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
mLocationMockHandler.sendEmptyMessageDelayed( 2, 100L );
mLocationMockHandler2.sendEmptyMessageDelayed( 2, 100L );
return true;
}
@@ -697,7 +705,7 @@ public class MockIntentHandler implements IntentHandler {
final long start = System.currentTimeMillis();
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( allList );
Log.i( "mock-timer-adas", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
mLocationMockHandler.sendEmptyMessageDelayed( 3, 200L );
mLocationMockHandler2.sendEmptyMessageDelayed( 3, 100L );
return true;
}