add new func of ezhou airport and upgrade the aiSdkVersion to fit demo server
This commit is contained in:
@@ -16,6 +16,7 @@ import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.service.dispatch.DispatchAutoPilotManager;
|
||||
import com.mogo.module.service.location.MogoRTKLocation;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
@@ -101,9 +102,10 @@ public class MogoServiceProvider implements IMogoModuleProvider {
|
||||
MarkerServiceHandler.init( context );
|
||||
// if ( DebugConfig.isNeedUploadCoordinatesDurationInTime() ) {
|
||||
// }
|
||||
MogoRTKLocation.getInstance().init();
|
||||
// MogoRTKLocation.getInstance().init(); //todo RTK LOCATION Close
|
||||
MogoServices.getInstance().preInit( context );
|
||||
MogoServices.getInstance().init( AbsMogoApplication.getApp() );
|
||||
DispatchAutoPilotManager.getInstance().initSocket(context);
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
}, 5_000L );
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.common.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
|
||||
import com.mogo.module.service.autopilot.AutoPilotRemoteController;
|
||||
import com.mogo.module.service.handler.MainLooperHandler;
|
||||
import com.mogo.module.service.handler.RefreshWorkThreadHandler;
|
||||
@@ -47,6 +47,7 @@ import com.mogo.module.service.refresh.AutoRefreshStrategy;
|
||||
import com.mogo.module.service.refresh.CustomRefreshStrategy;
|
||||
import com.mogo.module.service.refresh.RefreshObject;
|
||||
import com.mogo.module.service.strategy.CarIconDisplayStrategy;
|
||||
import com.mogo.module.service.timedelay.TimeDelayUploadManager;
|
||||
import com.mogo.module.service.ttsConfig.TtsConfigModleData;
|
||||
import com.mogo.realtime.api.MoGoAiCloudRealTime;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
@@ -391,6 +392,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
if ( DebugConfig.isNeedUploadCoordinatesDurationInTime() ) {
|
||||
MoGoAiCloudRealTime.startRealTime( mContext, DebugConfig.getSocketAppId() );
|
||||
}
|
||||
TimeDelayUploadManager.getInstance().init(context);
|
||||
}
|
||||
|
||||
public void initLocationServiceProcess( Context context ) {
|
||||
@@ -960,6 +962,11 @@ public class MogoServices implements IMogoMapListener,
|
||||
|
||||
@Override
|
||||
public void onAdasCarDataCallback( ADASCarStateInfo stateInfo ) {
|
||||
|
||||
if(TimeDelayUploadManager.getInstance().isMock()){ //模拟数据时,不更新由工控机传输的自车位置
|
||||
return;
|
||||
}
|
||||
|
||||
if ( stateInfo != null && stateInfo.getValues() != null ) {
|
||||
JSONObject data = new JSONObject();
|
||||
try {
|
||||
@@ -991,7 +998,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
e.printStackTrace();
|
||||
}
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map( data );
|
||||
SnapshotLocationController.getInstance().syncAdasLocationInfo( data );
|
||||
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo( data );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
package com.mogo.module.service.dispatch;
|
||||
|
||||
import static com.mogo.module.service.dispatch.model.DispatchServiceModel.DISPATCH_RESULT_AFFIRM;
|
||||
|
||||
import android.content.Context;
|
||||
import android.location.Location;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.service.dispatch.bean.AutopilotRoute;
|
||||
import com.mogo.module.service.dispatch.bean.DispatchAdasAutoPilotLocReceiverBean;
|
||||
import com.mogo.module.service.dispatch.bean.DispatchData;
|
||||
import com.mogo.module.service.dispatch.bean.EndLatLon;
|
||||
import com.mogo.module.service.dispatch.bean.StartLatLon;
|
||||
import com.mogo.module.service.dispatch.model.DispatchResult;
|
||||
import com.mogo.module.service.dispatch.model.DispatchServiceModel;
|
||||
import com.mogo.module.service.dispatch.model.IDispatch;
|
||||
import com.mogo.service.adas.RemoteControlAutoPilotParameters;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
//todo 后续拆解是否放到网约车模块,画线部分已与产品沟通,放入后续迭代需求
|
||||
//负责监听自动驾驶状态并进行状态上报,自动驾驶路线上报,接收调度指令展示指令弹窗
|
||||
public class DispatchAutoPilotManager implements IMogoOnMessageListener<DispatchAdasAutoPilotLocReceiverBean>
|
||||
, DispatchRemindDialog.IDispatchRemindClickListener
|
||||
, IMogoCarLocationChangedListener2 {
|
||||
|
||||
private static final String TAG = "DispatchAutoPilotManager";
|
||||
private static volatile DispatchAutoPilotManager instance;
|
||||
private static final byte[] obj = new byte[0];
|
||||
private Context mContext;
|
||||
private static final int MSG_SOCKET_TYPE = 501000;
|
||||
private static final int MSG_TYPE_SHOW_DIALOG = 0;
|
||||
|
||||
private DispatchRemindDialog dispatchRemindDialog;
|
||||
private MogoLocation mogoLocation;
|
||||
private DispatchAdasAutoPilotLocReceiverBean receiverBean;
|
||||
|
||||
private DispatchAutoPilotManager() {
|
||||
|
||||
}
|
||||
|
||||
public static DispatchAutoPilotManager getInstance() {
|
||||
if (instance == null) {
|
||||
synchronized (obj) {
|
||||
if (instance == null) {
|
||||
instance = new DispatchAutoPilotManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private final Handler handler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
if (msg.what == MSG_TYPE_SHOW_DIALOG) {
|
||||
DispatchAdasAutoPilotLocReceiverBean msgData = (DispatchAdasAutoPilotLocReceiverBean) msg.obj;
|
||||
dispatchRemindDialog.showDialog(msgData);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void initSocket(Context context) {
|
||||
mContext = context;
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getSocketManagerApi(context).registerOnMessageListener(MSG_SOCKET_TYPE, this);
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi()
|
||||
.registerCarLocationChangedListener(TAG, this);
|
||||
dispatchRemindDialog = new DispatchRemindDialog(context);
|
||||
dispatchRemindDialog.addIDispatchRemindListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<DispatchAdasAutoPilotLocReceiverBean> target() {
|
||||
return DispatchAdasAutoPilotLocReceiverBean.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(DispatchAdasAutoPilotLocReceiverBean adasAutoPilotLocReceiverBean) {
|
||||
if (adasAutoPilotLocReceiverBean != null
|
||||
&& adasAutoPilotLocReceiverBean.getStartLat() != 0.0
|
||||
&& adasAutoPilotLocReceiverBean.getStartLon() != 0.0) {
|
||||
this.receiverBean = adasAutoPilotLocReceiverBean;
|
||||
Message message = new Message();
|
||||
message.what = MSG_TYPE_SHOW_DIALOG;
|
||||
message.obj = adasAutoPilotLocReceiverBean;
|
||||
handler.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void affirm() {
|
||||
DispatchServiceModel.getInstance().dispatchResultUpload(DISPATCH_RESULT_AFFIRM, new IDispatch() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Logger.d(TAG, "");
|
||||
RemoteControlAutoPilotParameters currentAutopilot = new RemoteControlAutoPilotParameters();
|
||||
currentAutopilot.isSpeakVoice = false;
|
||||
currentAutopilot.startLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat(receiverBean.getStartLat(), receiverBean.getStartLon());
|
||||
currentAutopilot.endLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat(receiverBean.getEndLat(), receiverBean.getEndLon());
|
||||
currentAutopilot.vehicleType = 10;
|
||||
Logger.d(TAG, "开启自动驾驶====" + currentAutopilot);
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().aiCloudToAdasData(currentAutopilot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String msg) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location location) {
|
||||
//坐标转换
|
||||
MogoLocation loc = new MogoLocation();
|
||||
loc.setTime(loc.getTime());
|
||||
loc.setAccuracy(location.getAccuracy());
|
||||
loc.setSpeed(location.getSpeed());
|
||||
loc.setLongitude(location.getLongitude());
|
||||
loc.setLatitude(location.getLatitude());
|
||||
loc.setAltitude(location.getAltitude());
|
||||
loc.setBearing(location.getBearing());
|
||||
loc.setProvider(location.getProvider());
|
||||
mogoLocation = loc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MogoLatLng mogoLatLng) {
|
||||
|
||||
}
|
||||
|
||||
public void test() {
|
||||
Logger.d(TAG, "test to trigger mock autopilot");
|
||||
DispatchAdasAutoPilotLocReceiverBean adasAutoPilotLocReceiverBean = new DispatchAdasAutoPilotLocReceiverBean(
|
||||
"1", 26.825571122, 112.5762410415, "起点---5号跑道",
|
||||
26.825571122, 112.5762410415, "终点---鄂州机场",
|
||||
"" + System.currentTimeMillis(), "AR453航班", "实现调度", System.currentTimeMillis());
|
||||
this.receiverBean = adasAutoPilotLocReceiverBean;
|
||||
dispatchRemindDialog.showDialog(adasAutoPilotLocReceiverBean);
|
||||
}
|
||||
|
||||
public void testUploadAutopilotRoute() {
|
||||
List<AutopilotRoute.RouteModels> list = new ArrayList<>();
|
||||
AutopilotRoute.RouteModels routeModels = new AutopilotRoute.RouteModels();
|
||||
routeModels.setLat(12.12);
|
||||
routeModels.setLon(13.14);
|
||||
list.add(routeModels);
|
||||
DispatchServiceModel.getInstance().uploadAutopilotRoute(list);
|
||||
}
|
||||
|
||||
public void testDispatchResultUpload() {
|
||||
DispatchServiceModel.getInstance().dispatchResultUpload(DISPATCH_RESULT_AFFIRM, new IDispatch() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String msg) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.mogo.module.service.dispatch;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.module.service.dispatch.bean.DispatchAdasAutoPilotLocReceiverBean;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
|
||||
public class DispatchRemindDialog extends BaseFloatDialog {
|
||||
|
||||
private static final String TAG = "DispatchRemindDialog";
|
||||
private IDispatchRemindClickListener mListener;
|
||||
|
||||
private final TextView tvStartLoc;
|
||||
private final TextView tvEndLoc;
|
||||
private final TextView tvTaskTime;
|
||||
private final TextView tvFlightInfo;
|
||||
private final TextView tvTaskContent;
|
||||
|
||||
public DispatchRemindDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
setContentView(R.layout.module_dialog_adas_dispatch_remind);
|
||||
setCanceledOnTouchOutside(false);
|
||||
tvStartLoc = findViewById(R.id.module_services_dispatch_dialog_start_content);
|
||||
tvEndLoc = findViewById(R.id.module_services_dispatch_dialog_end_content);
|
||||
tvTaskTime = findViewById(R.id.module_services_dispatch_dialog_task_time);
|
||||
tvFlightInfo = findViewById(R.id.module_services_dispatch_dialog_flight_time);
|
||||
tvTaskContent = findViewById(R.id.module_services_dispatch_dialog_task_content);
|
||||
Button btnAffirm = (Button) findViewById(R.id.module_services_dispatch_dialog_confirm);
|
||||
btnAffirm.setOnClickListener(v -> {
|
||||
if (mListener != null) {
|
||||
mListener.affirm();
|
||||
dismissDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void showDialog(DispatchAdasAutoPilotLocReceiverBean dispatchContent) {
|
||||
show();
|
||||
tvStartLoc.setText(dispatchContent.getStartLocAddress());
|
||||
tvEndLoc.setText(dispatchContent.getEndLocAddress());
|
||||
tvTaskTime.setText(dispatchContent.getTaskTime());
|
||||
tvFlightInfo.setText(dispatchContent.getFlightInfo());
|
||||
tvTaskContent.setText(dispatchContent.getTaskInfo());
|
||||
}
|
||||
|
||||
private void dismissDialog() {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
public void addIDispatchRemindListener(IDispatchRemindClickListener listener) {
|
||||
if (listener == null) {
|
||||
Logger.d(TAG, "addIDispatchRemindListener listener is null");
|
||||
return;
|
||||
}
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
public interface IDispatchRemindClickListener {
|
||||
|
||||
void affirm();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.mogo.module.service.dispatch;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
public class DispatchTestPanelBroadCastReceiver extends BroadcastReceiver {
|
||||
|
||||
private static final String TAG = "DispatchTestPanelBroadCastReceiver";
|
||||
|
||||
/**
|
||||
* Adas测试控制面板广播Action
|
||||
*/
|
||||
public static final String BROADCAST_TEST_PANEL_CONTROL_TYPE_EXTRA_KEY = "sceneType";
|
||||
|
||||
private Context mContext;
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
try {
|
||||
this.mContext = context;
|
||||
int sceneType = intent.getIntExtra(BROADCAST_TEST_PANEL_CONTROL_TYPE_EXTRA_KEY, 0);
|
||||
Logger.d(TAG, "textPanelOpenType:" + sceneType);
|
||||
// 分发场景
|
||||
dispatchSceneTest(sceneType);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分发处理场景
|
||||
*
|
||||
* @param sceneType 场景类型
|
||||
*/
|
||||
private void dispatchSceneTest(int sceneType) {
|
||||
Logger.d(TAG, "sceneType=" + sceneType);
|
||||
if (sceneType == 0) {//打开调度弹窗
|
||||
DispatchAutoPilotManager.getInstance().test();
|
||||
} else if(sceneType == 1){ //验证自动驾驶路线上报接口
|
||||
DispatchAutoPilotManager.getInstance().testUploadAutopilotRoute();
|
||||
} else if(sceneType == 2){ //验证自动驾驶调度上报接口
|
||||
DispatchAutoPilotManager.getInstance().testDispatchResultUpload();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/5/28 16:12
|
||||
*/
|
||||
public class AutonomousDriveStatusBean {
|
||||
|
||||
private String sn;
|
||||
private int status;
|
||||
private float vehicleSpeed;
|
||||
|
||||
public AutonomousDriveStatusBean(String sn, int status, float vehicleSpeed) {
|
||||
this.sn = sn;
|
||||
this.status = status;
|
||||
this.vehicleSpeed = vehicleSpeed;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public float getVehicleSpeed() {
|
||||
return vehicleSpeed;
|
||||
}
|
||||
|
||||
public void setVehicleSpeed(float vehicleSpeed) {
|
||||
this.vehicleSpeed = vehicleSpeed;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author song kenan
|
||||
* @des
|
||||
* @date 2021/6/21
|
||||
*/
|
||||
|
||||
public class AutopilotRoute {
|
||||
|
||||
@SerializedName("action")
|
||||
private String action;
|
||||
@SerializedName("models")
|
||||
private List<RouteModels> models;
|
||||
|
||||
public static class RouteModels {
|
||||
@SerializedName("lat")
|
||||
private Double lat;
|
||||
@SerializedName("lon")
|
||||
private Double lon;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RouteModels{" +
|
||||
"lat=" + lat +
|
||||
", lon=" + lon +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public List<RouteModels> getModels() {
|
||||
return models;
|
||||
}
|
||||
|
||||
public void setModels(List<RouteModels> models) {
|
||||
this.models = models;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutopilotRoute{" +
|
||||
"action='" + action + '\'' +
|
||||
", models=" + models +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author nie yunlong
|
||||
* @des
|
||||
* @date 2020/7/14
|
||||
*/
|
||||
public class AutopilotStatus implements Serializable {
|
||||
|
||||
/**
|
||||
* action : autopilotstate
|
||||
* values : {"state":0,"reason":""}
|
||||
*/
|
||||
|
||||
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 {
|
||||
/**
|
||||
* 0是不可用 1是ready 2是自动驾驶start
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private int state;
|
||||
/**
|
||||
* 车速 m/s
|
||||
*/
|
||||
private float speed;
|
||||
/**
|
||||
* 不可用原因
|
||||
*/
|
||||
private String reason;
|
||||
/**
|
||||
* 摄像头状态 1代表开启,0代表关闭
|
||||
*/
|
||||
private int camera;
|
||||
/**
|
||||
* 雷达状态 1代表开启,0代表关闭
|
||||
*/
|
||||
private int radar;
|
||||
/**
|
||||
* RTK状态 1代表开启,0代表关闭
|
||||
*/
|
||||
private int rtk;
|
||||
/**
|
||||
* 自动驾驶状态 0非自动驾驶,1自动驾驶
|
||||
*/
|
||||
private int pilotmode;
|
||||
|
||||
|
||||
public int getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(int state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(float speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
public int getCamera() {
|
||||
return camera;
|
||||
}
|
||||
|
||||
public int getRadar() {
|
||||
return radar;
|
||||
}
|
||||
|
||||
public int getRtk() {
|
||||
return rtk;
|
||||
}
|
||||
|
||||
public int getPilotmode() {
|
||||
return pilotmode;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
public class DispatchAdasAutoPilotLocReceiverBean {
|
||||
|
||||
private String poiId;
|
||||
|
||||
private double startLat;
|
||||
private double startLon;
|
||||
private String startLocAddress;
|
||||
|
||||
private double endLat;
|
||||
private double endLon;
|
||||
private String endLocAddress;
|
||||
|
||||
private String taskTime;
|
||||
private String flightInfo;
|
||||
private String taskInfo;
|
||||
private long systemTime;
|
||||
|
||||
public DispatchAdasAutoPilotLocReceiverBean(String poiId, double startLat, double startLon, String startLocAddress, double endLat, double endLon, String endLocAddress, String taskTime, String flightInfo, String taskInfo, long systemTime) {
|
||||
this.poiId = poiId;
|
||||
this.startLat = startLat;
|
||||
this.startLon = startLon;
|
||||
this.startLocAddress = startLocAddress;
|
||||
this.endLat = endLat;
|
||||
this.endLon = endLon;
|
||||
this.endLocAddress = endLocAddress;
|
||||
this.taskTime = taskTime;
|
||||
this.flightInfo = flightInfo;
|
||||
this.taskInfo = taskInfo;
|
||||
this.systemTime = systemTime;
|
||||
}
|
||||
|
||||
public String getPoiId() {
|
||||
return poiId;
|
||||
}
|
||||
|
||||
public void setPoiId(String poiId) {
|
||||
this.poiId = poiId;
|
||||
}
|
||||
|
||||
public double getStartLat() {
|
||||
return startLat;
|
||||
}
|
||||
|
||||
public void setStartLat(double startLat) {
|
||||
this.startLat = startLat;
|
||||
}
|
||||
|
||||
public double getStartLon() {
|
||||
return startLon;
|
||||
}
|
||||
|
||||
public void setStartLon(double startLon) {
|
||||
this.startLon = startLon;
|
||||
}
|
||||
|
||||
public String getStartLocAddress() {
|
||||
return startLocAddress;
|
||||
}
|
||||
|
||||
public void setStartLocAddress(String startLocAddress) {
|
||||
this.startLocAddress = startLocAddress;
|
||||
}
|
||||
|
||||
public double getEndLat() {
|
||||
return endLat;
|
||||
}
|
||||
|
||||
public void setEndLat(double endLat) {
|
||||
this.endLat = endLat;
|
||||
}
|
||||
|
||||
public double getEndLon() {
|
||||
return endLon;
|
||||
}
|
||||
|
||||
public void setEndLon(double endLon) {
|
||||
this.endLon = endLon;
|
||||
}
|
||||
|
||||
public String getEndLocAddress() {
|
||||
return endLocAddress;
|
||||
}
|
||||
|
||||
public void setEndLocAddress(String endLocAddress) {
|
||||
this.endLocAddress = endLocAddress;
|
||||
}
|
||||
|
||||
public String getTaskTime() {
|
||||
return taskTime;
|
||||
}
|
||||
|
||||
public void setTaskTime(String taskTime) {
|
||||
this.taskTime = taskTime;
|
||||
}
|
||||
|
||||
public String getFlightInfo() {
|
||||
return flightInfo;
|
||||
}
|
||||
|
||||
public void setFlightInfo(String flightInfo) {
|
||||
this.flightInfo = flightInfo;
|
||||
}
|
||||
|
||||
public String getTaskInfo() {
|
||||
return taskInfo;
|
||||
}
|
||||
|
||||
public void setTaskInfo(String taskInfo) {
|
||||
this.taskInfo = taskInfo;
|
||||
}
|
||||
|
||||
public long getSystemTime() {
|
||||
return systemTime;
|
||||
}
|
||||
|
||||
public void setSystemTime(long systemTime) {
|
||||
this.systemTime = systemTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DispatchAdasAutoPilotLocReceiverBean{" +
|
||||
"poiId='" + poiId + '\'' +
|
||||
", startLat=" + startLat +
|
||||
", startLon=" + startLon +
|
||||
", startLocAddress='" + startLocAddress + '\'' +
|
||||
", endLat=" + endLat +
|
||||
", endLon=" + endLon +
|
||||
", endLocAddress='" + endLocAddress + '\'' +
|
||||
", taskTime='" + taskTime + '\'' +
|
||||
", flightInfo='" + flightInfo + '\'' +
|
||||
", taskInfo='" + taskInfo + '\'' +
|
||||
", systemTime=" + systemTime +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
import com.mogo.module.service.dispatch.model.DispatchResult;
|
||||
|
||||
public class DispatchData {
|
||||
|
||||
private String action;
|
||||
private DispatchResult result;
|
||||
|
||||
public DispatchData(String action, DispatchResult result) {
|
||||
this.action = action;
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public DispatchResult getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(DispatchResult result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DispatchData{" +
|
||||
"action='" + action + '\'' +
|
||||
", result=" + result +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
public class EndLatLon {
|
||||
|
||||
private double lat;
|
||||
private double lon;
|
||||
|
||||
public EndLatLon(double lat, double lon) {
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndLatLon{" +
|
||||
"lat=" + lat +
|
||||
", lon=" + lon +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
public class ReportDispatchResult {
|
||||
|
||||
private String sn;
|
||||
private int dispatchResult;
|
||||
|
||||
public ReportDispatchResult(String sn, int dispatchResult) {
|
||||
this.sn = sn;
|
||||
this.dispatchResult = dispatchResult;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getDispatchResult() {
|
||||
return dispatchResult;
|
||||
}
|
||||
|
||||
public void setDispatchResult(int dispatchResult) {
|
||||
this.dispatchResult = dispatchResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ReportDispatchResult{" +
|
||||
"sn='" + sn + '\'' +
|
||||
", dispatchResult=" + dispatchResult +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/5/31 16:24
|
||||
*/
|
||||
public class ReportSiteBean {
|
||||
private String sn;
|
||||
private double lon;
|
||||
private double lat;
|
||||
|
||||
public ReportSiteBean(String sn, double lon, double lat) {
|
||||
this.sn = sn;
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
|
||||
/**
|
||||
* 上报自动驾驶规划的路径
|
||||
*/
|
||||
public class ReportedRoute {
|
||||
private String sn;
|
||||
private AutopilotStatus.ValuesBean bean;
|
||||
private String siteList;
|
||||
|
||||
public ReportedRoute(String sn, AutopilotStatus.ValuesBean bean) {
|
||||
this.sn = sn;
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
public ReportedRoute(String sn, String siteList) {
|
||||
this.sn = sn;
|
||||
this.siteList = siteList;
|
||||
}
|
||||
|
||||
public String getSiteList() {
|
||||
return siteList;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return "{\"sn\":\"" + sn + "\",\"state\":" + bean.getState() + ",\"speed\":" + bean.getSpeed() + ",\"reason\":\"" + bean.getReason() + "\",\"camera\":" + bean.getCamera() + ",\"radar\":" + bean.getRadar() + ",\"rtk\":" + bean.getRtk() + "}";
|
||||
}
|
||||
|
||||
public String getRoute() {
|
||||
return "{\"sn\":\"" + sn + "\",\"siteList\":" + siteList + "}";
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
public class StartLatLon {
|
||||
|
||||
private double lat;
|
||||
private double lon;
|
||||
|
||||
public StartLatLon(double lat, double lon) {
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StartLatLon{" +
|
||||
"lat=" + lat +
|
||||
", lon=" + lon +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.mogo.module.service.dispatch.model;
|
||||
|
||||
import com.mogo.module.service.dispatch.bean.EndLatLon;
|
||||
import com.mogo.module.service.dispatch.bean.StartLatLon;
|
||||
|
||||
public class DispatchResult {
|
||||
|
||||
private StartLatLon startLatLon;
|
||||
private EndLatLon endLatLon;
|
||||
|
||||
public DispatchResult(StartLatLon startLatLon, EndLatLon endLatLon) {
|
||||
this.startLatLon = startLatLon;
|
||||
this.endLatLon = endLatLon;
|
||||
}
|
||||
|
||||
public StartLatLon getStartLatLon() {
|
||||
return startLatLon;
|
||||
}
|
||||
|
||||
public void setStartLatLon(StartLatLon startLatLon) {
|
||||
this.startLatLon = startLatLon;
|
||||
}
|
||||
|
||||
public EndLatLon getEndLatLon() {
|
||||
return endLatLon;
|
||||
}
|
||||
|
||||
public void setEndLatLon(EndLatLon endLatLon) {
|
||||
this.endLatLon = endLatLon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DispatchResult{" +
|
||||
"startLatLon=" + startLatLon +
|
||||
", endLatLon=" + endLatLon +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.mogo.module.service.dispatch.model;
|
||||
|
||||
import static com.mogo.commons.context.ContextHolderUtil.getContext;
|
||||
import static com.mogo.module.common.constants.HostConst.DATA_SERVICE_HOST;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.data.BaseData;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.service.dispatch.bean.AutopilotRoute;
|
||||
import com.mogo.module.service.dispatch.bean.ReportDispatchResult;
|
||||
import com.mogo.module.service.dispatch.bean.ReportedRoute;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
public class DispatchServiceModel {
|
||||
|
||||
private static final String TAG = "AdasServiceModel";
|
||||
private static volatile DispatchServiceModel instance;
|
||||
private static final byte[] obj = new byte[0];
|
||||
|
||||
public static final int DISPATCH_RESULT_AFFIRM = 0;
|
||||
public static final int DISPATCH_RESULT_MANUAL_CANCEL = 1;
|
||||
public static final int DISPATCH_RESULT_TIMER_CANCEL = 2;
|
||||
|
||||
private final IDispatchAdasApiService mAdasApiService;
|
||||
|
||||
private DispatchServiceModel() {
|
||||
this.mAdasApiService = MogoApisHandler.getInstance().getApis().getNetworkApi().create(IDispatchAdasApiService.class, DATA_SERVICE_HOST);
|
||||
}
|
||||
|
||||
public static DispatchServiceModel getInstance() {
|
||||
if (instance == null) {
|
||||
synchronized (obj) {
|
||||
if (instance == null) {
|
||||
instance = new DispatchServiceModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报自动驾驶路线
|
||||
*
|
||||
* @param list 路线集合
|
||||
*/
|
||||
public void uploadAutopilotRoute(List<AutopilotRoute.RouteModels> list) {
|
||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
ReportedRoute reportedRoute = new ReportedRoute(sn, GsonUtil.jsonFromObject(list));
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sn", sn);
|
||||
map.put("data", GsonUtil.jsonFromObject(reportedRoute));
|
||||
mAdasApiService.uploadAutopilotRoute(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(getContext())) {
|
||||
@Override
|
||||
public void onNext(BaseData o) {
|
||||
super.onNext(o);
|
||||
Logger.d(TAG, "uploadAutopilotRoute success");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
Logger.d(TAG, "uploadAutopilotRoute error : " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
super.onSuccess(o);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报调度处理结果
|
||||
*
|
||||
* @param dispatchResultType int
|
||||
*/
|
||||
public void dispatchResultUpload(int dispatchResultType, IDispatch dispatch) {
|
||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
ReportDispatchResult reportDispatchResult = new ReportDispatchResult(sn, dispatchResultType);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sn", sn);
|
||||
map.put("data", GsonUtil.jsonFromObject(reportDispatchResult));
|
||||
mAdasApiService.uploadDispatchResult(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(getContext())) {
|
||||
@Override
|
||||
public void onNext(BaseData o) {
|
||||
super.onNext(o);
|
||||
Logger.d(TAG, "dispatchResultUpload success");
|
||||
dispatch.onSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
Logger.d(TAG, "dispatchResultUpload error : " + e.getMessage());
|
||||
dispatch.onError(e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
super.onSuccess(o);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.mogo.module.service.dispatch.model;
|
||||
|
||||
public interface IDispatch {
|
||||
|
||||
void onSuccess();
|
||||
|
||||
void onError(String msg);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.mogo.module.service.dispatch.model;
|
||||
|
||||
import com.mogo.commons.data.BaseData;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface IDispatchAdasApiService {
|
||||
|
||||
/**
|
||||
* 上报自动驾驶路径 服务于业务调度
|
||||
*
|
||||
* @param parameters map
|
||||
* @return {@link BaseData}
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/dataService/autoDriver/receiveCarPreSetPath")
|
||||
Observable<BaseData> uploadAutopilotRoute(@FieldMap Map<String, Object> parameters);
|
||||
|
||||
/**
|
||||
* 上报自动驾驶调度处理结果 服务于业务调度
|
||||
*
|
||||
* @param parameters map
|
||||
* @return {@link BaseData}
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/dataService/autoDriver/receiverDestSiteResult")
|
||||
Observable<BaseData> uploadDispatchResult(@FieldMap Map<String, Object> parameters);
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.module.common.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.carinfo.CarStateInfo;
|
||||
@@ -73,7 +73,7 @@ class ADASStatusIntentHandler implements IntentHandler {
|
||||
data.putOpt( "acceleration", stateInfo.getValues().getAcceleration() );
|
||||
data.putOpt( "yawRate", stateInfo.getValues().getYaw_rate() );
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map( data );
|
||||
SnapshotLocationController.getInstance().syncAdasLocationInfo( data );
|
||||
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo( data );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.cloud.socket.entity.SocketDownDataHelper;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
@@ -31,16 +33,14 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.dialog.WMDialog;
|
||||
import com.mogo.module.common.drawer.SnapshotSetDataDrawer;
|
||||
import com.mogo.module.common.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.module.service.status.EnvStatusManager;
|
||||
import com.mogo.module.service.timedelay.TimeDelayUploadManager;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.realtime.entity.CloudRoadData;
|
||||
import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.service.adas.RemoteControlAutoPilotParameters;
|
||||
import com.mogo.service.adas.entity.ADASCarStateInfo;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.entrance.ButtonIndex;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
@@ -77,9 +77,11 @@ public class MockIntentHandler implements IntentHandler {
|
||||
final int oper = intent.getIntExtra("oper", -1);
|
||||
switch (oper) {
|
||||
case 1:
|
||||
// 展示自车位置
|
||||
MarkerServiceHandler.getMapUIController().showMyLocation(intent.getBooleanExtra("status", true));
|
||||
break;
|
||||
case 2:
|
||||
// 发起求助
|
||||
boolean status = intent.getBooleanExtra("status", false);
|
||||
MarkerServiceHandler.getMogoStatusManager().setSeekHelping(TAG, status);
|
||||
break;
|
||||
@@ -339,7 +341,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
MarkerServiceHandler.getApis().getRefreshStrategyControllerApi().restartAutoRefreshAtTime(duration);
|
||||
IMogoMarker marker = MarkerServiceHandler.getMarkerManager().addMarker(TAG, options);
|
||||
MarkerServiceHandler.getMogoStatusManager().setUserInteractionStatus(TAG, true, false);
|
||||
if(!MarkerServiceHandler.getApis().getStatusManagerApi().isVrMode()){
|
||||
if (!MarkerServiceHandler.getApis().getStatusManagerApi().isVrMode()) {
|
||||
MarkerServiceHandler.getMapUIController().moveToCenter(mogoLatLngs.get(0));
|
||||
}
|
||||
WorkThreadHandler.getInstance().post(() -> marker.startSmooth(mogoLatLngs, duration));
|
||||
@@ -403,7 +405,6 @@ public class MockIntentHandler implements IntentHandler {
|
||||
.syncLocation2Map(null);
|
||||
break;
|
||||
case 40:
|
||||
|
||||
double[][] coors = new double[][]{{40.17511749267578, 116.74359130859375},
|
||||
{40.20258331298828, 116.74071502685547},
|
||||
{40.202598571777344, 116.74067687988281},
|
||||
@@ -444,7 +445,6 @@ 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},
|
||||
@@ -543,8 +543,8 @@ public class MockIntentHandler implements IntentHandler {
|
||||
.openVrMode(false);
|
||||
break;
|
||||
case 46:// 模拟 自车周边数据
|
||||
String json = "{\"allList\":[{\"type\":3,\"uuid\":\"10009-5152\",\"lat\":40.1990809296,\"lon\":116.7393252195,\"speed\":0.0,\"heading\":0.0,\"systemTime\":1614329151909,\"vehicleType\":0,\"distance\":576.0,\"fromType\":3,\"isOnline\":0},{\"type\":3,\"uuid\":\"10009-5161\",\"lat\":40.1990827227,\"lon\":116.739325826,\"speed\":0.0,\"heading\":0.0,\"systemTime\":1614329151909,\"vehicleType\":0,\"distance\":576.0,\"fromType\":3,\"isOnline\":0}],\"nearList\":[],\"time\":1614329152238}";
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(GsonUtil.objectFromJson(json, MogoSnapshotSetData.class));
|
||||
// String json = "{\"allList\":[{\"type\":3,\"uuid\":\"10009-5152\",\"lat\":40.1990809296,\"lon\":116.7393252195,\"speed\":0.0,\"heading\":0.0,\"systemTime\":1614329151909,\"vehicleType\":0,\"distance\":576.0,\"fromType\":3,\"isOnline\":0},{\"type\":3,\"uuid\":\"10009-5161\",\"lat\":40.1990827227,\"lon\":116.739325826,\"speed\":0.0,\"heading\":0.0,\"systemTime\":1614329151909,\"vehicleType\":0,\"distance\":576.0,\"fromType\":3,\"isOnline\":0}],\"nearList\":[],\"time\":1614329152238}";
|
||||
// SnapshotSetDataDrawer.getInstance().renderSnapshotData(GsonUtil.objectFromJson(json, MogoSnapshotSetData.class));
|
||||
break;
|
||||
case 47:// 模拟鹰眼模式下绘制车辆周边的数据
|
||||
mTimeTickHandler.sendEmptyMessageDelayed(1, 0L);
|
||||
@@ -603,8 +603,8 @@ public class MockIntentHandler implements IntentHandler {
|
||||
DebugConfig.setSelfCarSpeedYOffset(intent.getIntExtra("yOffset", 20));
|
||||
break;
|
||||
case 51:// 模拟路口车辆移动
|
||||
mLocationMockHandler.sendEmptyMessageDelayed(100, 0L);
|
||||
mLocationMockHandler.sendEmptyMessageDelayed(101, 1000L);
|
||||
// mLocationMockHandler.sendEmptyMessageDelayed(100, 0L);
|
||||
// mLocationMockHandler.sendEmptyMessageDelayed(101, 1000L);
|
||||
break;
|
||||
case 52:
|
||||
// 打开连调工控机、ADAS的控制面板
|
||||
@@ -616,7 +616,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
DebugConfig.setUseAdasRecognize(isUseAdasRecognize);
|
||||
break;
|
||||
case 54:
|
||||
mTimeTickCarHandler.sendEmptyMessageDelayed(1, 0L);
|
||||
// mTimeTickCarHandler.sendEmptyMessageDelayed(1, 0L);
|
||||
break;
|
||||
case 55:
|
||||
//开启模拟数据Mock,用于验证算法准确性
|
||||
@@ -647,18 +647,22 @@ public class MockIntentHandler implements IntentHandler {
|
||||
*/
|
||||
private void handleRoadSideMockDataIntent() throws Exception {
|
||||
if (roadSizeBr == null) {
|
||||
roadSizeBr = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("roadSide.txt")));
|
||||
roadSizeBr = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("roadSide.txt"))); //todo 需要重新模拟一个test数据
|
||||
}
|
||||
String carsLine = roadSizeBr.readLine();
|
||||
MogoSnapshotSetData data = new MogoSnapshotSetData();
|
||||
List<CloudRoadData> allList = GsonUtil.arrayFromJson(carsLine, CloudRoadData.class);
|
||||
for (CloudRoadData cloudRoadData : allList) {
|
||||
cloudRoadData.setWgslat(cloudRoadData.getLat());
|
||||
cloudRoadData.setWgslon(cloudRoadData.getLon());
|
||||
cloudRoadData.setFromType(CloudRoadData.FROM_ROAD_UNIT);
|
||||
SocketDownData.LauncherSnapshotProto.Builder data = SocketDownData.LauncherSnapshotProto.newBuilder();
|
||||
List<SocketDownData.CloudRoadDataProto> allList = GsonUtil.arrayFromJson(carsLine, SocketDownData.CloudRoadDataProto.class);
|
||||
if (allList == null || allList.size() == 0) {
|
||||
return;
|
||||
}
|
||||
data.setAllList(allList);
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(data);
|
||||
for (SocketDownData.CloudRoadDataProto cloudRoadData : allList) {
|
||||
cloudRoadData.toBuilder()
|
||||
.setWgslat(cloudRoadData.getLon())
|
||||
.setWgslon(cloudRoadData.getLon())
|
||||
.setFromType(SocketDownDataHelper.FROM_ROAD_UNIT);
|
||||
}
|
||||
data.addAllAllList(allList);
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(data.build());
|
||||
mLocationMockHandler.sendEmptyMessageDelayed(101, 100L);
|
||||
}
|
||||
|
||||
@@ -848,9 +852,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
//改变rtk定位数据,触发自车移动
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map(jo);
|
||||
Log.i("mock-timer-loc-map", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
SnapshotLocationController.getInstance().syncAdasLocationInfo(jo);
|
||||
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo(jo);
|
||||
Log.i("mock-timer-loc", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
Log.i("mock-timer-loc-info",jo.toString());
|
||||
Log.i("mock-timer-loc-info", jo.toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -861,29 +865,30 @@ public class MockIntentHandler implements IntentHandler {
|
||||
* 模拟快照意图
|
||||
*/
|
||||
private boolean handleMockSnapshotIntent2() throws Exception {
|
||||
if (br4 == null) {
|
||||
br4 = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("snapshot.txt")));
|
||||
}
|
||||
String line = br4.readLine();
|
||||
if (line == null) {
|
||||
throw new Exception("end of file 2.");
|
||||
}
|
||||
MogoSnapshotSetData data = new MogoSnapshotSetData();
|
||||
List<CloudRoadData> allList = new ArrayList<>();
|
||||
CloudRoadData cloudRoadData = GsonUtil.objectFromJson(line, CloudRoadData.class);
|
||||
if (cloudRoadData == null) {
|
||||
return false;
|
||||
}
|
||||
cloudRoadData.setWgslon(cloudRoadData.getLon());
|
||||
cloudRoadData.setWgslat(cloudRoadData.getLat());
|
||||
cloudRoadData.setUuid("1_21");
|
||||
allList.add(cloudRoadData);
|
||||
data.setAllList(allList);
|
||||
|
||||
final long start = System.currentTimeMillis();
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(data);
|
||||
Log.i("mock-timer-snapshot", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
// mLocationMockHandler.sendEmptyMessageDelayed( 21, 100L );
|
||||
// if (br4 == null) {
|
||||
// br4 = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("snapshot.txt"))); todo 需要重新模拟一个test数据
|
||||
// }
|
||||
// String line = br4.readLine();
|
||||
// if (line == null) {
|
||||
// throw new Exception("end of file 2.");
|
||||
// }
|
||||
// SocketDownData.LauncherSnapshotProto.Builder data = SocketDownData.LauncherSnapshotProto.newBuilder();
|
||||
// List<SocketDownData.CloudRoadDataProto> allList = new ArrayList<>();
|
||||
// SocketDownData.CloudRoadDataProto cloudRoadData = GsonUtil.objectFromJson(line, SocketDownData.CloudRoadDataProto.class);
|
||||
// if (cloudRoadData == null) {
|
||||
// return false;
|
||||
// }
|
||||
// SocketDownData.CloudRoadDataProto.Builder builder = cloudRoadData.toBuilder();
|
||||
// builder.setWgslat(cloudRoadData.getLon());
|
||||
// builder.setWgslon(cloudRoadData.getLat());
|
||||
// builder.setUuid("1_21");
|
||||
// allList.add(cloudRoadData);
|
||||
// data.addAllAllList(allList);
|
||||
//
|
||||
// final long start = System.currentTimeMillis();
|
||||
// SnapshotSetDataDrawer.getInstance().renderSnapshotData(data.build());
|
||||
// Log.i("mock-timer-snapshot", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
//// mLocationMockHandler.sendEmptyMessageDelayed( 21, 100L );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -897,8 +902,8 @@ public class MockIntentHandler implements IntentHandler {
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
if (readers == null) {
|
||||
readers = new BufferedReader[10];
|
||||
for (int i = 0; i < 10; i++) {
|
||||
readers = new BufferedReader[200];
|
||||
for (int i = 0; i < 200; i++) {
|
||||
readers[i] = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("adas" + i + ".txt")));
|
||||
}
|
||||
}
|
||||
@@ -912,10 +917,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
}
|
||||
|
||||
AdasRec adasRec = new AdasRec();
|
||||
adasRec.models = allList;
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized(GsonUtil.jsonFromObject(adasRec));
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized(allList);
|
||||
Log.i("mock-timer-adas", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
return true;
|
||||
}
|
||||
@@ -942,16 +944,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
}
|
||||
|
||||
AdasRec adasRec = new AdasRec();
|
||||
adasRec.models = allList;
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized(GsonUtil.jsonFromObject(adasRec));
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized(allList);
|
||||
Log.i("mock-timer-adas", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
return true;
|
||||
}
|
||||
|
||||
public static class AdasRec {
|
||||
public String action = "view";
|
||||
public List<ADASRecognizedResult> models;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.module.service.location;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.location.Criteria;
|
||||
import android.location.Location;
|
||||
@@ -9,8 +10,8 @@ import android.os.Bundle;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
|
||||
import com.mogo.service.locationinfo.CloudLocationInfo;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
public class MogoRTKLocation {
|
||||
@@ -29,6 +30,7 @@ public class MogoRTKLocation {
|
||||
private MogoRTKLocation() {
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
public void init() {
|
||||
locationManager = (LocationManager) AbsMogoApplication.getApp().getApplicationContext().getSystemService(Context.LOCATION_SERVICE);
|
||||
String provider = locationManager.getBestProvider(getCriteria(), true);
|
||||
@@ -74,7 +76,7 @@ public class MogoRTKLocation {
|
||||
cloudLocationInfo.setSystemTime(System.currentTimeMillis());
|
||||
cloudLocationInfo.setTileId(String.valueOf(MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController()
|
||||
.getTileId(location.getLongitude(), location.getLatitude())));
|
||||
SnapshotLocationController.getInstance().syncLocationInfo(cloudLocationInfo);
|
||||
SnapshotLocationDataCenter.getInstance().syncLocationInfo(cloudLocationInfo);
|
||||
}
|
||||
} else {
|
||||
Logger.e(TAG, "location == null");
|
||||
@@ -102,7 +104,7 @@ public class MogoRTKLocation {
|
||||
if (locationManager != null && locationListener != null) {
|
||||
locationManager.removeUpdates(locationListener);
|
||||
} else {
|
||||
Logger.d(TAG, "stop failed , reason : loc" + locationManager + " , or loc listener: " + locationListener + " is null");
|
||||
Logger.d(TAG, "stop failed , listener: " + locationListener + " is null");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
@@ -39,10 +40,9 @@ import com.mogo.module.service.network.RefreshCallback;
|
||||
import com.mogo.module.service.network.RefreshModel;
|
||||
import com.mogo.module.service.polyline.LimberCollisionPolyline;
|
||||
import com.mogo.realtime.api.MoGoAiCloudRealTime;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
|
||||
import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.module.IMogoBizActionDoneListener;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.ThreadPoolService;
|
||||
@@ -147,7 +147,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(MogoSnapshotSetData mogoSnapshotSetData) {
|
||||
public void onMsgReceived(SocketDownData.LauncherSnapshotProto mogoSnapshotSetData) {
|
||||
DebugConfig.setStatus(DebugConfig.sDownloadSnapshot, true);
|
||||
Message msg = mSnapshotHandler.obtainMessage();
|
||||
msg.obj = mogoSnapshotSetData;
|
||||
@@ -207,8 +207,8 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
if (msg.obj instanceof MogoSnapshotSetData) {
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(((MogoSnapshotSetData) msg.obj));
|
||||
if (msg.obj instanceof SocketDownData.LauncherSnapshotProto) {
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(((SocketDownData.LauncherSnapshotProto) msg.obj));
|
||||
} else if (msg.obj == null) {
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(null);
|
||||
}
|
||||
|
||||
@@ -1,29 +1,16 @@
|
||||
package com.mogo.module.service.spi;
|
||||
|
||||
import com.elegant.spi.annotations.Service;
|
||||
import com.mogo.module.common.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
|
||||
import com.mogo.realtime.api.IRealTimeProvider;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
import com.mogo.realtime.entity.SocketReceiveDataProto3;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service(value = IRealTimeProvider.class)
|
||||
public class SPIRealTimeUpload implements IRealTimeProvider {
|
||||
|
||||
@Override
|
||||
public List<ADASRecognizedResult> getLastADASRecognizedResult() {
|
||||
return MarkerServiceHandler.getADASController().getLastADASRecognizedResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CloudLocationInfo> getLocationMsg() {
|
||||
return SnapshotLocationController.getInstance().getSendLocationData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLocationAccuracy() {
|
||||
return SnapshotLocationController.getInstance().getDataAccuracy();
|
||||
public SocketReceiveDataProto3.SocketReceiveDataProto getLocationMsg() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,12 @@ import android.graphics.Color;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
@@ -69,16 +71,17 @@ public class EnvStatusManager {
|
||||
|
||||
private void renderStatus() {
|
||||
String[] sStatusName = {
|
||||
"定位",
|
||||
"近景",
|
||||
"下发",
|
||||
"AUTO",
|
||||
"长链",
|
||||
"工控机定位",
|
||||
"ADAS近景感知",
|
||||
"云端远景感知",
|
||||
"自动驾驶状态",
|
||||
"socket长链",
|
||||
"经度",
|
||||
"纬度",
|
||||
"网络状态",
|
||||
"App版本",
|
||||
"Map版本"
|
||||
"Map版本",
|
||||
"SN"
|
||||
};
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (int i = 0; i < sStatusName.length; i++) {
|
||||
@@ -92,7 +95,12 @@ public class EnvStatusManager {
|
||||
} else if (i == 8) {
|
||||
stringBuilder.append(getVersionName(mContext, "com.mogo.launcher.f")).append("\n");
|
||||
} else if (i == 9) {
|
||||
stringBuilder.append(AppUtils.getCustomMapSDKVersion(mContext)).append("\n");
|
||||
String mapVersion = AppUtils.getCustomMapSDKVersion(mContext);
|
||||
if (!TextUtils.isEmpty(mapVersion)) {
|
||||
stringBuilder.append(mapVersion).append("\n");
|
||||
}
|
||||
} else if(i == 10){
|
||||
stringBuilder.append(MoGoAiCloudClientConfig.getInstance().getSn()).append("\n");
|
||||
} else {
|
||||
stringBuilder.append("true".equals(DebugConfig.getStatus(i, true)) ? "正常" : "异常").append("\n");
|
||||
}
|
||||
@@ -108,10 +116,6 @@ public class EnvStatusManager {
|
||||
mStatusTv.setTextColor(Color.WHITE);
|
||||
}
|
||||
}
|
||||
|
||||
//添加网络状态
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
private Context mContext;
|
||||
|
||||
@@ -4,22 +4,23 @@ import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.commons.data.BaseData;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.network.TimeDelayApiService;
|
||||
import com.mogo.module.service.network.bean.MockSocketReceiverData;
|
||||
import com.mogo.module.service.network.bean.MockSocketSendData;
|
||||
import com.mogo.realtime.api.MoGoAiCloudRealTime;
|
||||
import com.mogo.realtime.entity.CloudRoadData;
|
||||
import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -53,6 +54,7 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
|
||||
private long mRecordSatelliteTime; //todo 后续多点模拟用
|
||||
|
||||
private TimeDelayApiService timeDelayApiService;
|
||||
private IMogoADASController adasControllerApi;
|
||||
|
||||
private TimeDelayUploadManager() {
|
||||
|
||||
@@ -69,11 +71,16 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
|
||||
return timeDelayUploadManager;
|
||||
}
|
||||
|
||||
public boolean isMock() {
|
||||
return isMockData;
|
||||
}
|
||||
|
||||
public void init(Context mContext) {
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getSocketManagerApi(mContext).registerOnMessageListener(MSG_SOCKET_TYPE, this);
|
||||
MoGoAiCloudRealTime.registerOnMsgListener(this);
|
||||
adasControllerApi = MogoApisHandler.getInstance().getApis().getAdasControllerApi();
|
||||
}
|
||||
|
||||
private final Handler mockHandler = new Handler(WorkThreadHandler.newInstance("mock-algorithm-work-thread").getLooper()) {
|
||||
@@ -93,7 +100,7 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
|
||||
e.printStackTrace();
|
||||
}
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map(jo);
|
||||
SnapshotLocationController.getInstance().syncAdasLocationInfo(jo);
|
||||
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo(jo);
|
||||
mockHandler.sendEmptyMessageDelayed(MOCK_MSG, 50);
|
||||
}
|
||||
}
|
||||
@@ -137,10 +144,11 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
|
||||
//接收实时数据监听回调,用于给服务端上报时延
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
@Override
|
||||
public void onMsgReceived(MogoSnapshotSetData mogoSnapshotSetData) {
|
||||
public void onMsgReceived(SocketDownData.LauncherSnapshotProto mogoSnapshotSetData) {
|
||||
if (isMockData) {
|
||||
Logger.d(TAG,"收到下发数据 mogoSnapshotSetData : " + mogoSnapshotSetData.toString());
|
||||
//接口数据上报
|
||||
CloudRoadData result = mogoSnapshotSetData.getAllList()
|
||||
SocketDownData.CloudRoadDataProto result = mogoSnapshotSetData.getAllListList()
|
||||
.stream()
|
||||
.filter(cloudRoadData -> cloudRoadData.getUuid().contains("serialNumber_"))
|
||||
.findAny()
|
||||
@@ -149,12 +157,19 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
|
||||
Logger.d(TAG, "未找到与之匹配数据");
|
||||
return;
|
||||
}
|
||||
MockSocketSendData mockSocketSendData = new MockSocketSendData(System.currentTimeMillis(), result.getUuid(), result.getSatelliteTime());
|
||||
Logger.d(TAG,"找到匹配数据 result : " + result.toString());
|
||||
long satelliteTime;
|
||||
if (TextUtils.isEmpty(adasControllerApi.getSatelliteTime())) {
|
||||
satelliteTime = System.currentTimeMillis();
|
||||
} else {
|
||||
satelliteTime = Long.parseLong(adasControllerApi.getSatelliteTime());
|
||||
}
|
||||
MockSocketSendData mockSocketSendData = new MockSocketSendData(satelliteTime, result.getUuid(), result.getSatelliteTime());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sn", Utils.getSn());
|
||||
map.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
map.put("data", GsonUtil.jsonFromObject(mockSocketSendData));
|
||||
Logger.d(TAG, "mockSocketSendData : " + GsonUtil.jsonFromObject(mockSocketSendData));
|
||||
Logger.d(TAG, "data uuid : " + result.getUuid() + " duration : " + (System.currentTimeMillis() - result.getSatelliteTime()));
|
||||
Logger.d(TAG, "data uuid : " + result.getUuid() + " duration : " + (satelliteTime - result.getSatelliteTime()));
|
||||
timeDelayApiService.uploadDelayData(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@@ -171,4 +186,5 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.module.service.utils;
|
||||
import android.location.Location;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
import com.mogo.service.locationinfo.CloudLocationInfo;
|
||||
|
||||
/**
|
||||
* 定位数据类型转换工具
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.os.SystemClock;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
import com.mogo.service.locationinfo.CloudLocationInfo;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
Reference in New Issue
Block a user