This commit is contained in:
wangcongtao
2021-01-25 18:42:18 +08:00
parent 0c77c3b98f
commit 0d0c39af67
9 changed files with 103 additions and 5 deletions

View File

@@ -107,6 +107,10 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
marker.setPosition( recognizedListResult.lat, recognizedListResult.lon );
} else {
long interval = recognizedListResult.systemTime - lastPosition.systemTime;
if ( interval < 45 ) {
interval = 45;
}
interval -= 25;
marker.startSmoothInMs( points, interval );
}
} else {
@@ -169,6 +173,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
.owner( DataTypes.TYPE_MARKER_ADAS )
.anchor( 0.5f, 0.5f )
.set3DMode( true )
.controlAngle( true )
.icon3DRes( getVrModel() )
.rotate( ( float ) recognizedListResult.heading )
.position( new MogoLatLng( recognizedListResult.lat, recognizedListResult.lon ) );

View File

@@ -214,7 +214,10 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
long interval = cloudRoadData.getSystemTime() - lastPosition.getSystemTime();
long interval2 = cloudRoadData.getSatelliteTime() - lastPosition.getSatelliteTime();
interval2 = interval < interval2 || interval2 == 0 ? interval : interval2;
// interval2 = interval2 > 1_000L ? 1_000L : interval2;
if ( interval2 < 45 ) {
interval2 = 45;
}
interval2 -= 25;
marker.startSmoothInMs( points, interval2 );
Logger.d( TAG, "平滑移动 - %s duration = %s", uniqueKey, interval2 );
}
@@ -328,6 +331,7 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
.anchor( 0.5f, 0.5f )
.rotate( ( float ) data.getHeading() )
.object( data )
.controlAngle( true )
.position( new MogoLatLng( data.getLat(), data.getLon() ) );
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
options.set3DMode( true );
@@ -350,7 +354,7 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
// return R.raw.bus;
case CloudRoadData.FROM_MY_LOCATION:
default:
return R.raw.carred;
return R.raw.carblue;
}
}

View File

@@ -27,6 +27,8 @@ import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.dialog.WMDialog;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.R;
import com.mogo.module.service.uploadintime.SnapshotUploadInTime;
import com.mogo.service.adas.entity.ADASCarStateInfo;
import com.mogo.service.entrance.ButtonIndex;
import com.mogo.utils.CoordinateUtils;
import com.mogo.utils.TipToast;
@@ -35,6 +37,11 @@ import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import com.mogo.utils.storage.SharedPrefsMgr;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
@@ -479,6 +486,58 @@ public class MockIntentHandler implements IntentHandler {
// adb shell am broadcast -a com.mogo.mock --ei oper 41 --ei type 1 直接打点
DebugConfig.setNotSmooth( intent.getIntExtra( "type", 0 ) == 1 );
break;
case 42:
WorkThreadHandler.getInstance().post( () -> {
try {
InputStream is = context.getAssets().open( "coors.json" );
BufferedReader br = new BufferedReader( new InputStreamReader( is ) );
String line = "";
List< ADASCarStateInfo > vals = new ArrayList<>();
while ( ( line = br.readLine() ) != null ) {
String[] json = line.split( " - " );
long time = Long.valueOf( json[0] );
ADASCarStateInfo si = GsonUtil.objectFromJson( json[1], ADASCarStateInfo.class );
// si.getValues().setSatelliteTime( time + "" );
vals.add( si );
}
long interval = -1;
ADASCarStateInfo last = null;
for ( ADASCarStateInfo val : vals ) {
if ( last == null ) {
interval = 0;
} else {
interval = Long.valueOf( val.getValues().getSatelliteTime() ) - Long.valueOf( last.getValues().getSatelliteTime() );
}
last = val;
WorkThreadHandler.getInstance().postDelayed( () -> {
onAdasCarDataCallback( val );
}, interval );
}
} catch ( Exception e ) {
e.printStackTrace();
}
} );
break;
}
}
public void onAdasCarDataCallback( ADASCarStateInfo stateInfo ) {
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( "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 );
// SnapshotUploadInTime.getInstance().syncAdasLocationInfo( data );
} catch ( Exception e ) {
e.printStackTrace();
}
}
}