ui opt
This commit is contained in:
@@ -157,7 +157,7 @@ ext {
|
||||
gpssimulatordebug : "com.mogo.module:module-gps-simulator-debug:${MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION}",
|
||||
gpssimulatornoop : "com.mogo.module:module-gps-simulator-noop:${MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION}",
|
||||
|
||||
adasapi : "com.zhidao.autopilot.support:adas:1.0.6.5",
|
||||
adasapi : "com.zhidao.autopilot.support:adas:1.0.6.7",
|
||||
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.5.2",
|
||||
|
||||
// 个人中心的SDK
|
||||
|
||||
@@ -403,4 +403,14 @@ public class DebugConfig {
|
||||
public static void setUseAdasRtkLocationInfo( boolean sIsUseAdasRtkLocationInfo ) {
|
||||
DebugConfig.sIsUseAdasRtkLocationInfo = sIsUseAdasRtkLocationInfo;
|
||||
}
|
||||
|
||||
public static boolean sIsNotSmooth = false;
|
||||
|
||||
public static boolean isNotSmooth() {
|
||||
return sIsNotSmooth;
|
||||
}
|
||||
|
||||
public static void setNotSmooth( boolean sIsNotSmooth ) {
|
||||
DebugConfig.sIsNotSmooth = sIsNotSmooth;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.0.0'
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.0.3'
|
||||
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-test-3.4'
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.mogo.module.common.drawer;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
@@ -39,7 +39,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
}
|
||||
|
||||
private Map< String, MogoLatLng > mLastPositions = new ConcurrentHashMap<>();
|
||||
private Map< String, ADASRecognizedListResult > mLastPositions = new ConcurrentHashMap<>();
|
||||
|
||||
public static AdasRecognizedResultDrawer getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
@@ -94,36 +94,30 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
continue;
|
||||
}
|
||||
mAdasRecognizedMarkersCaches.put( uniqueKey, marker );
|
||||
}
|
||||
|
||||
MogoLatLng lastPosition = mLastPositions.get( uniqueKey );
|
||||
|
||||
List< MogoLatLng > points = new ArrayList<>();
|
||||
MogoLatLng endLatLon = null;
|
||||
if ( recognizedListResult.latLonList != null
|
||||
&& recognizedListResult.latLonList.size() > 1 ) {
|
||||
for ( int j = 0; j < recognizedListResult.latLonList.size(); j++ ) {
|
||||
ADASRecognizedListResult.LatLon latLon = recognizedListResult.latLonList.get( j );
|
||||
if ( latLon == null ) {
|
||||
continue;
|
||||
mLastPositions.put( uniqueKey, recognizedListResult );
|
||||
} else {
|
||||
ADASRecognizedListResult lastPosition = mLastPositions.get( uniqueKey );
|
||||
mLastPositions.put( uniqueKey, recognizedListResult );
|
||||
if ( lastPosition != null ) {
|
||||
List< MogoLatLng > points = new ArrayList<>();
|
||||
MogoLatLng endLatLon = new MogoLatLng( recognizedListResult.lat, recognizedListResult.lon );
|
||||
points.add( new MogoLatLng( lastPosition.lat, lastPosition.lon ) );
|
||||
points.add( endLatLon );
|
||||
if ( DebugConfig.isNotSmooth() ) {
|
||||
marker.setPosition( recognizedListResult.lat, recognizedListResult.lon );
|
||||
} else {
|
||||
long interval = recognizedListResult.systemTime - lastPosition.systemTime;
|
||||
marker.startSmoothInMs( points, interval );
|
||||
}
|
||||
points.add( endLatLon = new MogoLatLng( latLon.lat, latLon.lon ) );
|
||||
} else {
|
||||
marker.setPosition( recognizedListResult.lat, recognizedListResult.lon );
|
||||
}
|
||||
|
||||
} else if ( recognizedListResult.latLonList != null
|
||||
&& recognizedListResult.latLonList.size() == 1 ) {
|
||||
// 原来的点和新的点做一个数组进行平滑移动
|
||||
ADASRecognizedListResult.LatLon latLon = recognizedListResult.latLonList.get( 0 );
|
||||
if ( latLon == null ) {
|
||||
continue;
|
||||
}
|
||||
points.add( lastPosition );
|
||||
points.add( endLatLon = new MogoLatLng( latLon.lat, latLon.lon ) );
|
||||
}
|
||||
mLastPositions.put( uniqueKey, endLatLon );
|
||||
if ( points.size() >= 1 ) {
|
||||
marker.startSmoothInMs( points, 100 );
|
||||
}
|
||||
showSelfSpeed( mContext,
|
||||
marker,
|
||||
recognizedListResult.speed,
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +171,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
.set3DMode( true )
|
||||
.icon3DRes( getVrModel() )
|
||||
.rotate( ( float ) recognizedListResult.heading )
|
||||
.position( new MogoLatLng( recognizedListResult.latLonList.get( 0 ).lat, recognizedListResult.latLonList.get( 0 ).lon ) );
|
||||
.position( new MogoLatLng( recognizedListResult.lat, recognizedListResult.lon ) );
|
||||
return MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( mContext ).addMarker( DataTypes.TYPE_MARKER_ADAS, options );
|
||||
}
|
||||
|
||||
@@ -185,21 +179,4 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
return R.raw.carred;
|
||||
}
|
||||
|
||||
private View inflateView( ADASRecognizedListResult data, boolean machineVision, double curSpeed ) {
|
||||
View rootView = LayoutInflater.from( AbsMogoApplication.getApp() ).inflate( R.layout.module_commons_layout_car, null );
|
||||
// SafeType safeType = getSafeType( data.distanceX, data.distanceY, data.speed, curSpeed );
|
||||
// TextView tv = rootView.findViewById( R.id.module_commons_marker_car_speed );
|
||||
// tv.setText( safeType.getMsg() );
|
||||
ImageView iv = rootView.findViewById( R.id.module_commons_marker_car_model );
|
||||
// iv.setImageResource( MarkerResourceManager.getMarkerDrawableResId(
|
||||
// machineVision ? VisionMode.Machine : VisionMode.User,
|
||||
// AdasRecognizedType.valueFrom( data.type ),
|
||||
// getCarModelType(),
|
||||
// safeType
|
||||
// ) );
|
||||
|
||||
iv.setImageResource( R.drawable.icon_map_marker_car_gray );
|
||||
return rootView;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,6 +50,8 @@ import com.mogo.module.service.strategy.CarIconDisplayStrategy;
|
||||
import com.mogo.module.service.ttsConfig.TtsConfigModleData;
|
||||
import com.mogo.module.service.uploadintime.SnapshotUploadInTime;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.adas.IMogoAdasCarDataCallback;
|
||||
import com.mogo.service.adas.entity.ADASCarStateInfo;
|
||||
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
@@ -65,6 +67,8 @@ import com.mogo.utils.NetworkUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -86,6 +90,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
IMogoVoiceCmdCallBack,
|
||||
FragmentStackTransactionListener,
|
||||
IMogoCarLocationChangedListener2,
|
||||
IMogoAdasCarDataCallback,
|
||||
IDestroyable {
|
||||
|
||||
private boolean mInternalUnWakeupRegisterStatus = false;
|
||||
@@ -370,6 +375,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
mIntentManager.registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, this );
|
||||
|
||||
mADASController = MarkerServiceHandler.getADASController();
|
||||
mADASController.setAdasCarDataCallback( this );
|
||||
mFragmentManager = MarkerServiceHandler.getFragmentManager();
|
||||
|
||||
mFragmentManager.addMainFragmentStackTransactionListener( this );
|
||||
@@ -950,4 +956,25 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,6 +434,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
{40.20254135131836, 116.74005889892578},
|
||||
{40.20252990722656, 116.74007415771484},
|
||||
{40.20254898071289, 116.74008178710938},
|
||||
|
||||
{40.20254135131836, 116.74005889892578},
|
||||
{40.20252227783203, 116.74006652832031},
|
||||
{40.20254898071289, 116.74002838134766},
|
||||
@@ -472,6 +473,12 @@ public class MockIntentHandler implements IntentHandler {
|
||||
double delta = CoordinateUtils.calculateLineDistance( lon, lat, originCoor[0], originCoor[1] );
|
||||
Logger.d( TAG, "偏差值:%s", delta );
|
||||
}
|
||||
break;
|
||||
case 41:
|
||||
// adb shell am broadcast -a com.mogo.mock --ei oper 41 --ei type 0 平滑移动
|
||||
// adb shell am broadcast -a com.mogo.mock --ei oper 41 --ei type 1 直接打点
|
||||
DebugConfig.setNotSmooth( intent.getIntExtra( "type", 0 ) == 1 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -128,4 +128,11 @@ public interface IMogoADASController extends IProvider {
|
||||
* @param callback
|
||||
*/
|
||||
void removeAdasRecognizedDataCallback( IMogoAdasRecognizedDataCallback callback );
|
||||
|
||||
/**
|
||||
* 自车定位数据
|
||||
*
|
||||
* @param carDataCallback
|
||||
*/
|
||||
void setAdasCarDataCallback( IMogoAdasCarDataCallback carDataCallback );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.mogo.service.adas;
|
||||
|
||||
import com.mogo.service.adas.entity.ADASCarStateInfo;
|
||||
|
||||
/**
|
||||
* adas 自车位置数据回调
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public interface IMogoAdasCarDataCallback {
|
||||
/**
|
||||
* adas 数据回调
|
||||
*
|
||||
* @param msg 具体数据
|
||||
*/
|
||||
void onAdasCarDataCallback( ADASCarStateInfo msg );
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.mogo.service.adas.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author nie yunlong
|
||||
* @des 车辆状态
|
||||
* @date 2020/3/12
|
||||
*/
|
||||
public class ADASCarStateInfo implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* action : “state”
|
||||
* values : {"lon":116.8,"lat":39.4,"alt":22.3,"heading":87.5,"acceleration":0.5,"yaw_rate":0.3}
|
||||
*/
|
||||
|
||||
private String action;
|
||||
private ValuesBean values;
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public ValuesBean getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
public void setValues(ValuesBean values) {
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public static class ValuesBean {
|
||||
/**
|
||||
* lon : 116.8
|
||||
* lat : 39.4
|
||||
* alt : 22.3
|
||||
* heading : 87.5
|
||||
* acceleration : 0.5
|
||||
* yaw_rate : 0.3
|
||||
*/
|
||||
|
||||
private double lon;
|
||||
private double lat;
|
||||
private double alt;
|
||||
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;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getAlt() {
|
||||
return alt;
|
||||
}
|
||||
|
||||
public void setAlt(double alt) {
|
||||
this.alt = alt;
|
||||
}
|
||||
|
||||
public double getHeading() {
|
||||
return heading;
|
||||
}
|
||||
|
||||
public void setHeading(double heading) {
|
||||
this.heading = heading;
|
||||
}
|
||||
|
||||
public double getAcceleration() {
|
||||
return acceleration;
|
||||
}
|
||||
|
||||
public void setAcceleration(double acceleration) {
|
||||
this.acceleration = acceleration;
|
||||
}
|
||||
|
||||
public double getYaw_rate() {
|
||||
return yaw_rate;
|
||||
}
|
||||
|
||||
public void setYaw_rate(double yaw_rate) {
|
||||
this.yaw_rate = yaw_rate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ValuesBean{" +
|
||||
"lon=" + lon +
|
||||
", lat=" + lat +
|
||||
", alt=" + alt +
|
||||
", heading=" + heading +
|
||||
", acceleration=" + acceleration +
|
||||
", yaw_rate=" + yaw_rate +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CarStateInfo{" +
|
||||
"action='" + action + '\'' +
|
||||
", values=" + values +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -39,18 +39,10 @@ class ADASRecognizedListResult {
|
||||
public double distanceY;
|
||||
|
||||
/**
|
||||
* 同一个uuid 1s内所对应的连续坐标
|
||||
* 同一个uuid 1帧内所对应的坐标
|
||||
*/
|
||||
public List< LatLon > latLonList;
|
||||
public double lon;
|
||||
public double lat;
|
||||
|
||||
public static class LatLon {
|
||||
|
||||
public LatLon( double lat, double lon ) {
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public double lat;
|
||||
public double lon;
|
||||
}
|
||||
public long systemTime;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class AdasObjectUtils {
|
||||
if ( rectBean == null ) {
|
||||
return null;
|
||||
}
|
||||
if( rectBean.getLat() < 1){
|
||||
if ( rectBean.getLat() < 1 ) {
|
||||
return null;
|
||||
}
|
||||
ADASRecognizedResult result = new ADASRecognizedResult();
|
||||
@@ -96,37 +96,33 @@ class AdasObjectUtils {
|
||||
if ( datums == null || datums.isEmpty() ) {
|
||||
return null;
|
||||
}
|
||||
Map< String, ADASRecognizedListResult > result = new HashMap<>();
|
||||
List< ADASRecognizedListResult > recognizedListResults = new ArrayList<>();
|
||||
for ( RectInfo rectInfo : datums ) {
|
||||
if ( rectInfo == null || rectInfo.getModels() == null || rectInfo.getModels().isEmpty() ) {
|
||||
continue;
|
||||
}
|
||||
List< RectInfo.RectBean > models = rectInfo.getModels();
|
||||
for ( RectInfo.RectBean model : models ) {
|
||||
for ( RectInfo.RectBean model : rectInfo.getModels() ) {
|
||||
if ( model == null || TextUtils.isEmpty( model.getUuid() ) ) {
|
||||
continue;
|
||||
}
|
||||
ADASRecognizedListResult recognizedListResult = null;
|
||||
if ( !result.containsKey( model.getUuid() ) ) {
|
||||
recognizedListResult = new ADASRecognizedListResult();
|
||||
recognizedListResult.latLonList = new ArrayList<>();
|
||||
recognizedListResult.heading = model.getHeading();
|
||||
recognizedListResult.speed = model.getSpeed();
|
||||
recognizedListResult.type = Integer.valueOf( model.getType() );
|
||||
recognizedListResult.uuid = model.getUuid();
|
||||
result.put( model.getUuid(), recognizedListResult );
|
||||
} else {
|
||||
recognizedListResult = result.get( model.getUuid() );
|
||||
recognizedListResult.distanceX = model.getDistance_x();
|
||||
recognizedListResult.distanceY = model.getDistance_y();
|
||||
}
|
||||
ADASRecognizedListResult recognizedListResult = new ADASRecognizedListResult();
|
||||
recognizedListResult.heading = model.getHeading();
|
||||
recognizedListResult.speed = model.getSpeed();
|
||||
recognizedListResult.type = Integer.valueOf( model.getType() );
|
||||
recognizedListResult.uuid = model.getUuid();
|
||||
recognizedListResult.distanceX = model.getDistance_x();
|
||||
recognizedListResult.distanceY = model.getDistance_y();
|
||||
double amapCoord[] = CoordinateUtils.transformWgsToGcj( model.getLat(), model.getLon() );
|
||||
recognizedListResult.latLonList.add( new ADASRecognizedListResult.LatLon( amapCoord[1], amapCoord[0] ) );
|
||||
recognizedListResult.lat = amapCoord[1];
|
||||
recognizedListResult.lon = amapCoord[0];
|
||||
try {
|
||||
recognizedListResult.systemTime = Long.valueOf( model.getSystemTime() );
|
||||
} catch ( Exception e ) {
|
||||
recognizedListResult.systemTime = System.currentTimeMillis();
|
||||
}
|
||||
recognizedListResults.add( recognizedListResult );
|
||||
}
|
||||
}
|
||||
if ( result.isEmpty() ) {
|
||||
return null;
|
||||
}
|
||||
return new ArrayList<>( result.values() );
|
||||
return recognizedListResults;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.mogo.service.impl.adas;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/1/22
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class LogWriter {
|
||||
|
||||
|
||||
public static final int MAX_SIZE = 6 * 1024 * 1924;
|
||||
|
||||
private final String path;
|
||||
private Handler writeHandler = null;
|
||||
|
||||
public LogWriter( String path ) {
|
||||
this.path = path;
|
||||
File file = new File( path );
|
||||
if ( !file.exists() ) {
|
||||
try {
|
||||
if ( !file.getParentFile().exists() ) {
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
file.createNewFile();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
writeHandler = new Handler( WorkThreadHandler.newInstance( "Logger-Writer" ).getLooper() ) {
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
super.handleMessage( msg );
|
||||
if ( msg.what == 100 ) {
|
||||
writeImpl( ( ( String ) msg.obj ) );
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void writeImpl( Object log ) {
|
||||
try {
|
||||
FileWriter fw = new FileWriter( path, true );
|
||||
fw.append( System.currentTimeMillis() + " - " );
|
||||
fw.append( GsonUtil.jsonFromObject( log ) );
|
||||
fw.append( "\n" );
|
||||
fw.flush();
|
||||
fw.close();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void write( Object log ) {
|
||||
Message msg = Message.obtain();
|
||||
msg.obj = log;
|
||||
msg.what = 100;
|
||||
writeHandler.sendMessage( msg );
|
||||
}
|
||||
}
|
||||
@@ -20,10 +20,12 @@ import com.mogo.module.common.map.MyLocationUtil;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.adas.IMogoAdasCarDataCallback;
|
||||
import com.mogo.service.adas.IMogoAdasDataCallback;
|
||||
import com.mogo.service.adas.IMogoAdasRecognizedDataCallback;
|
||||
import com.mogo.service.adas.IMogoAdasWarnMessageCallback;
|
||||
import com.mogo.service.adas.RemoteControlAutoPilotParameters;
|
||||
import com.mogo.service.adas.entity.ADASCarStateInfo;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedListResult;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.adas.entity.ADASWarnMessage;
|
||||
@@ -42,7 +44,9 @@ import com.zhidao.adasconfig.common.config.EnumSkinStyle;
|
||||
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
|
||||
import com.zhidao.autopilot.support.api.IAutopilotServiceStatusListener;
|
||||
import com.zhidao.autopilot.support.api.IAutopolitDataCallBack;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotArriveModel;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.bean.CarStateInfo;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
import com.zhidao.support.adas.high.msg.MyMessageFactory;
|
||||
@@ -106,15 +110,25 @@ public class MogoADASController implements IMogoADASController {
|
||||
*/
|
||||
private List< IMogoAdasRecognizedDataCallback > mMogoAdasRecognizedDataCallbacks = new CopyOnWriteArrayList<>();
|
||||
|
||||
private IMogoAdasCarDataCallback mMogoAdasCarDataCallback;
|
||||
|
||||
private RectInfo mLastFrameData;
|
||||
|
||||
private OnAdasListener mOnAdasListener = new OnAdasListenerAdapter() {
|
||||
|
||||
LogWriter logWriter = null;
|
||||
|
||||
@Override
|
||||
public void onRectData( RectInfo rectInfo ) {
|
||||
// 物体识别返回
|
||||
Logger.d( TAG, "onRectData = %s", rectInfo.toString() );
|
||||
if ( logWriter == null ) {
|
||||
String path = context.getExternalCacheDir().getAbsolutePath() + "/adaslog/log.txt";
|
||||
Logger.d( TAG, path );
|
||||
logWriter = new LogWriter( path );
|
||||
}
|
||||
mLastFrameData = rectInfo;
|
||||
logWriter.write( GsonUtil.jsonFromObject( rectInfo ) );
|
||||
// 仅在 vr 模式下显示 adas 识别车辆
|
||||
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
return;
|
||||
@@ -290,6 +304,19 @@ public class MogoADASController implements IMogoADASController {
|
||||
public void showToast( String msg ) {
|
||||
UiThreadHandler.post( () -> TipToast.tip( msg ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotArrive( AdasAIDLAutopilotArriveModel autopilotArriveModel ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ownerCarStateInfo( String ownerCarStateInfo ) {
|
||||
ADASCarStateInfo stateInfo = GsonUtil.objectFromJson( ownerCarStateInfo, ADASCarStateInfo.class );
|
||||
if ( mMogoAdasCarDataCallback != null ) {
|
||||
mMogoAdasCarDataCallback.onAdasCarDataCallback( stateInfo );
|
||||
}
|
||||
}
|
||||
};
|
||||
AutopilotServiceManage.getInstance().registerAutopilotDataListener( mAutopolitDataCallBack );
|
||||
}
|
||||
@@ -569,4 +596,9 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
mMogoAdasRecognizedDataCallbacks.remove( callback );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAdasCarDataCallback( IMogoAdasCarDataCallback carDataCallback ) {
|
||||
mMogoAdasCarDataCallback = carDataCallback;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user