1. mock添加10辆车

2. 道路吸附同步到snapshot
This commit is contained in:
tongchenfei
2021-03-17 20:29:57 +08:00
parent f1b9f7481e
commit 29c0277921
9 changed files with 213 additions and 94 deletions

View File

@@ -727,6 +727,11 @@ public class MockIntentHandler implements IntentHandler {
br32.close();
br33.close();
br34.close();
br35.close();
br36.close();
br37.close();
br38.close();
br39.close();
} catch ( IOException ex ) {
ex.printStackTrace();
}
@@ -735,6 +740,11 @@ public class MockIntentHandler implements IntentHandler {
br32 = null;
br33 = null;
br34 = null;
br35 = null;
br36 = null;
br37 = null;
br38 = null;
br39 = null;
}
} else if ( msg.what == 31 ) {
try {
@@ -861,7 +871,7 @@ public class MockIntentHandler implements IntentHandler {
private boolean handleMockSnapshotIntent() throws Exception {
if ( br2 == null ) {
br2 = new BufferedReader( new InputStreamReader( AbsMogoApplication.getApp().getAssets().open( "snapshot.txt" ) ) );
br2 = new BufferedReader( new InputStreamReader( AbsMogoApplication.getApp().getAssets().open( "adas6.txt" ) ) );
}
String line = br2.readLine();
if ( line == null ) {
@@ -886,7 +896,7 @@ public class MockIntentHandler implements IntentHandler {
delay = cloudRoadData.getSystemTime() - last;
}
last = cloudRoadData.getSystemTime();
mLocationMockHandler.sendEmptyMessageDelayed( 2, 100L );
mLocationMockHandler.sendEmptyMessageDelayed( 2, 50L );
return true;
}
@@ -937,6 +947,22 @@ public class MockIntentHandler implements IntentHandler {
if ( br34 == null ) {
br34 = new BufferedReader( new InputStreamReader( AbsMogoApplication.getApp().getAssets().open( "adas6.txt" ) ) );
}
if ( br35 == null ) {
br35 = new BufferedReader( new InputStreamReader( AbsMogoApplication.getApp().getAssets().open( "adas3-2.txt" ) ) );
}
if ( br36 == null ) {
br36 = new BufferedReader( new InputStreamReader( AbsMogoApplication.getApp().getAssets().open( "adas4-2.txt" ) ) );
}
if ( br37 == null ) {
br37 = new BufferedReader( new InputStreamReader( AbsMogoApplication.getApp().getAssets().open( "adas4-4.txt" ) ) );
}
if ( br38 == null ) {
br38 = new BufferedReader( new InputStreamReader( AbsMogoApplication.getApp().getAssets().open( "adas5-2.txt" ) ) );
}
if ( br39 == null ) {
br39 = new BufferedReader( new InputStreamReader( AbsMogoApplication.getApp().getAssets().open( "adas5-4.txt" ) ) );
}
String line = br3.readLine();
if ( line == null ) {
throw new Exception( "end of file 3." );
@@ -964,6 +990,27 @@ public class MockIntentHandler implements IntentHandler {
allList.add( next );
}
next = handleMockAdasIntent7();
if ( next != null ) {
allList.add( next );
}
next = handleMockAdasIntent8();
if ( next != null ) {
allList.add( next );
}
next = handleMockAdasIntent9();
if ( next != null ) {
allList.add( next );
}
next = handleMockAdasIntent10();
if ( next != null ) {
allList.add( next );
}
next = handleMockAdasIntent11();
if ( next != null ) {
allList.add( next );
}
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( allList );
Log.i( "mock-timer-adas", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
long delay = 100;
@@ -1054,4 +1101,104 @@ public class MockIntentHandler implements IntentHandler {
return adasRecognizedResult;
}
private BufferedReader br35;
private ADASRecognizedResult handleMockAdasIntent7() {
String line = null;
try {
line = br35.readLine();
} catch ( IOException e ) {
e.printStackTrace();
}
if ( line == null ) {
return null;
}
ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
if ( adasRecognizedResult == null ) {
return null;
}
adasRecognizedResult.uuid = "2_6";
return adasRecognizedResult;
}
private BufferedReader br36;
private ADASRecognizedResult handleMockAdasIntent8() {
String line = null;
try {
line = br36.readLine();
} catch ( IOException e ) {
e.printStackTrace();
}
if ( line == null ) {
return null;
}
ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
if ( adasRecognizedResult == null ) {
return null;
}
adasRecognizedResult.uuid = "2_7";
return adasRecognizedResult;
}
private BufferedReader br37;
private ADASRecognizedResult handleMockAdasIntent9() {
String line = null;
try {
line = br37.readLine();
} catch ( IOException e ) {
e.printStackTrace();
}
if ( line == null ) {
return null;
}
ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
if ( adasRecognizedResult == null ) {
return null;
}
adasRecognizedResult.uuid = "2_8";
return adasRecognizedResult;
}
private BufferedReader br38;
private ADASRecognizedResult handleMockAdasIntent10() {
String line = null;
try {
line = br38.readLine();
} catch ( IOException e ) {
e.printStackTrace();
}
if ( line == null ) {
return null;
}
ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
if ( adasRecognizedResult == null ) {
return null;
}
adasRecognizedResult.uuid = "2_9";
return adasRecognizedResult;
}
private BufferedReader br39;
private ADASRecognizedResult handleMockAdasIntent11() {
String line = null;
try {
line = br39.readLine();
} catch ( IOException e ) {
e.printStackTrace();
}
if ( line == null ) {
return null;
}
ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
if ( adasRecognizedResult == null ) {
return null;
}
adasRecognizedResult.uuid = "2_10";
return adasRecognizedResult;
}
}