Merge branch 'qa_merge_shunyi_vr_map' into dev2

This commit is contained in:
wangcongtao
2021-01-14 14:17:59 +08:00
12 changed files with 89 additions and 57 deletions

1
.idea/gradle.xml generated
View File

@@ -84,7 +84,6 @@
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

View File

@@ -34,7 +34,7 @@ ext {
// 地图
amapnavi3dmap : "com.amap.api:navi-3dmap:7.2.0_3dmap7.2.0",
amapsearch : "com.amap.api:search:7.1.0",
amaplocation : "com.amap.api:location:4.9.0",
amaplocation : "com.amap.api:location:5.2.0",
// json 转换
gson : "com.google.code.gson:gson:2.8.4",
// 内存泄漏检测

View File

@@ -67,8 +67,8 @@ dependencies {
implementation project(':foudations:mogo-commons')
}
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.8.1'
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.4.5-log-1'
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.8.7'
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-test-3.4'
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -41,6 +41,7 @@ import com.zhidaoauto.map.sdk.open.camera.CameraUpdateFactory;
import com.zhidaoauto.map.sdk.open.camera.LatLngBounds;
import com.zhidaoauto.map.sdk.open.location.LocationListener;
import com.zhidaoauto.map.sdk.open.location.MyLocationStyle;
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.OnMarkClickListener;
@@ -51,6 +52,7 @@ import com.zhidaoauto.map.sdk.open.view.MapAutoViewHelper;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.json.JSONObject;
import java.util.List;
@@ -912,4 +914,35 @@ public class AMapViewWrapper implements IMogoMapView,
Logger.e( TAG, e, "rtkEnable" );
}
}
@Override
public void syncLocation2Map( JSONObject data ) {
if ( !checkAMapView() ) {
return;
}
if ( data == null ) {
Logger.d( TAG, "停止使用rtk定位数据" );
mMapView.getLocationClient().stopAutoPilotRTK();
return;
}
double lon = data.optDouble( "lon", -1 );
double lat = data.optDouble( "lat", -1 );
double alt = data.optDouble( "alt", -1 );
double heading = data.optDouble( "heading", -1 );
double acceleration = data.optDouble( "acceleration", -1 );
double yawRate = data.optDouble( "yawRate", -1 );
if ( lon == -1 ) {
return;
}
RTKAutopilotLocationBean bean = new RTKAutopilotLocationBean();
bean.setYaw_rate( yawRate );
bean.setHeading( heading );
bean.setHeading( heading );
bean.setAcceleration( acceleration );
bean.setAlt( alt );
bean.setLon( lon );
bean.setLat( lat );
mMapView.getLocationClient().updateRTKAutoPilotLocation( bean );
Logger.d( TAG, "使用rtk定位数据" );
}
}

View File

