This commit is contained in:
zhongchao
2022-03-11 20:04:11 +08:00
parent c804f5162d
commit 5886f4feb7
81 changed files with 1689 additions and 1095 deletions

View File

@@ -78,6 +78,8 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import mogo.telematics.pad.MessagePad;
public class AMapViewWrapper implements IMogoMapView,
IMogoMapUIController,
LocationListener,
@@ -906,32 +908,48 @@ public class AMapViewWrapper implements IMogoMapView,
double speed = data.optDouble("speed", -1);
long systemTime = data.optLong("systemTime");
long satelliteTime = data.optLong("satelliteTime");
long receiverDataTime = data.optLong("receiverDataTime");
long adasSatelliteTime = data.optLong("adasSatelliteTime");
int gpsProvider = data.optInt("gpsProvider", 1);
// 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统1-工控机2-OBU
if (gpsProvider == FunctionBuildConfig.gpsProvider) {
if (lon == -1) {
return;
}
RTKAutopilotLocationBean bean = new RTKAutopilotLocationBean();
bean.setYaw_rate(yawRate);
bean.setHeading(heading);
bean.setAcceleration(acceleration);
bean.setAlt(alt);
bean.setSystemTime(systemTime);
bean.setSatelliteTime(satelliteTime);
bean.setReceiverDataTime(receiverDataTime);
bean.setAdasSatelliteTime(adasSatelliteTime);
bean.setLon(lon);
bean.setGnss_speed(((float) speed));
bean.setLat(lat);
// 使用外部定位数据修改自车位置
mMapView.getLocationClient().updateRTKAutoPilotLocation(bean);
CallerLocationUpdaterManager.INSTANCE.updateLocation(bean);
CallerMapDataCollectorManager.INSTANCE.setIsInit();
if (lon == -1) {
return;
}
RTKAutopilotLocationBean bean = new RTKAutopilotLocationBean();
bean.setYaw_rate(yawRate);
bean.setHeading(heading);
bean.setAcceleration(acceleration);
bean.setAlt(alt);
bean.setSystemTime(systemTime);
bean.setSatelliteTime(satelliteTime);
bean.setLon(lon);
bean.setGnss_speed(((float) speed));
bean.setLat(lat);
// 使用外部定位数据修改自车位置
mMapView.getLocationClient().updateRTKAutoPilotLocation(bean);
CallerLocationUpdaterManager.INSTANCE.updateLocation(bean);
CallerMapDataCollectorManager.INSTANCE.setIsInit();
}
@Override
public void syncLocation2Map(MessagePad.GnssInfo gnssInfo) {
if (!checkAMapView()) {
return;
}
if (gnssInfo.getLongitude() == -1) {
return;
}
RTKAutopilotLocationBean bean = new RTKAutopilotLocationBean();
bean.setYaw_rate(gnssInfo.getYawRate());
bean.setHeading(gnssInfo.getHeading());
bean.setAcceleration(gnssInfo.getAcceleration());
bean.setAlt(gnssInfo.getAltitude());
bean.setSystemTime(Double.valueOf(gnssInfo.getSystemTime()).longValue());
bean.setSatelliteTime(Double.valueOf(gnssInfo.getSatelliteTime()).longValue());
bean.setLon(gnssInfo.getLongitude());
bean.setLat(gnssInfo.getLatitude());
bean.setGnss_speed(((float) gnssInfo.getGnssSpeed()));
// 使用外部定位数据修改自车位置
mMapView.getLocationClient().updateRTKAutoPilotLocation(bean);
CallerLocationUpdaterManager.INSTANCE.updateLocation(bean);
CallerMapDataCollectorManager.INSTANCE.setIsInit();
}
@Override

View File

@@ -36,6 +36,8 @@ import com.zhidaoauto.map.sdk.open.view.MapAutoViewHelper;
import java.util.ArrayList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
/**
* @author congtaowang
* @since 2019-12-18
@@ -102,12 +104,12 @@ public class AMapWrapper implements IMogoMap {
}
@Override
public void updateBatchMarkerPositon(ArrayList<TrafficData> optionsArrayList) {
public void updateBatchMarkerPosition(ArrayList<MessagePad.TrackedObject> optionsArrayList) {
if (!checkAMap()) {
return;
}
ArrayList<MarkerSimpleData> markerOptionsArrayList = new ArrayList<>();
for (TrafficData mogoMarkerOptions : optionsArrayList) {
for (MessagePad.TrackedObject mogoMarkerOptions : optionsArrayList) {
MarkerSimpleData markerOptions = ObjectUtils.fromTrafficData(mogoMarkerOptions);
if (markerOptions == null) {
Logger.e(TAG, "marker参数为空");

View File

@@ -18,6 +18,8 @@ import org.json.JSONObject;
import java.util.List;
import mogo.telematics.pad.MessagePad;
/**
* @author congtaowang
* @since 2019-12-26
@@ -337,6 +339,13 @@ public class AMapUIController implements IMogoMapUIController {
}
}
@Override
public void syncLocation2Map(MessagePad.GnssInfo gnssInfo) {
if (mClient != null) {
mClient.syncLocation2Map(gnssInfo);
}
}
@Override
public void openVrMode(boolean zoomGestureEnable) {
if (mClient != null) {

View File

@@ -47,6 +47,8 @@ import com.zhidaoauto.map.sdk.open.query.Tip;
import java.util.ArrayList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
/**
* @author congtaowang
* @since 2019-12-18
@@ -116,18 +118,18 @@ public class ObjectUtils {
return markerOptions;
}
public static MarkerSimpleData fromTrafficData(TrafficData trafficData) {
public static MarkerSimpleData fromTrafficData(MessagePad.TrackedObject trafficData) {
if (trafficData == null) {
return null;
}
MarkerSimpleData markerOptions = null;
try {
markerOptions = new MarkerSimpleData();
markerOptions.setId(Long.parseLong(trafficData.getUuid()));
markerOptions.setMarkerType(trafficData.getType().getType());
markerOptions.setId(trafficData.getUuid());
markerOptions.setMarkerType(trafficData.getType());
markerOptions.setRotateAngle((float) trafficData.getHeading());
markerOptions.setLat(trafficData.getLat());
markerOptions.setLon(trafficData.getLon());
markerOptions.setLat(trafficData.getLatitude());
markerOptions.setLon(trafficData.getLongitude());
} catch (Exception e) {
e.printStackTrace();
}