update MoGoAiCloud sdk version and replace the CloudLocationInfo

This commit is contained in:
zhongchao
2021-02-23 17:24:30 +08:00
parent 22fabd4a52
commit fea65e541d
8 changed files with 25 additions and 208 deletions

1
.idea/gradle.xml generated
View File

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

View File

@@ -155,19 +155,19 @@ LOGLIB_VERSION = 1.0.4
######## MogoAiCloudSDK Version
# 网络请求
MOGO_NETWORK_VERSION=1.0.32-SNAPSHOT
MOGO_NETWORK_VERSION=1.0.33-SNAPSHOT
# 鉴权
MOGO_PASSPORT_VERSION=1.0.32-SNAPSHOT
MOGO_PASSPORT_VERSION=1.0.33-SNAPSHOT
# 常链接
MOGO_SOCKET_VERSION=1.0.32-SNAPSHOT
MOGO_SOCKET_VERSION=1.0.33-SNAPSHOT
# 数据采集
MOGO_REALTIME_VERSION=1.0.32-SNAPSHOT
MOGO_REALTIME_VERSION=1.0.33-SNAPSHOT
# 探路,道路事件发布,获取
MOGO_TANLU_VERSION=1.0.32-SNAPSHOT
MOGO_TANLU_VERSION=1.0.33-SNAPSHOT
# 直播推流
MOGO_LIVE_VERSION=1.0.32-SNAPSHOT
MOGO_LIVE_VERSION=1.0.33-SNAPSHOT
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.0.32-SNAPSHOT
MOGO_TRAFFICLIVE_VERSION=1.0.33-SNAPSHOT
######## Foundation MogoAiCloud Module
# mogoAiCloud apk services

View File