@@ -14,6 +14,8 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.map.uicontroller.MapControlResult;
import org.json.JSONObject;
import java.util.List;
/**
@@ -296,4 +298,11 @@ public class AMapUIController implements IMogoMapUIController {
mClient.rtkEnable( enable );
}
}
@Override
public void syncLocation2Map( JSONObject data ) {
if ( mClient != null ) {
mClient.syncLocation2Map( data );
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -13,6 +13,8 @@ import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
import org.json.JSONObject;
import java.util.List;
/**
@@ -254,4 +256,8 @@ public interface IMogoMapUIController {
default void destroy(){
}
default void syncLocation2Map( JSONObject data ){
}
}

View File

@@ -15,6 +15,8 @@ import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.map.uicontroller.MapControlResult;
import com.mogo.utils.logger.Logger;
import org.json.JSONObject;
import java.util.List;
/**
@@ -325,6 +327,14 @@ public class MogoMapUIController implements IMogoMapUIController {
}
}
@Override
public void syncLocation2Map( JSONObject data ) {
initDelegate();
if ( mDelegate != null ) {
mDelegate.syncLocation2Map( data );
}
}
@Override
public void destroy() {
mDelegate = null;

View File

@@ -2,20 +2,16 @@ package com.mogo.module.service.intent;
import android.content.Context;
import android.content.Intent;
import android.location.Location;
import android.location.LocationManager;
import android.text.TextUtils;
import android.view.View;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.R;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.service.carinfo.CarStateInfo;
import com.mogo.module.service.receiver.MogoReceiver;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.network.utils.GsonUtil;
import org.json.JSONObject;
public
/**
* @author congtaowang
@@ -56,53 +52,27 @@ class ADASStatusIntentHandler implements IntentHandler {
MarkerServiceHandler.getMogoStatusManager().setADASUIShow( ServiceConst.TYPE, status == 1 );
}
// 由于adas可能调高此处的调用频率存在anr风险且此处没有作用所以暂时注释掉
// else {
// String msg = intent.getStringExtra( "adasMsg" );
// if ( TextUtils.isEmpty( msg ) ) {
// return;
// }
// CarStateInfo stateInfo = GsonUtil.objectFromJson( msg, CarStateInfo.class );
// if ( stateInfo != null ) {
// changeCarHeadstockDirection( context, stateInfo.getValues().getHeading() );
// // changeMyLocation( stateInfo.getValues() );
// }
// }
}
private void changeCarHeadstockDirection( final Context context, final double degree ) {
if ( MarkerServiceHandler.getNavi().isNaviing() ) {
return;
else {
String msg = intent.getStringExtra( "adasMsg" );
if ( TextUtils.isEmpty( msg ) ) {
return;
}
CarStateInfo stateInfo = GsonUtil.objectFromJson( msg, CarStateInfo.class );
if ( stateInfo != null && stateInfo.getValues() != null ) {
JSONObject data = new JSONObject();
try {
data.putOpt( "lon", stateInfo.getValues().getLon() );
data.putOpt( "lat", stateInfo.getValues().getLat() );
data.putOpt( "alt", stateInfo.getValues().getAlt() );
data.putOpt( "heading", stateInfo.getValues().getHeading() );
data.putOpt( "acceleration", stateInfo.getValues().getAcceleration() );
data.putOpt( "yawRate", stateInfo.getValues().getYaw_rate() );
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController()
.syncLocation2Map( data );
} catch ( Exception e ) {
e.printStackTrace();
}
}
}
if ( MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() ) {
return;
}
if ( !MarkerServiceHandler.getMogoStatusManager().isMainPageOnResume() ) {
return;
}
if ( MarkerServiceHandler.getMogoStatusManager().isSeekHelping() ) {
return;
}
if ( MarkerServiceHandler.getMapUIController().getCurrentUiMode() != EnumMapUI.NorthUP_2D ) {
return;
}
UiThreadHandler.post( () -> {
MarkerServiceHandler.getMapUIController().showMyLocation( inflateCursorView( context, degree ) );
} );
}
private View inflateCursorView( Context context, double degree ) {
View view = View.inflate( context, R.layout.map_amap_cursor, null );
view.setRotation( ( float ) degree );
return view;
}
private void changeMyLocation( CarStateInfo.ValuesBean valuesBean ) {
if ( valuesBean == null ) {
return;
}
Location location = new Location( LocationManager.GPS_PROVIDER );
location.setAltitude( valuesBean.getAlt() );
location.setLatitude( valuesBean.getLat() );
location.setLongitude( valuesBean.getLon() );
}
}

View File

@@ -387,6 +387,10 @@ public class MockIntentHandler implements IntentHandler {
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController()
.rtkEnable( false );
break;
case 39:
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController()
.syncLocation2Map( null );
break;
}
}

View File

@@ -72,6 +72,7 @@ public class MogoReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
Logger.d( TAG, action );
if (TextUtils.equals(VOICE_ACTION, action)) {
String cmd = intent.getStringExtra(PARAM_COMMAND);
if (!TextUtils.isEmpty(cmd)) {