opt
This commit is contained in:
@@ -50,6 +50,26 @@ public class CarStateInfo implements Serializable {
|
||||
private double heading;
|
||||
private double acceleration;
|
||||
private double yaw_rate;
|
||||
//惯导车速 m/s
|
||||
private float gnss_speed;
|
||||
//gps 时间
|
||||
private String satelliteTime;
|
||||
|
||||
public float getGnss_speed() {
|
||||
return gnss_speed;
|
||||
}
|
||||
|
||||
public void setGnss_speed( float gnss_speed ) {
|
||||
this.gnss_speed = gnss_speed;
|
||||
}
|
||||
|
||||
public String getSatelliteTime() {
|
||||
return satelliteTime;
|
||||
}
|
||||
|
||||
public void setSatelliteTime( String satelliteTime ) {
|
||||
this.satelliteTime = satelliteTime;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.carinfo.CarStateInfo;
|
||||
import com.mogo.module.service.receiver.MogoReceiver;
|
||||
import com.mogo.module.service.uploadintime.SnapshotUploadInTime;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import org.json.JSONObject;
|
||||
@@ -64,11 +65,13 @@ class ADASStatusIntentHandler implements IntentHandler {
|
||||
data.putOpt( "lon", stateInfo.getValues().getLon() );
|
||||
data.putOpt( "lat", stateInfo.getValues().getLat() );
|
||||
data.putOpt( "alt", stateInfo.getValues().getAlt() );
|
||||
data.putOpt( "speed", stateInfo.getValues().getGnss_speed() );
|
||||
data.putOpt( "satelliteTime", stateInfo.getValues().getSatelliteTime() );
|
||||
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 );
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map( data );
|
||||
SnapshotUploadInTime.getInstance().syncAdasLocationInfo( data );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.mogo.module.common.dialog.WMDialog;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.service.entrance.ButtonIndex;
|
||||
import com.mogo.utils.CoordinateUtils;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -391,6 +392,86 @@ public class MockIntentHandler implements IntentHandler {
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController()
|
||||
.syncLocation2Map( null );
|
||||
break;
|
||||
case 40:
|
||||
|
||||
double[][] coors = new double[][]{{40.17511749267578, 116.74359130859375},
|
||||
{40.20258331298828, 116.74071502685547},
|
||||
{40.202598571777344, 116.74067687988281},
|
||||
{40.20256805419922, 116.74071502685547},
|
||||
{40.202598571777344, 116.74064636230469},
|
||||
{40.20258712768555, 116.74067687988281},
|
||||
{40.202579498291016, 116.74068450927734},
|
||||
{40.202545166015625, 116.7406005859375},
|
||||
{40.202571868896484, 116.74054718017578},
|
||||
{40.20256042480469, 116.74057006835938},
|
||||
{40.202510833740234, 116.74053192138672},
|
||||
{40.202552795410156, 116.74053955078125},
|
||||
{40.202537536621094, 116.74044799804688},
|
||||
{40.202552795410156, 116.74042510986328},
|
||||
{40.202510833740234, 116.74038696289062},
|
||||
{40.202537536621094, 116.74044799804688},
|
||||
{40.202552795410156, 116.74042510986328},
|
||||
{40.202518463134766, 116.74039459228516},
|
||||
{40.202537536621094, 116.74038696289062},
|
||||
{40.202552795410156, 116.74036407470703},
|
||||
{40.20252227783203, 116.7403335571289},
|
||||
{40.20253372192383, 116.74038696289062},
|
||||
{40.202552795410156, 116.74036407470703},
|
||||
{40.2025260925293, 116.7403335571289},
|
||||
{40.20253372192383, 116.74030303955078},
|
||||
{40.20254898071289, 116.74028778076172},
|
||||
{40.20252990722656, 116.7402572631836},
|
||||
{40.2025260925293, 116.740234375},
|
||||
{40.202545166015625, 116.74022674560547},
|
||||
{40.20252990722656, 116.74020385742188},
|
||||
{40.20254898071289, 116.74014282226562},
|
||||
{40.20253372192383, 116.74011993408203},
|
||||
{40.2025260925293, 116.74014282226562},
|
||||
{40.20254898071289, 116.74014282226562},
|
||||
{40.202537536621094, 116.74011993408203},
|
||||
{40.2025260925293, 116.74014282226562},
|
||||
{40.20255661010742, 116.74008178710938},
|
||||
{40.20254135131836, 116.74005889892578},
|
||||
{40.20252990722656, 116.74007415771484},
|
||||
{40.20254898071289, 116.74008178710938},
|
||||
{40.20254135131836, 116.74005889892578},
|
||||
{40.20252227783203, 116.74006652832031},
|
||||
{40.20254898071289, 116.74002838134766},
|
||||
{40.20254135131836, 116.74000549316406},
|
||||
{40.20252227783203, 116.73999786376953},
|
||||
{40.20269012451172, 116.73983001708984},
|
||||
{40.20265579223633, 116.73978424072266},
|
||||
{40.202667236328125, 116.7397689819336},
|
||||
{40.20264434814453, 116.73973083496094},
|
||||
{40.202632904052734, 116.7397689819336},
|
||||
{40.202613830566406, 116.73974609375},
|
||||
{40.2026252746582, 116.73970794677734},
|
||||
{40.202613830566406, 116.73968505859375},
|
||||
{40.202598571777344, 116.73970031738281},
|
||||
{40.20258712768555, 116.73969268798828},
|
||||
{40.20258712768555, 116.73961639404297},
|
||||
{40.202579498291016, 116.73960876464844},
|
||||
{40.20257568359375, 116.7396240234375},
|
||||
{40.20256805419922, 116.73960876464844},
|
||||
{40.20256042480469, 116.73941802978516},
|
||||
{40.20255661010742, 116.73941802978516},
|
||||
{40.20256042480469, 116.73941802978516},
|
||||
{40.20254898071289, 116.73941802978516},
|
||||
{40.20255661010742, 116.7393569946289},
|
||||
{40.20254898071289, 116.7393569946289},
|
||||
{40.20256042480469, 116.7393569946289},
|
||||
{40.20254898071289, 116.7393569946289},
|
||||
{40.20255661010742, 116.73928833007812},
|
||||
{40.202545166015625, 116.7392807006836},
|
||||
{40.20254898071289, 116.73928833007812},
|
||||
{40.20254135131836, 116.7392807006836}};
|
||||
for ( double[] coor : coors ) {
|
||||
double lat = coor[0], lon = coor[1];
|
||||
double[] translateCoor = CoordinateUtils.transformFromWGSToGCJ( lat, lon );
|
||||
double[] originCoor = CoordinateUtils.transformGcj02toWgs84( translateCoor[0], translateCoor[1] );
|
||||
double delta = CoordinateUtils.calculateLineDistance( lon, lat, originCoor[0], originCoor[1] );
|
||||
Logger.d( TAG, "偏差值:%s", delta );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ 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.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -63,13 +65,19 @@ public class MogoRTKLocation {
|
||||
|
||||
private void sendLocationData() {
|
||||
|
||||
if (rtkLocationListener != null) {
|
||||
List<CloudLocationInfo> list = new ArrayList<>(cacheList);
|
||||
rtkLocationListener.onLocationChanged(list);
|
||||
List<CloudLocationInfo> list = null;
|
||||
if ( DebugConfig.isUseAdasRtkLocationInfo() ) {
|
||||
list = new ArrayList<>(SnapshotUploadInTime.getInstance().getSendLocationData());
|
||||
}
|
||||
if ( list == null || list.isEmpty() ) {
|
||||
list = new ArrayList<>(cacheList);
|
||||
}
|
||||
if (cacheList != null && cacheList.size() > 0) {
|
||||
cacheList.clear();
|
||||
}
|
||||
if (rtkLocationListener != null) {
|
||||
rtkLocationListener.onLocationChanged(list);
|
||||
}
|
||||
}
|
||||
|
||||
public void registerRTKLocationListener(RTKLocationListener locationListener) {
|
||||
|
||||
@@ -176,9 +176,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
} );
|
||||
// adas 每隔一秒传递的数据
|
||||
MarkerServiceHandler.getApis().getAdasControllerApi().addAdasRecognizedDataCallback( resultList -> {
|
||||
if ( resultList == null || resultList.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
double speed = 0.0;
|
||||
if ( MogoServices.getInstance().getLastCarLocation() != null ) {
|
||||
speed = MogoServices.getInstance().getLastCarLocation().getSpeed();
|
||||
|
||||
@@ -14,6 +14,8 @@ import com.mogo.service.connection.IMogoOnWebSocketMessageListener;
|
||||
import com.mogo.service.connection.WebSocketMsgType;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -122,4 +124,46 @@ class SnapshotUploadInTime implements MogoRTKLocation.RTKLocationListener {
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
// adda 工控机数据缓存
|
||||
private List< CloudLocationInfo > cacheList = new ArrayList<>();
|
||||
|
||||
public void syncAdasLocationInfo( JSONObject data ) {
|
||||
if ( data == null ) {
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "同步到rtk数据" );
|
||||
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 );
|
||||
double speed = data.optDouble( "speed", -1 );
|
||||
long satelliteTime = 0L;
|
||||
try {
|
||||
satelliteTime = Long.valueOf( data.optString( "satelliteTime" ) );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
CloudLocationInfo cloudLocationInfo = new CloudLocationInfo();
|
||||
cloudLocationInfo.setAlt( alt );
|
||||
cloudLocationInfo.setHeading( heading );
|
||||
cloudLocationInfo.setLat( lat );
|
||||
cloudLocationInfo.setLon( lon );
|
||||
cloudLocationInfo.setSpeed( speed );
|
||||
cloudLocationInfo.setSatelliteTime( satelliteTime );
|
||||
cloudLocationInfo.setSystemTime( System.currentTimeMillis() );
|
||||
cloudLocationInfo.convertCoor2GCJ02();
|
||||
cacheList.add( cloudLocationInfo );
|
||||
}
|
||||
|
||||
public List< CloudLocationInfo > getSendLocationData() {
|
||||
List< CloudLocationInfo > list = new ArrayList<>( cacheList );
|
||||
if ( cacheList != null && cacheList.size() > 0 ) {
|
||||
cacheList.clear();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user