@@ -1,183 +0,0 @@
package com.mogo.module.common.entity;
import android.os.Parcel;
import android.os.Parcelable;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.utils.CoordinateUtils;
import java.util.Objects;
/**
* 云端定位信息和自车定位信息
*
* @author tongchenfei
*/
public class CloudLocationInfo implements Parcelable {
private double lat;
private double lon;
private double heading;
private long systemTime;
private long satelliteTime;
private double alt;
private double speed;
private int vehicleType = 0;
public CloudLocationInfo() {
if ( DebugConfig.getProductFlavor().contains( "taxi" ) ) {
vehicleType = 9;
} else if ( DebugConfig.getProductFlavor().contains( "bus" ) ) {
vehicleType = 10;
}
}
public CloudLocationInfo( CloudLocationInfo info ) {
this.lat = info.getLat();
this.lon = info.getLon();
this.heading = info.getHeading();
this.systemTime = System.currentTimeMillis();
this.satelliteTime = info.getSatelliteTime();
this.alt = info.alt;
this.speed = info.speed;
}
public void convertCoor2GCJ02(){
double[] amapCoord = CoordinateUtils.transformWgsToGcj( lat, lon );
if ( amapCoord != null ) {
this.lat = amapCoord[1];
this.lon = amapCoord[0];
}
}
public double getLat() {
return lat;
}
public void setLat( double lat ) {
this.lat = lat;
}
public double getLon() {
return lon;
}
public void setLon( double lon ) {
this.lon = lon;
}
public double getHeading() {
return heading;
}
public void setHeading( double heading ) {
this.heading = heading;
}
public long getSystemTime() {
return systemTime;
}
public void setSystemTime( long systemTime ) {
this.systemTime = systemTime;
}
public long getSatelliteTime() {
return satelliteTime;
}
public void setSatelliteTime( long satelliteTime ) {
this.satelliteTime = satelliteTime;
}
public double getAlt() {
return alt;
}
public void setAlt( double alt ) {
this.alt = alt;
}
public double getSpeed() {
return speed;
}
public void setSpeed( double speed ) {
this.speed = speed;
}
@Override
public String toString() {
return "CloudLocationInfo{" +
"lat=" + lat +
", lon=" + lon +
", heading=" + heading +
", systemTime=" + systemTime +
", satelliteTime=" + satelliteTime +
", alt=" + alt +
", speed=" + speed +
'}';
}
public String print() {
return "CloudLocation{ lon: " + lon + " lat: " + lat + " heading: " + heading + " speed: "
+ speed + "}";
}
@Override
public boolean equals( Object o ) {
if ( this == o ) {
return true;
}
if ( o == null || getClass() != o.getClass() ) {
return false;
}
CloudLocationInfo that = ( CloudLocationInfo ) o;
return Double.compare( that.lat, lat ) == 0 &&
Double.compare( that.lon, lon ) == 0;
}
@Override
public int hashCode() {
return Objects.hash( lat, lon );
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel( Parcel dest, int flags ) {
dest.writeDouble( this.lat );
dest.writeDouble( this.lon );
dest.writeDouble( this.heading );
dest.writeLong( this.systemTime );
dest.writeLong( this.satelliteTime );
dest.writeDouble( this.alt );
dest.writeDouble( this.speed );
dest.writeInt( this.vehicleType );
}
protected CloudLocationInfo( Parcel in ) {
this.lat = in.readDouble();
this.lon = in.readDouble();
this.heading = in.readDouble();
this.systemTime = in.readLong();
this.satelliteTime = in.readLong();
this.alt = in.readDouble();
this.speed = in.readDouble();
this.vehicleType = in.readInt();
}
public static final Creator< CloudLocationInfo > CREATOR = new Creator< CloudLocationInfo >() {
@Override
public CloudLocationInfo createFromParcel( Parcel source ) {
return new CloudLocationInfo( source );
}
@Override
public CloudLocationInfo[] newArray( int size ) {
return new CloudLocationInfo[size];
}
};
}

View File

@@ -11,12 +11,11 @@ import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.common.entity.CloudLocationInfo;
import com.mogo.module.service.uploadintime.SnapshotUploadInTime;
import com.mogo.realtime.entity.CloudLocationInfo;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;

View File

@@ -3,12 +3,12 @@ package com.mogo.module.service.uploadintime;
import android.content.Context;
import com.mogo.commons.utils.MortonCode;
import com.mogo.module.common.entity.CloudLocationInfo;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.location.MogoRTKLocation;
import com.mogo.module.service.utils.SimpleLocationCorrectStrategy;
import com.mogo.module.service.websocket.LocationResult;
import com.mogo.module.service.websocket.OnePerSecondSendContent;
import com.mogo.realtime.entity.CloudLocationInfo;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import com.mogo.service.connection.IMogoOnWebSocketMessageListener;
import com.mogo.service.connection.WebSocketMsgType;
@@ -20,7 +20,7 @@ import java.util.ArrayList;
import java.util.List;
public
/**
/*
* @author congtaowang
* @since 2020/12/14
*
@@ -67,7 +67,7 @@ class SnapshotUploadInTime implements MogoRTKLocation.RTKLocationListener {
}
@Override
public void onLocationChanged( int dataAccuracy, List< CloudLocationInfo > cloudLocationInfos ) {
public void onLocationChanged( int dataAccuracy, List<CloudLocationInfo> cloudLocationInfos ) {
startSendCarLocationAndAdasRecognizedResult2Server( dataAccuracy, cloudLocationInfos );
}

View File

@@ -3,7 +3,7 @@ package com.mogo.module.service.utils;
import android.location.Location;
import com.mogo.map.MogoLatLng;
import com.mogo.module.common.entity.CloudLocationInfo;
import com.mogo.realtime.entity.CloudLocationInfo;
/**
* 定位数据类型转换工具

View File

@@ -1,11 +1,10 @@
package com.mogo.module.service.utils;
import android.location.Location;
import android.os.SystemClock;
import com.mogo.map.MogoLatLng;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.entity.CloudLocationInfo;
import com.mogo.realtime.entity.CloudLocationInfo;
import com.mogo.utils.logger.Logger;
import java.util.ArrayList;
@@ -28,16 +27,16 @@ public class SimpleLocationCorrectStrategy {
private long anchorTime;
private int errCount;
private static SimpleLocationCorrectStrategy instance = new SimpleLocationCorrectStrategy();
private static final SimpleLocationCorrectStrategy instance = new SimpleLocationCorrectStrategy();
public static SimpleLocationCorrectStrategy getInstance(){
return instance;
}
private List<CloudLocationInfo> historyList = new ArrayList<>();
private List<CloudLocationInfo> validList = new ArrayList<>();
private List<CloudLocationInfo> correctList = new ArrayList<>();
private List<CloudLocationInfo> errList = new ArrayList<>();
private final List<CloudLocationInfo> historyList = new ArrayList<>();
private final List<CloudLocationInfo> validList = new ArrayList<>();
private final List<CloudLocationInfo> correctList = new ArrayList<>();
private final List<CloudLocationInfo> errList = new ArrayList<>();
public CloudLocationInfo correct(CloudLocationInfo info) {
Logger.d(TAG, "info: " + info.print());
@@ -158,15 +157,15 @@ public class SimpleLocationCorrectStrategy {
}
private RecordLocationListener recordLocationListener = null;
private boolean hasCallbackReocrd = false;
private boolean hasCallbackRecord = false;
public void setRecordLocationListener(RecordLocationListener recordLocationListener) {
this.recordLocationListener = recordLocationListener;
}
private boolean recordLocation(){
if (historyList.size() >= 100 && !hasCallbackReocrd && recordLocationListener != null) {
hasCallbackReocrd = true;
if (historyList.size() >= 100 && !hasCallbackRecord && recordLocationListener != null) {
hasCallbackRecord = true;
recordLocationListener.onRecordFinish(historyList, correctList,validList,correctList);
}
return historyList.size() < 100;

View File

@@ -1,11 +1,12 @@
package com.mogo.module.service.websocket;
import com.mogo.module.common.entity.CloudLocationInfo;
import com.mogo.realtime.entity.CloudLocationInfo;
import java.util.List;
public
/**
/*
* @author congtaowang
* @since 2020/10/25
*