[dev_arch_opt_3.0]

[Change]
[
1、完成工控机数据和高德GPS地图数据的数据中心,以及工控机数据超时后的自动切换为高德地图GPS数据
定位监听已重构,CallerChassisLocationGCJ20ListenerManager---高的坐标系,CallerChassisLocationWGS84ListenerManager--高精坐标系,之前代码已修改,大家后续项目中根据需要进行订阅,如需控制频率可在订阅时
// 设置数据回调频率,单位HZ,1HZ的周期是1秒;50HZ的周期是1/50=0.02秒;10HZ的周期是1/10=0.1秒。
CallerChassisLocationWGS84ListenerManager.setListenerHz(Companion.functionName, 20)
CallerChassisLocationGCJ20ListenerManagersetListenerHz(Companion.functionName, 20)
]

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2023-02-02 19:24:38 +08:00
parent 0a4b0be72a
commit 111940123f
107 changed files with 963 additions and 724 deletions

View File

@@ -1,6 +1,6 @@
package com.mogo.och.bus.passenger.callback;
import mogo.telematics.pad.MessagePad;
import com.mogo.eagle.core.data.map.MogoLocation;
/**
* Created on 2022/3/31
@@ -11,5 +11,5 @@ public interface IBusPassengerControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MessagePad.GnssInfo location);
void onCarLocationChanged(MogoLocation location);
}

View File

@@ -89,7 +89,7 @@ public class BusPassengerModel {
private IBusPassegerDriverStatusCallback mDriverStatusCallback; //出车收车状态
private IBusPassengerRouteLineInfoCallback mRouteLineInfoCallback; // bus路线信息更新
private MessagePad.GnssInfo mLocation = null;
private MogoLocation mLocation = null;
private BusPassengerRoutesResult routesResult = null;
@@ -321,7 +321,7 @@ public class BusPassengerModel {
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (null == gnssInfo) return;
mLocation = gnssInfo;
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){

View File

@@ -1,6 +1,7 @@
package com.mogo.och.bus.passenger.presenter;
import android.location.Location;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import android.os.Looper;
import androidx.annotation.NonNull;
@@ -24,10 +25,6 @@ import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment;
import java.util.List;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import mogo.telematics.pad.MessagePad;
/**
* Created on 2022/3/31
*/
@@ -112,7 +109,7 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
}
@Override
public void onCarLocationChanged(MessagePad.GnssInfo location) {
public void onCarLocationChanged(MogoLocation location) {
if (location != null){
runOnUIThread(() -> mView.onCarLocationChanged(location));
}

View File

@@ -27,6 +27,7 @@ import com.amap.api.maps.model.Marker;
import com.amap.api.maps.model.MarkerOptions;
import com.amap.api.maps.model.Polyline;
import com.amap.api.maps.model.PolylineOptions;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
@@ -37,8 +38,6 @@ import com.mogo.och.bus.passenger.utils.BusPassengerMapAssetStyleUtil;
import java.util.ArrayList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
/**
* 乘客屏小地图
*/
@@ -175,7 +174,7 @@ public class BusPassengerMapDirectionView
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (gnssInfo == null) {
return;
}

View File

@@ -16,7 +16,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.amap.api.maps.model.LatLng;
import com.elegant.utils.UiThreadHandler;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.och.bus.passenger.R;
@@ -32,8 +32,6 @@ import com.mogo.och.common.module.wigets.MarqueeTextView;
import java.util.ArrayList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
/**
* @author: wangmingjun
* @date: 2022/4/12
@@ -299,8 +297,8 @@ public class BusPassengerRouteFragment extends
lastBearing = bearing;
}
public void onCarLocationChanged(MessagePad.GnssInfo location) {
updateSpeedView((float) location.getVehicleSpeed());
public void onCarLocationChanged(MogoLocation location) {
updateSpeedView((float) location.getGnssSpeed());
}
public void updateSpeedView(float speed){

View File

@@ -2,8 +2,6 @@ package com.mogo.och.bus.callback;
import com.mogo.eagle.core.data.map.MogoLocation;
import mogo.telematics.pad.MessagePad;
/**
* Created on 2021/9/10
*
@@ -13,7 +11,7 @@ public interface IBusControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MessagePad.GnssInfo location);
void onCarLocationChanged(MogoLocation location);
//开始开启自动驾驶
void startOpenAutopilot();
}

View File

@@ -24,10 +24,11 @@ import com.mogo.commons.module.status.StatusDescriptor;
import com.mogo.eagle.core.data.BaseData;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
@@ -377,7 +378,7 @@ public class BusOrderModel {
// 自车定位
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (null == gnssInfo) return;
mLongitude = gnssInfo.getLongitude();
mLatitude = gnssInfo.getLatitude();
@@ -393,7 +394,7 @@ public class BusOrderModel {
};
//根据围栏判断,是否到达站点
private void judgeArrivedStation(MessagePad.GnssInfo location) {
private void judgeArrivedStation(MogoLocation location) {
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
CallerLogger.INSTANCE.e(M_BUS + TAG, "到站数组越界");
@@ -634,7 +635,7 @@ public class BusOrderModel {
return;
}
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
+ " startLatLon=" + parameters.startName + "endLatLon=" + parameters.endName +
@@ -778,8 +779,8 @@ public class BusOrderModel {
public void closeBeautificationMode() {
if (FunctionBuildConfig.isDemoMode) {//收车结束美化
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false; //是否强制绘制引导线
CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false);// 同步给乘客屏
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);//是否自动启动自驾
CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(false);// 同步给乘客屏
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);//是否自动启动自驾
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore置为false");
}
}
@@ -861,7 +862,7 @@ public class BusOrderModel {
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore置为true每次滑动出发");
} else if (backgroundCurrentStationIndex > 0 && backgroundCurrentStationIndex < stationList.size() - 1) {
//美化模式下 中间站点到站 引导线要一直绘制所以此处不出强制绘制不传false
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignorefalse到达中间站");
clearStartAutopilotTag();
} else {
@@ -952,8 +953,8 @@ public class BusOrderModel {
private void startBeautificationMode() {
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(true);
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true);
CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(true);
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true);
}
public void clearBusStationDatas() {
@@ -992,7 +993,7 @@ public class BusOrderModel {
return;
}
CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束====");
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
endTask();
}

View File

@@ -233,9 +233,9 @@ public class BusPresenter extends Presenter<BusFragment>
}
@Override
public void onCarLocationChanged(MessagePad.GnssInfo location) {
public void onCarLocationChanged(MogoLocation location) {
if (null != location) {
runOnUIThread(() -> mView.updateSpeedView((float) location.getVehicleSpeed()));
runOnUIThread(() -> mView.updateSpeedView((float) location.getGnssSpeed()));
}
}

View File

@@ -1,6 +1,6 @@
package com.mogo.och.bus.util
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
@@ -31,6 +31,6 @@ object BusSendTripInfoManager{
d(SceneConstant.M_BUS + "BusSendTripInfoManager", "type: "+ type
+", lineName: "+ lineName +", departureStopName: "+ departureStopName
+ ", arrivalStopName: "+arrivalStopName+", isLastStop: "+isLastStop)
CallerAutoPilotManager.sendTripInfo(type,lineName,departureStopName, arrivalStopName, isLastStop)
CallerAutoPilotControlManager.sendTripInfo(type,lineName,departureStopName, arrivalStopName, isLastStop)
}
}

View File

@@ -3,7 +3,7 @@ package com.mogo.och.bus.util;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.GsonUtils;
import com.mogo.och.bus.bean.BusRoutesResult;
@@ -198,7 +198,7 @@ public class BusTrajectoryManager {
// mAutoPilotLine.setTimestamp(1654761600000L); //20220609 16:00
// mAutoPilotLine.setVehicleModel("红旗H9");
CallerAutoPilotManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
CallerLogger.INSTANCE.d(M_BUS + TAG, "sendTrajectoryReq(): "
+ GsonUtils.toJson(mAutoPilotLine));
}

View File

@@ -3,6 +3,7 @@ package com.mogo.och.common.module.biz.model
import android.annotation.SuppressLint
import android.content.Context
import com.mogo.eagle.core.data.BaseData
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.utilcode.util.NetworkUtils
@@ -17,7 +18,6 @@ import com.mogo.och.common.module.biz.constant.TaxiLoginStatusEnum
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonServiceManager
import com.mogo.och.common.module.utils.ToastUtilsOch
import mogo.telematics.pad.MessagePad
/**
* Created by pangfan on 2021/8/19
@@ -46,7 +46,7 @@ object OchCommonLoginModel : IMoGoChassisLocationGCJ02Listener {
return true
}
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
gnssInfo?.let {
mLongitude = it.longitude
mLatitude = it.latitude

View File

@@ -192,7 +192,7 @@ public class CoordinateCalculateRouteUtil {
for (MessagePad.Location m : models) {
LatLng mogoLatLng = coordinateConverterWgsToGcj(mContext, m);
MogoLocation location = new MogoLocation();
location.setBearing((float) m.getHeading());
location.setHeading((float) m.getHeading());
location.setLatitude(mogoLatLng.latitude);
location.setLongitude(mogoLatLng.longitude);
list.add(location);
@@ -231,7 +231,7 @@ public class CoordinateCalculateRouteUtil {
*/
public static Map<Integer,List<MogoLocation>> getRemainPointListByCompareNew(int preIndex,
List<MogoLocation> mRoutePoints,
MessagePad.GnssInfo realLocation) {
MogoLocation realLocation) {
Map<Integer,List<MogoLocation>> routePonits = new HashMap<>();
List<MogoLocation> latePoints = new ArrayList<>(); // 剩余轨迹集合
int currentIndex = 0; //记录疑似点
@@ -245,8 +245,8 @@ public class CoordinateCalculateRouteUtil {
for (int i= 0; i < mRoutePoints.size(); i++){
MogoLocation latLng = mRoutePoints.get(i);
//todo 先看index对应点的方向和realLocation方向是否一致 方向角度不能过90度
if (realLocation.getHeading() == realLocation.getHeading() - latLng.getBearing() ||
Math.abs(realLocation.getHeading() - latLng.getBearing()) <= 90){
if (realLocation.getHeading() == realLocation.getHeading() - latLng.getHeading() ||
Math.abs(realLocation.getHeading() - latLng.getHeading()) <= 90){
float diff = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(),
realLocation.getLatitude(),
latLng.getLongitude(),latLng.getLatitude());
@@ -276,7 +276,7 @@ public class CoordinateCalculateRouteUtil {
}
public static int getArrivedPointIndexNew(int preIndex, List<MogoLocation> mRoutePoints,
MessagePad.GnssInfo realLocation) {
MogoLocation realLocation) {
int currentIndex = 0; //记录疑似点 //基础点
MogoLocation baseLatLng = mRoutePoints.get(0);
float baseDiffDis = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(),
@@ -285,8 +285,8 @@ public class CoordinateCalculateRouteUtil {
for (int i = 0; i < mRoutePoints.size(); i++) {
MogoLocation latLng = mRoutePoints.get(i);
if (realLocation.getHeading() == realLocation.getHeading() - latLng.getBearing() ||
Math.abs(realLocation.getHeading() - latLng.getBearing()) <= 90){
if (realLocation.getHeading() == realLocation.getHeading() - latLng.getHeading() ||
Math.abs(realLocation.getHeading() - latLng.getHeading()) <= 90){
float diff = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(),
realLocation.getLatitude(),
latLng.getLongitude(), latLng.getLatitude());

View File

@@ -1,6 +1,6 @@
package com.mogo.och.sweeper.callback;
import mogo.telematics.pad.MessagePad;
import com.mogo.eagle.core.data.map.MogoLocation;
/**
* Created on 2021/9/10
@@ -11,7 +11,7 @@ public interface ISweeperControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MessagePad.GnssInfo location);
void onCarLocationChanged(MogoLocation location);
//开始开启自动驾驶
void startOpenAutopilot();
}

View File

@@ -19,9 +19,10 @@ import com.mogo.commons.voice.AIAssist;
import com.mogo.eagle.core.data.BaseData;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
@@ -273,7 +274,7 @@ public class SweeperOrderModel {
// 自车定位
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (null == gnssInfo) return;
mLongitude = gnssInfo.getLongitude();
mLatitude = gnssInfo.getLatitude();
@@ -289,7 +290,7 @@ public class SweeperOrderModel {
};
//根据围栏判断,是否到达起点
private void judgeStartStation(MessagePad.GnssInfo location) {
private void judgeStartStation(MogoLocation location) {
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
return;
@@ -390,7 +391,7 @@ public class SweeperOrderModel {
CallerLogger.INSTANCE.d(M_BUS + TAG, "单程真的结束了====");
isGoingToNextStation = false;
backgroundCurrentStationIndex = 0;
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
querySweeperRoutes();
}
}
@@ -467,7 +468,7 @@ public class SweeperOrderModel {
// CallerLogger.INSTANCE.d( M_BUS + TAG, "开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
// +" startLatLon="+currentStation.getName()+"endLatLon="+nextStation.getName());
CallerLogger.INSTANCE.d(M_BUS + TAG, "开启自动驾驶====" + GsonUtil.jsonFromObject(parameters));
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
if (mControllerStatusCallback != null) {
mControllerStatusCallback.startOpenAutopilot();
@@ -553,7 +554,7 @@ public class SweeperOrderModel {
private void closeBeautificationMode() {
if (FunctionBuildConfig.isDemoMode) {//收车结束美化
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore置为false收车");
}
}
@@ -676,7 +677,7 @@ public class SweeperOrderModel {
&& backgroundCurrentStationIndex <= stationList.size() - 1)
&& stationList.get(backgroundCurrentStationIndex).isLeaving()) {//行驶过程中设置美化
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true);
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true);
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore置为true每次滑动出发");
}
@@ -794,7 +795,7 @@ public class SweeperOrderModel {
return;
}
CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束====");
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
AIAssist.getInstance(mContext).speakTTSVoice("感谢您体验'蘑菇车联'无人驾驶小巴车,请您携带好随身物品,我们下次再见");
leaveStation(true, true);
}
@@ -819,7 +820,7 @@ public class SweeperOrderModel {
if (FunctionBuildConfig.isDemoMode && backgroundCurrentStationIndex <= stationList.size() - 1) {//到达一站结束美化
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore置为false到最后一站");
}
CallerLogger.INSTANCE.d(M_BUS + TAG, "到站====currentStationIndex=" + backgroundCurrentStationIndex);

View File

@@ -11,6 +11,7 @@ import androidx.lifecycle.LifecycleOwner;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
@@ -237,9 +238,9 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
}
@Override
public void onCarLocationChanged(MessagePad.GnssInfo location) {
public void onCarLocationChanged(MogoLocation location) {
if (null != location) {
runOnUIThread(() -> mView.updateSpeedView((float) location.getVehicleSpeed()));
runOnUIThread(() -> mView.updateSpeedView((float) location.getGnssSpeed()));
}
}

View File

@@ -27,7 +27,7 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCleanSystemListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerSweeperFutianCleanSystemListenerManager;
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
@@ -39,7 +39,6 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import chassis.Chassis;
import chassis.ChassisStatesOuterClass;
import chassis.SpecialVehicleTaskCmdOuterClass;
@@ -942,7 +941,7 @@ public class SweeperOperatePanelView extends LinearLayout {
// onSendCmd
mCurrentCmdRequestCallback.onSendCmd();
// 发送命令
CallerAutoPilotManager.INSTANCE.sendSweeperFuTianTaskCmd(fuTianCleanCmd);
CallerAutoPilotControlManager.INSTANCE.sendSweeperFuTianTaskCmd(fuTianCleanCmd);
// log发送命令
logSweeperCmdValue(fuTianCleanCmd);
// 开启倒计时

View File

@@ -3,7 +3,7 @@ package com.mogo.och.sweeper.util;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.GsonUtils;
import com.mogo.och.sweeper.bean.SweeperRoutesResult;
@@ -197,7 +197,7 @@ public class SweeperTrajectoryManager {
// mAutoPilotLine.setTimestamp(1654761600000L); //20220609 16:00
// mAutoPilotLine.setVehicleModel("红旗H9");
CallerAutoPilotManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
CallerLogger.INSTANCE.d(M_BUS + TAG, "sendTrajectoryReq(): "
+ GsonUtils.toJson(mAutoPilotLine));
}

View File

@@ -1,6 +1,6 @@
package com.mogo.och.taxi.passenger.callback;
import mogo.telematics.pad.MessagePad;
import com.mogo.eagle.core.data.map.MogoLocation;
/**
* Created on 2021/9/10
@@ -11,5 +11,5 @@ public interface IOCHTaxiPassengerControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MessagePad.GnssInfo location);
void onCarLocationChanged(MogoLocation location);
}

View File

@@ -32,7 +32,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener;
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
@@ -128,7 +128,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
private int delayTime = 2;
private double mLongitude, mLatitude;
private MessagePad.GnssInfo mLocation = null;
private MogoLocation mLocation = null;
private List<MogoLocation> mLocationsModels = new ArrayList<>();
@@ -436,7 +436,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
}
// TODO: 2021/9/12
public void calculateTravelDistance(MessagePad.GnssInfo carLocation){
public void calculateTravelDistance(MogoLocation carLocation){
if (checkCurrentOCHOrder() && mCurrentOCHOrder.endSiteGcjPoint.size()>0) {
double endLon = mCurrentOCHOrder.endSiteGcjPoint.get(0);
double endLat = mCurrentOCHOrder.endSiteGcjPoint.get(1);
@@ -477,7 +477,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
// 自车定位
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
//位置变化时通过围栏判断是否到达x点
if (null == gnssInfo) return;
if (checkCurrentOCHOrder()) {
@@ -973,7 +973,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
return;
}
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "start autopilot with parameter: %s"
, GsonUtil.jsonFromObject(parameters)
+ " ,startSiteName=" + mCurrentOCHOrder.startSiteAddr

View File

@@ -122,7 +122,7 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
}
@Override
public void onCarLocationChanged(MessagePad.GnssInfo location) {
public void onCarLocationChanged(MogoLocation location) {
// 速度不用展示
// LeftMenuOpen.INSTANCE.callCallBack(-1,-1,location.getSpeed());
}

View File

@@ -11,6 +11,7 @@ import androidx.lifecycle.LifecycleOwner;
import com.amap.api.maps.model.LatLng;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.network.utils.GsonUtil;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -139,7 +140,7 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
private static final long TIMEINTERVAL = 4000;
@Override
public void onCarLocationChanged(MessagePad.GnssInfo location) {
public void onCarLocationChanged(MogoLocation location) {
if (location != null){
runOnUIThread(() -> mView.onCarLocationChanged(location));
long currentTimeMillis = System.currentTimeMillis();

View File

@@ -29,6 +29,7 @@ import com.amap.api.maps.model.MarkerOptions;
import com.amap.api.maps.model.Polyline;
import com.amap.api.maps.model.PolylineOptions;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
@@ -39,8 +40,6 @@ import com.mogo.och.taxi.passenger.utils.TaxiPassengerMapAssetStyleUtil;
import java.util.ArrayList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
/**
* 乘客屏小地图
*/
@@ -180,7 +179,7 @@ public class TaxiPassengerMapDirectionView
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (gnssInfo == null){
return;
}

View File

@@ -21,6 +21,7 @@ import androidx.fragment.app.FragmentTransaction;
import com.amap.api.maps.model.LatLng;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -42,8 +43,6 @@ import com.mogo.och.taxi.passenger.utils.TPRouteDataTestUtils;
import java.util.Calendar;
import java.util.List;
import mogo.telematics.pad.MessagePad;
/**
* @author: wangmingjun
* @date: 2022/3/8
@@ -352,8 +351,8 @@ public class TaxiPassengerServingOrderFragment extends
}
public void onCarLocationChanged(MessagePad.GnssInfo location) {
updateSpeedView((float) location.getVehicleSpeed());
public void onCarLocationChanged(MogoLocation location) {
updateSpeedView((float) location.getGnssSpeed());
}
public void onLimitingVelocityChange(int limitingVelocity) {

View File

@@ -1,6 +1,6 @@
package com.mogo.och.taxi.callback;
import mogo.telematics.pad.MessagePad;
import com.mogo.eagle.core.data.map.MogoLocation;
/**
* Created on 2021/9/10
@@ -11,7 +11,7 @@ public interface ITaxiControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MessagePad.GnssInfo location);
void onCarLocationChanged(MogoLocation location);
//开始开启自动驾驶
void startOpenAutopilot();
}

View File

@@ -30,7 +30,7 @@ import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
@@ -133,7 +133,7 @@ public class TaxiModel {
private int mPreRouteIndex = 0;
private double mLongitude, mLatitude;
private MessagePad.GnssInfo mLocation = null;
private MogoLocation mLocation = null;
private LoginService loginService;
@@ -823,8 +823,8 @@ public class TaxiModel {
if (FunctionBuildConfig.isDemoMode) {
// 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后置true
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(true);
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true);
CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(true);
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true);
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore置为true更新本地order信息");
}
@@ -833,7 +833,7 @@ public class TaxiModel {
if (mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.ArriveAtEnd.getCode()){
if (FunctionBuildConfig.isDemoMode) {
CallerLogger.INSTANCE.d(M_TAXI + TAG, "setIPCDemoModefalse");
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
}
clearAutopilotControlParameters();
@@ -870,8 +870,8 @@ public class TaxiModel {
if (FunctionBuildConfig.isDemoMode) {
// 当美化模式(演示模式)开启时: 取消或订单已完成时置false
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false);
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(false);
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore置为false已完成or清除当前订单");
}
}
@@ -934,7 +934,7 @@ public class TaxiModel {
return;
}
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
CallerLogger.INSTANCE.d(M_TAXI + TAG, "start autopilot with parameter: %s",
GsonUtil.jsonFromObject(parameters)
+ " ,startSiteName=" + mCurrentOCHOrder.startSiteAddr
@@ -987,7 +987,7 @@ public class TaxiModel {
//结束自动驾驶
public void cancelAutopilot() {
try {
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
CallerLogger.INSTANCE.d(M_TAXI + TAG, "结束自动驾驶");
} catch (Exception e) {
e.printStackTrace();
@@ -995,7 +995,7 @@ public class TaxiModel {
}
//根据围栏判断,是否到达起点
private void judgeStartStation(MessagePad.GnssInfo location) {
private void judgeStartStation(MogoLocation location) {
if (mCurrentOCHOrder == null || mCurrentOCHOrder.startSiteGcjPoint == null
|| mCurrentOCHOrder.startSiteGcjPoint.size() < 2) {
return;
@@ -1054,7 +1054,7 @@ public class TaxiModel {
// 自车定位
private final IMoGoChassisLocationGCJ02Listener mMapLocationLIstener = new IMoGoChassisLocationGCJ02Listener() {
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
//位置变化时通过围栏判断是否到达x点
if (null == gnssInfo) return;
if (checkCurrentOCHOrder()) {
@@ -1076,7 +1076,7 @@ public class TaxiModel {
}
};
private void judgeEndStation(MessagePad.GnssInfo location) {
private void judgeEndStation(MogoLocation location) {
if (mCurrentOCHOrder == null || mCurrentOCHOrder.endSiteGcjPoint == null
|| mCurrentOCHOrder.endSiteGcjPoint.size() < 2) {
return;
@@ -1172,8 +1172,8 @@ public class TaxiModel {
if (FunctionBuildConfig.isDemoMode) {
// 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后置true
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(true);
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true);
CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(true);
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true);
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore置为true到达出发点且已开启自动驾驶");
}
}
@@ -1243,7 +1243,7 @@ public class TaxiModel {
// 2022.10.08 到达目的地时候取消自动起自驾, 服务完成取消引导线和自动驾驶按钮状态
// FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
// CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false);
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore置为false到达目的地");
}
}

View File

@@ -11,6 +11,7 @@ import androidx.lifecycle.LifecycleOwner;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -314,10 +315,10 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
}
@Override
public void onCarLocationChanged(MessagePad.GnssInfo location) {
public void onCarLocationChanged(MogoLocation location) {
if (null != location){
runOnUIThread(() -> {
mView.updateSpeedView((float) location.getVehicleSpeed());
mView.updateSpeedView((float) location.getGnssSpeed());
mView.updateLocation(location.getLatitude(),location.getLongitude());
});
}

View File

@@ -29,6 +29,7 @@ import com.amap.api.maps.model.MarkerOptions;
import com.amap.api.maps.model.Polyline;
import com.amap.api.maps.model.PolylineOptions;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
@@ -38,8 +39,6 @@ import com.mogo.och.taxi.utils.TaxiMapAssetStyleUtil;
import java.util.ArrayList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
/**
* taxi司机端前往目的地小地图导航
*/
@@ -176,7 +175,7 @@ public class TaxiMapDirectionView
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (gnssInfo == null){
return;
}

View File

@@ -3,10 +3,9 @@ package com.mogo.och.taxi.utils;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.GsonUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.och.taxi.bean.OrderQueryRespBean;
import com.mogo.och.taxi.constant.TaxiConst;
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
@@ -201,7 +200,7 @@ public class TaxiTrajectoryManager {
// mAutoPilotLine.setTimestamp(1654761600000L); //20220609 16:00
// mAutoPilotLine.setVehicleModel("红旗H9");
CallerAutoPilotManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
CallerLogger.INSTANCE.d(M_TAXI + TAG, "sendTrajectoryReq(): "
+ GsonUtils.toJson(mAutoPilotLine));
}

View File

@@ -13,7 +13,7 @@ import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
@@ -130,7 +130,7 @@ class DispatchAutoPilotManager private constructor() :
AutopilotControlParameters.AutoPilotLonLat(it.endLat, it.endLon)
currentAutopilot.vehicleType = 10
CallerLogger.d(SceneConstant.Companion.M_DISPATCH + TAG, "开启自动驾驶====$currentAutopilot")
CallerAutoPilotManager.startAutoPilot(currentAutopilot)
CallerAutoPilotControlManager.startAutoPilot(currentAutopilot)
}
}

View File

@@ -6,6 +6,7 @@ import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP_G
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
@@ -26,7 +27,6 @@ import com.mogo.eagle.core.utilcode.util.LocationUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
import com.zhjt.service_biz.BizConfig
import mogo.telematics.pad.MessagePad
import kotlin.math.abs
import kotlin.math.ceil
import kotlin.math.floor
@@ -44,7 +44,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
// 是否已进入到路口(停止线处)
private var isEnter = false
private var mLocation: MessagePad.GnssInfo? = null
private var mLocation: MogoLocation? = null
companion object {
@@ -100,7 +100,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
// 路口100m闯红灯预警
mLocation?.let {
// 单位m/s
val speed = it.vehicleSpeed
val speed = it.gnssSpeed
// 车停止或者速度非常慢,可能返回负数或者很小的值,需要过滤
CallerLogger.d("$M_V2X$TAG", "speed is:$speed")
if (speed <= 2.5f) return// 小于等于9km/h不处理
@@ -277,7 +277,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
}
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
gnssInfo?.let {
mLocation = it
}

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.function.biz.v2x.trafficlight.core
import android.content.Context
import android.os.Handler
import android.os.Looper
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.trafficlight.*
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
@@ -15,7 +16,6 @@ import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandl
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_CROSS_ROAD
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
import com.mogo.eagle.function.biz.v2x.trafficlight.network.TrafficLightNetWorkModel
import mogo.telematics.pad.MessagePad
class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
@@ -30,7 +30,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
private var mContext: Context? = null
private val trafficLightNetWorkModel = TrafficLightNetWorkModel()
private var mLocation: MessagePad.GnssInfo? = null
private var mLocation: MogoLocation? = null
private var roadIDResult: RoadIDResult? = null
private var trafficLightResult: TrafficLightResult? = null
@@ -174,7 +174,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
trafficLightResult = null
}
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
gnssInfo?.let {
mLocation = it
checkOutOfRange()

View File

@@ -57,6 +57,7 @@ dependencies {
implementation rootProject.ext.dependencies.mogoaicloudtelematic
implementation rootProject.ext.dependencies.mogoobu
implementation rootProject.ext.dependencies.amapnavi3dmap
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogo_core_data

View File

@@ -4,6 +4,7 @@ import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.datacenter.IDataCenterProvider
import com.mogo.eagle.core.function.datacenter.location.MoGoLocationDispatcher
@Route(path = MogoServicePaths.PATH_DATA_CENTER_MODULE)
class DataCenterProvider: IDataCenterProvider {
@@ -12,7 +13,7 @@ class DataCenterProvider: IDataCenterProvider {
get() = "DataCenterProvider"
override fun init(context: Context?) {
MoGoLocationDispatcher.initListener()
}
override fun onDestroy() {

View File

@@ -21,7 +21,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LO
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.trafficlight.toTrafficLightDetail
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotControlProvider
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasListenerImpl
import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl
@@ -67,8 +67,9 @@ import java.util.concurrent.TimeUnit
* @date 2021/9/22 8:43 下午
*/
@Route(path = MogoServicePaths.PATH_AUTO_PILOT)
class MoGoAutopilotProvider :
IMoGoAutopilotProvider, IMoGoMapDataCollectProvider.OnMapCollectCmdListener,
class MoGoAutopilotControlProvider :
IMoGoAutopilotControlProvider,
IMoGoMapDataCollectProvider.OnMapCollectCmdListener,
IMoGoAutopilotCarConfigListener {
private val TAG = "MoGoAutoPilotProvider"
private var mContext: Context? = null

View File

@@ -45,8 +45,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListen
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordConfig
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager.invokeAutopilotStatistics
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager.invokeChassisLocationGCJ02
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager.invokePNCActions
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager.invokeAutopilotRotting
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager.invokeAutopilotTrajectory
@@ -135,10 +133,8 @@ class MoGoAdasListenerImpl : OnAdasListener {
clientPkFileName = "sn"
)
override fun onGnssInfo(header: MessagePad.Header, gnssInfo: MessagePad.GnssInfo) {
// WGS84坐标系高精度位置信息
invokeChassisLocationWGS84(gnssInfo)
// GCJ02高德坐标系位置信息
invokeChassisLocationGCJ02(gnssInfo)
CallerChassisGnssListenerManager.invokeChassisGnssListener(gnssInfo)
if (gnssInfo != null) {
if (1 == FunctionBuildConfig.gpsProvider) {
// 同步给MAP地图

View File

@@ -5,7 +5,7 @@ import com.mogo.commons.debug.DebugConfig.*
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -52,13 +52,13 @@ class MoGoAdasMsgConnectStatusListenerImpl :
// 同步SN给工控机
syncBasicInfoToAutopilot()
//每次工控机连接成功后,需同步当前设置的美化模式状态
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
//当连接状态是关闭美化模式时,同步给工控机
if (!FunctionBuildConfig.isDemoMode) {
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
}
//每次工控机连接成功后,需同步当前设置的雨天模式状态
CallerAutoPilotManager.setRainMode(FunctionBuildConfig.isRainMode)
CallerAutoPilotControlManager.setRainMode(FunctionBuildConfig.isRainMode)
} else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.DISCONNECTED) {
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 连接失败 reason:$reason")
if (connectStatus) {

View File

@@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.datacenter.autopilot.server
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
/**
@@ -26,6 +26,6 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen
}
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
CallerAutoPilotManager.sendTrafficLightData(trafficLightResult)
CallerAutoPilotControlManager.sendTrafficLightData(trafficLightResult)
}
}

View File

@@ -8,9 +8,9 @@ import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.setDemoMode
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.setIgnoreConditionDraw
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setDemoMode
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIgnoreConditionDraw
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.utilcode.mogo.logger.*
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
@@ -174,7 +174,7 @@ class TeleMsgHandler : IMsgHandler {
private fun queryCarConfig() {
invokeNettyConnResult("乘客屏请求司机屏向工控机查询配置信息")
CallerAutoPilotManager.getCarConfig()
CallerAutoPilotControlManager.getCarConfig()
}
override fun handleClientConn2Server(channel: Channel?) {

View File

@@ -1,16 +0,0 @@
package com.mogo.eagle.core.function.datacenter.location
import com.mogo.eagle.core.data.enums.DataSourceType
import mogo.telematics.pad.MessagePad
/**
* 位置回调监听
*/
interface IMoGoLocationListener {
/**
* 位置改变回调用
* @param gnssInfo 位置信息
* @param sourceType 数据来源
*/
fun onLocationChanged(gnssInfo: MessagePad.GnssInfo, sourceType: DataSourceType)
}

View File

@@ -0,0 +1,176 @@
package com.mogo.eagle.core.function.datacenter.location
import com.amap.api.location.AMapLocation
import com.amap.api.location.AMapLocationClient
import com.amap.api.location.AMapLocationClientOption
import com.amap.api.location.AMapLocationListener
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.constants.SharedPrefsConstants
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGnssListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.eagle.core.utilcode.util.Utils
import mogo.telematics.pad.MessagePad
/**
* 融合定位服务,这里同时监听多来源的位置信息,并支持修改频率
*
* @author donghongyu
*/
object MoGoLocationDispatcher :
IMoGoChassisGnssListener,
AMapLocationListener {
private val TAG = "MoGoLocationManager"
private var mCityCode: String? = null
private var mapLocation: AMapLocation? = null
/**
* 最后一次工控机GNSS返回更新的位置
*/
private var lastGnssLocation: MogoLocation = MogoLocation()
/**
* 最后一次高德定位返回的位置信息
*/
private var lastGaoDeLocation: MogoLocation = MogoLocation()
fun initListener() {
// 高德SDK隐私政策
AMapLocationClient.updatePrivacyShow(Utils.getApp(), true, true)
AMapLocationClient.updatePrivacyAgree(Utils.getApp(), true)
try {
val mLocationClient = AMapLocationClient(Utils.getApp())
//初始化定位参数
//声明mLocationOption对象
val mLocationOption = AMapLocationClientOption()
//设置定位监听
mLocationClient.setLocationListener(this)
//设置定位模式为高精度模式Battery_Saving为低功耗模式Device_Sensors是仅设备模式
mLocationOption.locationMode = AMapLocationClientOption.AMapLocationMode.Hight_Accuracy
//设置定位间隔,单位毫秒,默认为2000ms
mLocationOption.interval = 1000
//设置定位参数
mLocationClient.setLocationOption(mLocationOption)
// 启动定位监听
mLocationClient.startLocation()
} catch (e: Exception) {
e.printStackTrace()
}
// 初始化监听订阅工控机位置信息
CallerChassisGnssListenerManager.addListener(TAG, this)
}
override fun onChassisGnss(gnssInfo: MessagePad.GnssInfo) {
// 更新GNSS 信息
lastGnssLocation.gnssInfo = gnssInfo
lastGnssLocation.lastReceiveTime = TimeUtils.getNowMills()
// 将高德中的一些用于业务的数据进行融合例如CityCode、address等
mapLocation?.let {
lastGnssLocation.cityName = it.city
lastGnssLocation.cityCode = it.cityCode
lastGnssLocation.provider = it.provider
lastGnssLocation.address = it.address
lastGnssLocation.district = it.district
lastGnssLocation.province = it.province
lastGnssLocation.adCode = it.adCode
lastGnssLocation.locationDetail = it.locationDetail
lastGnssLocation.poiName = it.poiName
lastGnssLocation.aoiName = it.aoiName
lastGnssLocation.street = it.street
lastGnssLocation.streetNum = it.streetNum
lastGnssLocation.description = it.description
lastGnssLocation.buildingId = it.buildingId
lastGnssLocation.floor = it.floor
lastGnssLocation.errorCode = it.errorCode
lastGnssLocation.errorInfo = it.errorInfo
}
// WGS84坐标系高精度位置信息
CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84(
lastGnssLocation,
DataSourceType.TELEMATIC
)
// GCJ02高德坐标系位置信息
CallerChassisLocationGCJ20ListenerManager.invokeChassisLocationGCJ02(
lastGnssLocation,
DataSourceType.TELEMATIC
)
}
/**
* 高德地图位置改变回调
* @param aMapLocation 位置信息
*/
override fun onLocationChanged(aMapLocation: AMapLocation) {
mapLocation = aMapLocation
// 更新GNSS 信息
// 将高德中的一些用于业务的数据进行融合例如CityCode、address等
mapLocation?.let {
// 转换 GCJ02-->WGS84 坐标
val wgs84Location =
CoordinateTransform.GCJ02ToWGS84(it.longitude, it.latitude)
lastGaoDeLocation.longitude = wgs84Location[0]
lastGaoDeLocation.latitude = wgs84Location[1]
lastGaoDeLocation.heading = it.bearing.toDouble()
lastGaoDeLocation.gnssSpeed = it.speed
lastGaoDeLocation.altitude = it.altitude
lastGaoDeLocation.satelliteTime = it.time
lastGaoDeLocation.lastReceiveTime = TimeUtils.getNowMills()
lastGaoDeLocation.cityName = it.city
lastGaoDeLocation.cityCode = it.cityCode
lastGaoDeLocation.provider = it.provider
lastGaoDeLocation.address = it.address
lastGaoDeLocation.district = it.district
lastGaoDeLocation.province = it.province
lastGaoDeLocation.adCode = it.adCode
lastGaoDeLocation.locationDetail = it.locationDetail
lastGaoDeLocation.poiName = it.poiName
lastGaoDeLocation.aoiName = it.aoiName
lastGaoDeLocation.street = it.street
lastGaoDeLocation.streetNum = it.streetNum
lastGaoDeLocation.description = it.description
lastGaoDeLocation.buildingId = it.buildingId
lastGaoDeLocation.floor = it.floor
lastGaoDeLocation.errorCode = it.errorCode
lastGaoDeLocation.errorInfo = it.errorInfo
}
// 计算最后一次工控机同步的定位是否超时,如果超时则切换为高德地图定位,暂定超过30秒需要切换
if (TimeUtils.getNowMills() - lastGnssLocation.lastReceiveTime > 30000) {
// WGS84坐标系高精度位置信息
CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84(
lastGaoDeLocation,
DataSourceType.MAP
)
// GCJ02高德坐标系位置信息
CallerChassisLocationGCJ20ListenerManager.invokeChassisLocationGCJ02(
lastGaoDeLocation,
DataSourceType.MAP
)
}
// 本地SP缓存城市Code
val cityCode = aMapLocation.cityCode
if (cityCode != null && cityCode.isNotEmpty()) {
mCityCode = aMapLocation.cityCode
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode)
}
}
}

View File

@@ -1,71 +0,0 @@
package com.mogo.eagle.core.function.datacenter.location
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.api.obu.IMoGoObuLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.support.obu.model.MogoObuHvBasicsData
import mogo.telematics.pad.MessagePad
/**
* 融合定位服务,这里同时监听多来源的位置信息,并支持修改频率
*
* @author donghongyu
*/
object MoGoLocationManager :
CallerBase<IMoGoLocationListener>(),
IMoGoChassisLocationWGS84Listener,
IMoGoObuLocationWGS84Listener {
private val TAG = "MoGoLocationManager"
init {
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
M_LISTENERS.forEach {
val tag = it.key
// 获取数据监听需要的HZ
val hz = M_LISTENERS_HZ[tag]
if (hz != null && hz > 0) {
val hzTime = (1.0 / hz.toDouble()) * 1000
// 获取最后一次回调的时间
val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag]
if (hzLastSendTime != null && hzLastSendTime > 0) {
// 计算是否进入下一次回调周期
val nowTime = TimeUtils.getNowMills()
if (nowTime - hzLastSendTime > hzTime) {
syncLocationCallback(tag, it, gnssInfo, DataSourceType.TELEMATIC)
}
} else {
syncLocationCallback(tag, it, gnssInfo, DataSourceType.TELEMATIC)
}
} else {
syncLocationCallback(tag, it, gnssInfo, DataSourceType.TELEMATIC)
}
}
}
/**
* 向订阅位置信息的发出定位信息
*/
private fun syncLocationCallback(
tag: String,
it: Map.Entry<String, IMoGoLocationListener>,
gnssInfo: MessagePad.GnssInfo,
sourceType: DataSourceType
) {
// 记录最后一次回调时间
M_LISTENERS_HZ_LAST_SEND_TIME[tag] = TimeUtils.getNowMills()
val listener = it.value
listener.onLocationChanged(gnssInfo, sourceType)
}
override fun onObuLocationWGS84(data: MogoObuHvBasicsData) {
}
}

View File

@@ -3,8 +3,8 @@
##### 位置回调融合工控机、OBU、高德地图
```kotlin
// 注册监听位置变换
MoGoLocationManager.addListener(Companion.functionName, object : IMoGoLocationListener {
// 注册监听位置变换,唯一标记要接受数据的HZ回掉监听
MoGoLocationManager.addListener(Companion.functionName, 20, object : IMoGoLocationListener {
override fun onLocationChanged(
gnssInfo: MessagePad.GnssInfo,
sourceType: DataSourceType

View File

@@ -10,11 +10,12 @@ import android.widget.RadioButton
import android.widget.TextView
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
@@ -27,7 +28,6 @@ import com.zhjt.mogo_core_function_devatools.R
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad
import record_cache.RecordPanelOuterClass
import java.util.*
@@ -119,7 +119,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
// 添加 ADAS车辆状态&定位 监听
CallerChassisLocationWGS84ListenerManager.addListener(this.hashCode().toString(), this)
//开始录制AI数据采集Bag包
CallerAutoPilotManager.recordPackage(
CallerAutoPilotControlManager.recordPackage(
99,
Random(SystemClock.elapsedRealtime()).nextInt(),
20,
@@ -353,7 +353,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
fun closeWindow()
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
latitude = gnssInfo.latitude
longitude = gnssInfo.longitude
}

View File

@@ -11,7 +11,7 @@ import androidx.recyclerview.widget.GridLayoutManager
import com.mogo.eagle.core.data.badcase.RecordTypeEntity
import com.mogo.eagle.core.data.badcase.TopicEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
@@ -206,7 +206,7 @@ internal class BadCaseConfigView @JvmOverloads constructor(
super.onAttachedToWindow()
CallerAutopilotRecordListenerManager.addListener(TAG, this)
//获取数据采集录制模式配置列表
CallerAutoPilotManager.getBadCaseConfig(0, 0, listOf())
CallerAutoPilotControlManager.getBadCaseConfig(0, 0, listOf())
recordTypesList.add(RecordTypeEntity(0,"自定义", arrayListOf()))
}

View File

@@ -11,7 +11,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.data.badcase.RecordCaseEntity;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.zhjt.mogo_core_function_devatools.R;
@@ -77,7 +77,7 @@ public class CaseListDialog extends Dialog implements IMoGoAutopilotRecordListen
super.onAttachedToWindow();
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
//获取数据采集录制模式配置列表
CallerAutoPilotManager.INSTANCE.getBadCaseConfig(0, 0,new ArrayList<>());
CallerAutoPilotControlManager.INSTANCE.getBadCaseConfig(0, 0,new ArrayList<>());
}
@Override

View File

@@ -17,7 +17,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.data.badcase.RecordTypeEntity;
import com.mogo.eagle.core.data.badcase.TopicEntity;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
@@ -69,7 +69,7 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL
init();
initEvent();
//获取所有Topic
CallerAutoPilotManager.INSTANCE.getBadCaseConfig(1, 0, new ArrayList<>());
CallerAutoPilotControlManager.INSTANCE.getBadCaseConfig(1, 0, new ArrayList<>());
if (recordType != null) {
tvCaseName.setText(recordType.getDesc());
if (recordType.getTopicsList().size() > 0) {
@@ -160,7 +160,7 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL
});
tvSave.setOnClickListener(v -> {
if (recordType != null) {
Boolean success = CallerAutoPilotManager.INSTANCE.getBadCaseConfig(2, recordType.getId(), addTopicList);
Boolean success = CallerAutoPilotControlManager.INSTANCE.getBadCaseConfig(2, recordType.getId(), addTopicList);
if (Boolean.TRUE.equals(success)) {
ToastUtils.showShort("Topic设置成功");
if (recordType.getId() == 0) {

View File

@@ -14,11 +14,12 @@ import android.widget.TextView
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.badcase.RecordCaseEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
@@ -35,7 +36,6 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad
import record_cache.RecordPanelOuterClass
import java.io.File
import java.util.*
@@ -347,7 +347,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
mWindowManager!!.addView(mFloatLayout, mWindowParams)
//开启录包
if (recordCaseEntity != null) {
CallerAutoPilotManager.recordPackage(
CallerAutoPilotControlManager.recordPackage(
recordCaseEntity.caseId,
Random(SystemClock.elapsedRealtime()).nextInt(),
BadCaseConfig.totalDuration,
@@ -355,7 +355,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
recordCaseEntity.topicList
)
} else {
CallerAutoPilotManager.recordPackage(
CallerAutoPilotControlManager.recordPackage(
BadCaseConfig.type, Random(SystemClock.elapsedRealtime()).nextInt(),
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration
)
@@ -394,7 +394,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
fun closeWindow()
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
latitude = gnssInfo.latitude
longitude = gnssInfo.longitude
}

View File

@@ -15,6 +15,7 @@ import android.widget.TextView
import com.google.android.flexbox.FlexboxLayout
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
@@ -34,7 +35,6 @@ import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import me.jessyan.autosize.utils.AutoSizeUtils
import mogo.telematics.pad.MessagePad
import org.greenrobot.eventbus.EventBus
import java.io.File
@@ -380,9 +380,9 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
fun closeWindow()
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
latitude = gnssInfo?.latitude
longitude = gnssInfo?.longitude
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
latitude = gnssInfo.latitude
longitude = gnssInfo.longitude
}
}

View File

@@ -15,7 +15,7 @@ import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_FULL_LOG
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATION
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -220,7 +220,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
Logger.init(LogLevel.DEBUG)
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = true
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowNetDebugLog = true
CallerAutoPilotManager.setEnableLog(true)
CallerAutoPilotControlManager.setEnableLog(true)
}
/**
@@ -230,7 +230,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
Logger.init(if (DebugConfig.isDebug()) LogLevel.DEBUG else LogLevel.OFF)
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = false
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowNetDebugLog = false
CallerAutoPilotManager.setEnableLog(false)
CallerAutoPilotControlManager.setEnableLog(false)
}
override fun onError(errorCount: Int) {

View File

@@ -41,7 +41,7 @@ internal class CanImpl(ctx: Context) :
private val state: AtomicInteger by lazy { AtomicInteger(Int.MIN_VALUE) }
override fun onCreate() {
send(CanStatus(CallerAutoPilotManager.isConnected()))
send(CanStatus(CallerAutoPilotControlManager.isConnected()))
CallerChassisAccStateListenerManager.addListener(TAG, this)
CallerChassisBrakeStateListenerManager.addListener(TAG, this)
@@ -60,7 +60,7 @@ internal class CanImpl(ctx: Context) :
private fun isCanEnabled(): Boolean {
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
return CallerAutoPilotManager.isConnected() && code != "EHW_CAN" && (state.get() == Int.MIN_VALUE || state.get() == 0)
return CallerAutoPilotControlManager.isConnected() && code != "EHW_CAN" && (state.get() == Int.MIN_VALUE || state.get() == 0)
}

View File

@@ -28,7 +28,7 @@ internal class IpcImpl(ctx: Context): IFlow<IpcStatus>(ctx), IMoGoAutopilotStatu
}
private fun checkAndSend() {
send(IpcStatus(CallerAutoPilotManager.isConnected()))
send(IpcStatus(CallerAutoPilotControlManager.isConnected()))
}
override fun onDestroy() {

View File

@@ -2,9 +2,10 @@ package com.zhjt.mogo_core_function_devatools.status.flow.rtk
import android.content.Context
import android.util.Log
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -15,7 +16,6 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad.GnssInfo
import system_master.SystemStatusInfo.HealthInfo
import system_master.SystemStatusInfo.StatusInfo
import java.util.concurrent.atomic.AtomicBoolean
@@ -42,7 +42,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
CallerLogger.d("$M_DEVA$TAG", "-- onCreate --")
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
if (CallerAutoPilotManager.isConnected()) {
if (CallerAutoPilotControlManager.isConnected()) {
check()
}
}
@@ -53,7 +53,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
}
check?.takeIf { it.isActive }?.cancel()
launch(Dispatchers.Unconfined) {
CallerAutoPilotManager.sendStatusQueryReq()
CallerAutoPilotControlManager.sendStatusQueryReq()
delay(5000)
isOldVersion.set(true)
}.also {
@@ -74,18 +74,18 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
super.onAutopilotIpcConnectStatusChanged(status, reason)
if (!CallerAutoPilotManager.isConnected()) {
if (!CallerAutoPilotControlManager.isConnected()) {
CallerLogger.d("$M_DEVA$TAG", "工控机断开了....")
healthInfo.set(null)
send(RTKStatus("", -1))
}
if (CallerAutoPilotManager.isConnected() && check == null && !isOldVersion.get()) {
if (CallerAutoPilotControlManager.isConnected() && check == null && !isOldVersion.get()) {
check()
}
}
override fun onChassisLocationWGS84(gnssInfo: GnssInfo) {
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
if (isOldVersion.get()) {
if (isRTKEnabled()) {
send(RTKStatus("RTK", 0))
@@ -103,7 +103,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
private fun isRTKEnabled(): Boolean {
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
val gnssInfo = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
return CallerAutoPilotManager.isConnected() && (
return CallerAutoPilotControlManager.isConnected() && (
code != "EHW_RTK" &&
code != "EHW_GNSS" &&
code != "ESYS_RTK_STATUS_FAULT" &&

View File

@@ -40,7 +40,7 @@ internal class TracingImpl(ctx: Context): IFlow<TracingStatus>(ctx), IMoGoAutopi
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
super.onAutopilotIpcConnectStatusChanged(status, reason)
if (!CallerAutoPilotManager.isConnected()) {
if (!CallerAutoPilotControlManager.isConnected()) {
old = UNKNOWN
send(TracingStatus(UNKNOWN))
}

View File

@@ -19,7 +19,7 @@ internal class StatusModel : ViewModel() {
const val TAG = "StatusModel"
val DEFAULTS = Pair(null, ArrayList<Status>().also {
it += IpcStatus(CallerAutoPilotManager.isConnected())
it += IpcStatus(CallerAutoPilotControlManager.isConnected())
it += CanStatus(false)
it += TracingStatus(UNKNOWN)
it += RTKStatus("", -1)

View File

@@ -7,7 +7,7 @@ import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -51,7 +51,7 @@ object SyncConfig {
else -> {
}
}
AppConfigInfo.teleTimeStamp = CallerAutoPilotManager.getTeleTimeStamp()
AppConfigInfo.teleTimeStamp = CallerAutoPilotControlManager.getTeleTimeStamp()
logOutConfig(AppConfigInfo)
}

View File

@@ -31,9 +31,8 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
@@ -51,7 +50,6 @@ import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.came
import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
import com.mogo.eagle.core.function.main.DisplayEffectsHelper
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
@@ -216,7 +214,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
SharedPrefsMgr.getInstance(it)
.putLong("roadwork", System.currentTimeMillis() / 1000)
}
CallerAutoPilotManager.sendTripInfo(5, "", "", "", false)
CallerAutoPilotControlManager.sendTripInfo(5, "", "", "", false)
}
}

View File

@@ -12,7 +12,7 @@ import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
@@ -95,7 +95,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
var resultStr = "类型:"
for (result in reportEntity.resultList){
resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
resultStr = "${resultStr}${CallerAutoPilotControlManager.getReportResultDesc(result)}"
}
holder.tvBubbleReportType.text = resultStr
holder.clReportLayout.setOnClickListener {

View File

@@ -13,7 +13,7 @@ import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.hmi.R
@@ -133,7 +133,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
var resultStr = "类型:"
for (result in reportEntity.resultList) {
resultStr =
"${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
"${resultStr}${CallerAutoPilotControlManager.getReportResultDesc(result)}"
}
holder.tvReportTypeNormal.text = resultStr
holder.tvReportTypeOpen.text = resultStr
@@ -141,7 +141,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
var actionStr = ""
for (action in reportEntity.actionsList) {
actionStr =
"${actionStr}${CallerAutoPilotManager.getReportActionDesc(action)}"
"${actionStr}${CallerAutoPilotControlManager.getReportActionDesc(action)}"
}
holder.tvReportActionOpen.text = "建议操作:$actionStr"
holder.tvStatusSelect.setOnClickListener {

View File

@@ -19,7 +19,7 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo.NoticeTrafficAccountInfo
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.notice.NoticeValue
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.startAutoPilot
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager.bizProvider

View File

@@ -38,6 +38,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.scene.SceneModule
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.data.gnss.AccelerationEntity
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.autopilot.*
@@ -120,7 +121,7 @@ internal class DebugSettingView @JvmOverloads constructor(
private var logViewAttach = false
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
private var mGnssInfo: MessagePad.GnssInfo? = null
private var mGnssInfo: MogoLocation? = null
private var accelerationFloatWindow: AccelerationFloatWindow? = null
private var accelerationList = arrayListOf<AccelerationEntity>()
@@ -220,7 +221,7 @@ internal class DebugSettingView @JvmOverloads constructor(
Timer().schedule(timerTaskRefresh, Date(), 300)
if (AppConfigInfo.isConnectAutopilot && (AppConfigInfo.plateNumber.isNullOrEmpty() || AppConfigInfo.iPCMacAddress.isNullOrEmpty())) {
//查询工控机基础配置信息
CallerAutoPilotManager.getCarConfig()
CallerAutoPilotControlManager.getCarConfig()
}
}
@@ -594,10 +595,10 @@ internal class DebugSettingView @JvmOverloads constructor(
"demoMode",
DemoModeView(context)
)
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
if (!FunctionBuildConfig.isDemoMode) {
//关闭美化模式时,通知工控机
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
}
tbIsDrawAutopilotTrajectoryData.isEnabled = !FunctionBuildConfig.isDemoMode
if (!FunctionBuildConfig.isDemoMode) {
@@ -615,7 +616,7 @@ internal class DebugSettingView @JvmOverloads constructor(
tbIsRainMode.isChecked = FunctionBuildConfig.isRainMode
//雨天模式
tbIsRainMode.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotManager.setRainMode(isChecked)
CallerAutoPilotControlManager.setRainMode(isChecked)
FunctionBuildConfig.isRainMode = isChecked
}
//雨天模式按钮只在司机屏生效,乘客屏不显示
@@ -634,7 +635,7 @@ internal class DebugSettingView @JvmOverloads constructor(
//重启工控机所有节点
btnIpcReboot.onClick {
CallerAutoPilotManager.sendIpcReboot()
CallerAutoPilotControlManager.sendIpcReboot()
ToastUtils.showLong("重启命令已发送")
}
//只在司机端设置工控机节点重启功能
@@ -773,7 +774,7 @@ internal class DebugSettingView @JvmOverloads constructor(
// 模拟自动驾驶中
tbChangeAutoPilotStatus.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotManager.setControlAutopilotCarAuto(isChecked)
CallerAutoPilotControlManager.setControlAutopilotCarAuto(isChecked)
}
when {
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> {
@@ -794,7 +795,7 @@ internal class DebugSettingView @JvmOverloads constructor(
}
//初始化ADAS日志开关状态
tbADASLog.isChecked = CallerAutoPilotManager.isEnableLog()
tbADASLog.isChecked = CallerAutoPilotControlManager.isEnableLog()
//查看上报历史列表
tbReportMore.setOnCheckedChangeListener { _, isChecked ->
@@ -915,7 +916,7 @@ internal class DebugSettingView @JvmOverloads constructor(
btnConnectServerIp.setOnClickListener {
val ip = etConnectServerIp.text.toString()
if (!ip.isNullOrEmpty()) {
CallerAutoPilotManager.connectSpecifiedServer(ip)
CallerAutoPilotControlManager.connectSpecifiedServer(ip)
}
}
@@ -982,7 +983,7 @@ internal class DebugSettingView @JvmOverloads constructor(
btnSetAutopilotIP.setOnClickListener {
val autoPilotIp = etAutopilotIP.text.toString()
if (autoPilotIp.isNotEmpty()) {
CallerAutoPilotManager.resetIpAddress(autoPilotIp)
CallerAutoPilotControlManager.resetIpAddress(autoPilotIp)
} else {
ToastUtils.showShort("请输入正确的IP地址")
}
@@ -990,7 +991,7 @@ internal class DebugSettingView @JvmOverloads constructor(
//断开与工控机的连接
btnDisconnectIpc.setOnClickListener {
CallerAutoPilotManager.disconnectIpc()
CallerAutoPilotControlManager.disconnectIpc()
}
/**
@@ -1000,32 +1001,32 @@ internal class DebugSettingView @JvmOverloads constructor(
val recordTimeStr = etInputRecordTime.text?.toString()
try {
if (recordTimeStr.isNullOrEmpty()) {
CallerAutoPilotManager.recordPackage()
CallerAutoPilotControlManager.recordPackage()
}
val recordTime = recordTimeStr?.toInt()
if (recordTime != null && recordTime > 0) {
CallerAutoPilotManager.recordPackage(recordTime)
CallerAutoPilotControlManager.recordPackage(recordTime)
} else {
CallerAutoPilotManager.recordPackage()
CallerAutoPilotControlManager.recordPackage()
}
} catch (e: Exception) {
CallerAutoPilotManager.recordPackage()
CallerAutoPilotControlManager.recordPackage()
}
}
btnRecordBag.onClick {
val recordTimeStr = etInputRecordBagTime.text?.toString()
try {
if (recordTimeStr.isNullOrEmpty()) {
CallerAutoPilotManager.recordPackage()
CallerAutoPilotControlManager.recordPackage()
}
val recordTime = recordTimeStr?.toInt()
if (recordTime != null && recordTime > 0) {
CallerAutoPilotManager.recordPackage(recordTime)
CallerAutoPilotControlManager.recordPackage(recordTime)
} else {
CallerAutoPilotManager.recordPackage()
CallerAutoPilotControlManager.recordPackage()
}
} catch (e: Exception) {
CallerAutoPilotManager.recordPackage()
CallerAutoPilotControlManager.recordPackage()
}
}
@@ -1193,9 +1194,9 @@ internal class DebugSettingView @JvmOverloads constructor(
*/
tbADASLog.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
CallerAutoPilotManager.setEnableLog(true)
CallerAutoPilotControlManager.setEnableLog(true)
} else {
CallerAutoPilotManager.setEnableLog(false)
CallerAutoPilotControlManager.setEnableLog(false)
}
}
@@ -1519,7 +1520,7 @@ internal class DebugSettingView @JvmOverloads constructor(
tvAppVersionNameKey.text = "鹰眼版本名:${AppUtils.getAppVersionName()}"
tvAutopilotProtocolVersionInfo.text =
"Autopilot协议版本${CallerAutoPilotManager.getProtocolVersion()}"
"Autopilot协议版本${CallerAutoPilotControlManager.getProtocolVersion()}"
if (AppConfigInfo.protocolVersionNumber == 0) {
tvIpcProtocolVersionInfo.text = "工控机协议版本:未知"
} else {
@@ -1825,7 +1826,7 @@ internal class DebugSettingView @JvmOverloads constructor(
}
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
mGnssInfo = gnssInfo
//实时加速度列表
ThreadUtils.runOnUiThread {
@@ -1904,14 +1905,14 @@ internal class DebugSettingView @JvmOverloads constructor(
var resultStr = "result:"
for (result in it.resultList) {
resultStr =
"$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} "
"$resultStr$result${CallerAutoPilotControlManager.getReportResultDesc(result)} "
}
tvReportResult.text = resultStr
var actionStr = "action:"
for (action in it.actionsList) {
actionStr =
"$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} "
"$actionStr$action${CallerAutoPilotControlManager.getReportActionDesc(action)} "
}
tvReportActions.text = actionStr
@@ -2010,14 +2011,14 @@ internal class DebugSettingView @JvmOverloads constructor(
var resultStr = "result:"
for (result in it.resultList) {
resultStr =
"$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} "
"$resultStr$result${CallerAutoPilotControlManager.getReportResultDesc(result)} "
}
tvReportResult.text = resultStr
var actionStr = "action:"
for (action in it.actionsList) {
actionStr =
"$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} "
"$actionStr$action${CallerAutoPilotControlManager.getReportActionDesc(action)} "
}
tvReportActions.text = actionStr
if ("error" == it.level) {

View File

@@ -6,7 +6,7 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.hmi.R
import me.jessyan.autosize.AutoSizeCompat
@@ -37,13 +37,13 @@ class IPCReportAdapter: RecyclerView.Adapter<IPCReportAdapter.IPCReportHolder>()
holder.tvReportTimeContent.text = it.time
var resultStr = "发生异常"
for (result in it.resultList){
resultStr = "${resultStr}-${CallerAutoPilotManager.getReportResultDesc(result)}"
resultStr = "${resultStr}-${CallerAutoPilotControlManager.getReportResultDesc(result)}"
}
holder.tvReportResultContent.text = resultStr
holder.tvReportMsgContent.text = it.msg
var actionStr = ""
for (action in it.actionsList){
actionStr = "${actionStr}-${CallerAutoPilotManager.getReportActionDesc(action)}"
actionStr = "${actionStr}-${CallerAutoPilotControlManager.getReportActionDesc(action)}"
}
holder.tvReportActionContent.text = actionStr
}

View File

@@ -9,7 +9,7 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.hmi.R
/**
@@ -45,12 +45,12 @@ class ReportListAdapter(context: Context) :
holder.tvReportCode.text = "code:${it.code}"
var resultStr = "result:"
for (result in it.resultList) {
resultStr = "$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} "
resultStr = "$resultStr$result${CallerAutoPilotControlManager.getReportResultDesc(result)} "
}
holder.tvReportResult.text = resultStr
var actionStr = "action:"
for (action in it.actionsList) {
actionStr = "$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} "
actionStr = "$actionStr$action${CallerAutoPilotControlManager.getReportActionDesc(action)} "
}
holder.tvReportActions.text = actionStr

View File

@@ -10,7 +10,7 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
@@ -49,7 +49,7 @@ internal class SOPSettingView @JvmOverloads constructor(
//绕障类功能开关
tbObstacleAvoidance.isChecked = FunctionBuildConfig.isDetouring
tbObstacleAvoidance.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotManager.sendDetouring(isChecked)
CallerAutoPilotControlManager.sendDetouring(isChecked)
FunctionBuildConfig.isDetouring = isChecked
}
@@ -161,10 +161,10 @@ internal class SOPSettingView @JvmOverloads constructor(
tbDemoMode.setOnCheckedChangeListener { _, _ ->
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
CallerHmiManager.updateStatusBarLeftView(FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(context))
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
if (!FunctionBuildConfig.isDemoMode) {
//关闭美化模式时,通知工控机
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
}
}
//只在司机端设置美化模式开关功能
@@ -177,7 +177,7 @@ internal class SOPSettingView @JvmOverloads constructor(
tbRainMode.isChecked = FunctionBuildConfig.isRainMode
//雨天模式
tbRainMode.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotManager.setRainMode(isChecked)
CallerAutoPilotControlManager.setRainMode(isChecked)
FunctionBuildConfig.isRainMode = isChecked
}
//雨天模式按钮只在司机屏生效,乘客屏不显示
@@ -227,7 +227,7 @@ internal class SOPSettingView @JvmOverloads constructor(
}
btnSpeedSet.setOnClickListener {
val isSuccess =
CallerAutoPilotManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble())
CallerAutoPilotControlManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble())
if (isSuccess == true) {
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置成功")
} else {

View File

@@ -4,7 +4,7 @@ import android.content.Context
import android.util.AttributeSet
import android.view.View
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
@@ -25,10 +25,10 @@ class DemoModeHiddenSwitch(context: Context, attrs: AttributeSet?) : View(contex
"demoMode",
DemoModeView(context)
)
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
if (!FunctionBuildConfig.isDemoMode) {
//关闭美化模式时,通知工控机
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
}
}
}

View File

@@ -7,7 +7,6 @@ import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Process
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
@@ -18,10 +17,9 @@ import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
import com.mogo.eagle.core.data.temp.EventLogout
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.utils.KeyBoardUtil
import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
@@ -77,7 +75,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
}
else -> {
// 设置自动驾驶速度
val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speed)
val isSuccess = CallerAutoPilotControlManager.setAutoPilotSpeed(speed)
when {
isSuccess -> {
ToastUtils.showShort("车速设置成功,立即生效")
@@ -110,7 +108,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
}
if (AppConfigInfo.isConnectAutopilot) {
CallerAutoPilotManager.getCarConfig()
CallerAutoPilotControlManager.getCarConfig()
}
// if (maxAcceleration > 0) {
// tvAcceleration.text = "加速度 $maxAcceleration m/s²"
@@ -142,7 +140,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
//速度确认
tvSureModify.setOnClickListener {
val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speedLimit)
val isSuccess = CallerAutoPilotControlManager.setAutoPilotSpeed(speedLimit)
when {
isSuccess -> {
//速度显示

View File

@@ -8,7 +8,7 @@ import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
@@ -85,7 +85,7 @@ class AutoPilotStatusView constructor(
AutopilotControlParameters.AutoPilotLonLat(26.819716071924688, 112.57715442110867)
currentAutopilot.vehicleType = 10
CallerAutoPilotManager.startAutoPilot(currentAutopilot)
CallerAutoPilotControlManager.startAutoPilot(currentAutopilot)
}
/**

View File

@@ -9,7 +9,7 @@ import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.function.hmi.R
@@ -68,7 +68,7 @@ class CheckSystemView @JvmOverloads constructor(
else {
//确认重启
CallerLogger.d("$M_HMI$TAG", "reboot confirm")
CallerAutoPilotManager.setIPCReboot()
CallerAutoPilotControlManager.setIPCReboot()
}
}

View File

@@ -5,12 +5,12 @@ import android.graphics.Color
import android.util.AttributeSet
import android.view.Gravity
import android.widget.FrameLayout
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import mogo.telematics.pad.MessagePad
import java.util.*
/**
@@ -29,7 +29,7 @@ class SpeedPanelView @JvmOverloads constructor(
var mContext: Context
var mSpeedChartView: SpeedChartView
var mLatLng: MessagePad.GnssInfo? = null
var mLatLng: MogoLocation? = null
var mSpeedLimit = 60
private val timer by lazy {
@@ -77,7 +77,7 @@ class SpeedPanelView @JvmOverloads constructor(
timer.schedule(task, Date(), 200)
}
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
gnssInfo?.let {
mLatLng = gnssInfo
}

View File

@@ -24,7 +24,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.mofang.MfConstants;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
import com.mogo.eagle.core.function.hmi.R;
@@ -351,7 +351,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (isShowToast) {
ToastUtils.showShort("方块 单击C ← 向左变道 ");
}
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneLeft();
CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneLeft();
}
}
return true;
@@ -372,7 +372,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (isShowToast) {
ToastUtils.showShort("方块 单击D → 向右变道 ");
}
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneRight();
CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneRight();
}
}
return true;
@@ -384,14 +384,14 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (isShowToast) {
ToastUtils.showShort("方块 长按E 鸣笛 ");
}
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(1);
if (timerHorn == null) {
timerHorn = new Timer();
}
timerHorn.schedule(new TimerTask() {
@Override
public void run() {
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(2);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(2);
timerHorn = null;
}
}, 500);
@@ -404,7 +404,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (isShowToast) {
ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
}
CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters());
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters());
}
}
return true;
@@ -425,7 +425,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
timerAcc.schedule(new TimerTask() {
@Override
public void run() {
CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated);
}
}, 0, 500);
}
@@ -434,7 +434,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
timerAcc.cancel();
timerAcc = null;
}
CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc);
}
}

View File

@@ -20,13 +20,12 @@ import android.widget.FrameLayout;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.module.intent.IMogoIntentListener;
import com.mogo.commons.module.intent.IntentManager;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
import com.mogo.eagle.core.function.hmi.R;
@@ -300,7 +299,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
isCombinationKey = false;
if ((pressCUpTime - startPressTime) < 300) {
ToastUtils.showShort("方块 单击C ← 向左变道 ");
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneLeft();
CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneLeft();
}
}
return true;
@@ -318,7 +317,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
isCombinationKey = false;
if ((pressDUpTime - startPressTime) < 300) {
ToastUtils.showShort("方块 单击D → 向右变道 ");
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneRight();
CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneRight();
}
}
@@ -329,14 +328,14 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
if (!isCombinationKey) {
if ((pressEDownTime - startPressTime) > 1900) {
ToastUtils.showShort("方块 长按E 鸣笛 ");
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(1);
if (timerHorn == null) {
timerHorn = new Timer();
}
timerHorn.schedule(new TimerTask() {
@Override
public void run() {
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(2);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(2);
timerHorn = null;
}
}, 500);
@@ -348,7 +347,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
isCombinationKey = false;
if ((pressEUpTime - startPressTime) < 300) {
ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters());
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters());
}
}
@@ -372,7 +371,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
timerAcc.schedule(new TimerTask() {
@Override
public void run() {
CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated);
}
}, 0, 500);
}
@@ -381,7 +380,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
timerAcc.cancel();
timerAcc = null;
}
CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc);
}
}

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.business;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.enums.DataSourceType;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
@@ -13,8 +14,6 @@ import java.util.Objects;
import java.util.Timer;
import java.util.TimerTask;
import mogo.telematics.pad.MessagePad;
/**
* 限速
*
@@ -24,7 +23,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
private final static String TAG = "SpeedLimitDataManager";
private static volatile SpeedLimitDataManager instance;
private MessagePad.GnssInfo mLocation;
private MogoLocation mLocation;
private SpeedLimitDataManager() {
}
@@ -41,7 +40,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
mLocation = gnssInfo;
}

View File

@@ -8,16 +8,18 @@ import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.zhidaoauto.map.operational.open.GatherApi
import com.zhidaoauto.map.operational.open.GatherParams
import com.zhidaoauto.map.operational.open.abs.OnTaskListener
import mogo.telematics.pad.MessagePad.GnssInfo
import record_cache.RecordPanelOuterClass
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CopyOnWriteArrayList
@@ -168,14 +170,14 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
}
}
override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return
executor.get()?.updateLocation(
location.longitude,
location.latitude,
location.altitude,
location.bearing,
location.speed,
location.heading.toFloat(),
location.gnssSpeed,
false)
}

View File

@@ -5,6 +5,7 @@ import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningTrajectoryListener;
@@ -65,7 +66,7 @@ public class MogoRouteOverlayManager implements
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (gnssInfo == null) {
return;
}

View File

@@ -8,9 +8,10 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.map.CenterLine
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
@@ -19,13 +20,12 @@ import com.mogo.eagle.core.function.business.SpeedLimitDataManager
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBrakeLight
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showTurnLight
import com.mogo.eagle.core.function.call.map.CallerHDMapManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.datacenter.location.IMoGoLocationListener
import com.mogo.eagle.core.function.datacenter.location.MoGoLocationManager
import com.mogo.eagle.core.function.overview.InfStructureManager
import com.mogo.eagle.core.function.overview.InfStructureManager.savePlanningData
import com.mogo.eagle.core.function.overview.obtainViewModel
@@ -54,7 +54,7 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
MapView,
IMoGoMapFragmentProvider,
IMoGoSkinModeChangeListener,
IMoGoLocationListener,
IMoGoChassisLocationWGS84Listener,
IMoGoPlanningRottingListener,
IMoGoChassisLamplightListener {
@@ -114,7 +114,7 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
// 添加换肤监听
CallerSkinModeListenerManager.addListener(Companion.functionName, this)
CallerPlanningRottingListenerManager.addListener(Companion.functionName, this)
MoGoLocationManager.addListener(Companion.functionName, this)
CallerChassisLocationWGS84ListenerManager.addListener(Companion.functionName, this)
CallerChassisLamplightListenerManager.addListener(Companion.functionName, this)
}
@@ -218,7 +218,7 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
override fun onDestroyView() {
CallerSkinModeListenerManager.removeListener(Companion.functionName)
CallerPlanningRottingListenerManager.removeListener(Companion.functionName)
MoGoLocationManager.removeListener(Companion.functionName)
CallerChassisLocationWGS84ListenerManager.removeListener(Companion.functionName)
CallerChassisLamplightListenerManager.removeListener(Companion.functionName)
if (mMogoMapView != null) {
@@ -346,8 +346,8 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
private var isShowTurnLight = false
private var brakeLight = -1
override fun onLocationChanged(gnssInfo: MessagePad.GnssInfo,sourceType: DataSourceType) {
// 新地图控件
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
// 新地图控件
mMogoMapView?.setExtraGPSData(gnssInfo)
if (gnssInfo != null) {
@@ -364,6 +364,7 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
}
}
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
//can数据转发 转向灯状态 0是正常 1是左转 2是右转
if (lightSwitch != null) {

View File

@@ -19,9 +19,10 @@ import com.amap.api.maps.model.*
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.map.Infrastructure
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.getGlobalPath
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.getGlobalPath
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showVideoDialog
@@ -83,7 +84,7 @@ class OverMapView @JvmOverloads constructor(
// 绘制轨迹线的集合
private val textureList: MutableList<BitmapDescriptor?> = ArrayList()
private val texIndexList: MutableList<Int> = ArrayList()
private var mLocation: MessagePad.GnssInfo? = null
private var mLocation: MogoLocation? = null
private var isFirstLocation = true
var mCustomMapStyleOptions: CustomMapStyleOptions? = null
var currMarkerList: ArrayList<Marker>? = null
@@ -493,7 +494,7 @@ class OverMapView @JvmOverloads constructor(
*
* @param location
*/
private fun drawCarMarker(location: MessagePad.GnssInfo?) {
private fun drawCarMarker(location: MogoLocation?) {
if (location == null) return
if (mCarMarker != null) {
val currentLatLng = LatLng(location.latitude, location.longitude)
@@ -568,7 +569,7 @@ class OverMapView @JvmOverloads constructor(
}
}
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
mLocation = gnssInfo
lonLat = Pair(gnssInfo!!.longitude, gnssInfo.latitude)
drawCarMarker(gnssInfo)

View File

@@ -31,6 +31,7 @@ import com.amap.api.maps.model.Polyline;
import com.amap.api.maps.model.PolylineOptions;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.Infrastructure;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
@@ -92,7 +93,7 @@ public class AMapCustomView
private List<BitmapDescriptor> textureList = new ArrayList<>();
private List<Integer> texIndexList = new ArrayList<>();
private MessagePad.GnssInfo mLocation;
private MogoLocation mLocation;
private boolean isFirstLocation = true;
CustomMapStyleOptions mCustomMapStyleOptions;
@@ -456,7 +457,7 @@ public class AMapCustomView
*
* @param location
*/
private void drawCarMarker(MessagePad.GnssInfo location) {
private void drawCarMarker(MogoLocation location) {
if (location == null) return;
if (mCarMarker != null) {
LatLng currentLatLng = new LatLng(location.getLatitude(), location.getLongitude());
@@ -534,7 +535,7 @@ public class AMapCustomView
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
mLocation = gnssInfo;
MarkerDrawerManager.INSTANCE.setLonLat(new Pair(gnssInfo.getLongitude(), gnssInfo.getLatitude()));
drawCarMarker(gnssInfo);

View File

@@ -13,7 +13,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.function.overview.InfStructureManager;
@@ -117,7 +117,7 @@ public class OverviewMapFragment extends BaseFragment
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
// 主动查一次全局路径规划的数据
CallerAutoPilotManager.INSTANCE.getGlobalPath();
CallerAutoPilotControlManager.INSTANCE.getGlobalPath();
queryV2XEvents();
}

View File

@@ -32,6 +32,7 @@ import com.amap.api.maps.model.PolylineOptions;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.map.R;
@@ -47,8 +48,6 @@ import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import mogo.telematics.pad.MessagePad;
/**
* 小地图的方向View
*
@@ -75,7 +74,7 @@ public class SmallMapDirectionView
private Polyline mPolyline;
private CameraUpdate mCameraUpdate;
private Context mContext;
private MessagePad.GnssInfo mLocation;
private MogoLocation mLocation;
public SmallMapDirectionView(Context context) {
this(context, null);
@@ -179,7 +178,7 @@ public class SmallMapDirectionView
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (gnssInfo == null) {
return;
}

View File

@@ -17,7 +17,7 @@ import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.map.R;
@@ -143,7 +143,7 @@ public class SmallMapFragment extends BaseFragment
clearPolyline();
}else if (tempStatus == 1 && autoPilotStatus == 0){
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:getGlobalPath");
CallerAutoPilotManager.INSTANCE.getGlobalPath();
CallerAutoPilotControlManager.INSTANCE.getGlobalPath();
}
autoPilotStatus = tempStatus;
}

View File

@@ -29,9 +29,9 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_C
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
@@ -46,7 +46,6 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.rousetime.android_startup.AndroidStartup
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
import mogo.telematics.pad.MessagePad.GnssInfo
class HttpDnsStartUp : AndroidStartup<Boolean>() {
@@ -293,10 +292,9 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
CallerChassisLocationGCJ20ListenerManager.addListener(
TAG,
object : IMoGoChassisLocationGCJ02Listener {
override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) {
CallerMapLocationListenerManager.getCurrentLocation()?.let { loc ->
MogoLocationInfoServices.getInstance().provideLocation(loc)
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
mogoLocation?.let {
MogoLocationInfoServices.getInstance().provideLocation(mogoLocation)
}
}
},

View File

@@ -1,47 +1,53 @@
package com.mogo.eagle.core.function.v2x.events
import android.content.*
import android.os.*
import android.util.*
import androidx.localbroadcastmanager.content.*
import com.mogo.cloud.passport.*
import android.content.Context
import android.content.Intent
import android.os.Handler
import android.os.Looper
import android.util.Log
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.mogo.cloud.passport.IMoGoTokenCallback
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.HostConst
import com.mogo.commons.module.ServiceConst.CARD_TYPE_ROAD_CONDITION
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.EventTypeHelper
import com.mogo.commons.network.*
import com.mogo.commons.network.ParamsUtil
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_V2N
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CLOUD_V2N
import com.mogo.eagle.core.data.enums.*
import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.EventTypeHelper
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.traffic.*
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.api.hmi.warning.*
import com.mogo.eagle.core.function.api.map.listener.*
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.hmi.*
import com.mogo.eagle.core.function.call.map.*
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.v2x.events.alarm.*
import com.mogo.eagle.core.function.v2x.events.bridge.*
import com.mogo.eagle.core.function.v2x.events.alarm.V2XAlarmServer
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.*
import com.mogo.eagle.core.function.v2x.events.manager.*
import com.mogo.eagle.core.function.v2x.events.receiver.*
import com.mogo.eagle.core.function.v2x.events.scenario.impl.*
import com.mogo.eagle.core.function.v2x.events.utils.*
import com.mogo.eagle.core.function.v2x.events.utils.MapUtils
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_EXTRA_KEY
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_HANDLER_ACTION
import com.mogo.eagle.core.function.v2x.events.receiver.SceneBroadcastReceiver
import com.mogo.eagle.core.function.v2x.events.scenario.impl.V2XScenarioManager
import com.mogo.eagle.core.function.v2x.events.utils.TrackUtils
import com.mogo.eagle.core.function.v2x.events.utils.toRoadMarker
import com.mogo.eagle.core.function.v2x.internal.V2XManager
import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback
import com.mogo.eagle.core.function.v2x.internal.config.V2XConfig
@@ -51,27 +57,35 @@ import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget
import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent
import com.mogo.eagle.core.function.v2x.road.V2XEventServiceApi
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.utilcode.mogo.logger.*
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.eagle.core.utilcode.util.Utils
import com.mogo.map.marker.*
import com.mogo.map.marker.IMogoMarker
import com.mogo.map.marker.IMogoMarkerClickListener
import com.mogo.map.marker.MogoMarkersHandler.Companion.mogoMarkersHandler
import com.shuyu.gsyvideoplayer.*
import com.shuyu.gsyvideoplayer.cache.*
import com.shuyu.gsyvideoplayer.model.*
import com.shuyu.gsyvideoplayer.player.*
import com.shuyu.gsyvideoplayer.utils.*
import com.zhjt.service.chain.*
import com.shuyu.gsyvideoplayer.GSYVideoManager
import com.shuyu.gsyvideoplayer.cache.CacheFactory
import com.shuyu.gsyvideoplayer.cache.ProxyCacheManager
import com.shuyu.gsyvideoplayer.model.VideoOptionModel
import com.shuyu.gsyvideoplayer.player.IjkPlayerManager
import com.shuyu.gsyvideoplayer.player.PlayerFactory
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.coroutines.*
import kotlinx.coroutines.android.*
import mogo.telematics.pad.MessagePad.GnssInfo
import tv.danmaku.ijk.media.player.*
import java.util.concurrent.*
import java.util.concurrent.atomic.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.android.asCoroutineDispatcher
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicBoolean
object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, IV2XCallback {
@@ -188,7 +202,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
return null
}
override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return
BridgeApi.location.set(location)
if (V2XManager.hasInit()) {
@@ -208,7 +222,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
val min = if (EventTypeEnumNew.isCloudSocketEvent(v2XRoadEventEntity.poiType)) 0 else 5
CallerLogger.d(
"$M_V2X$TAG",
"--- trigger show before ---:data=>[${location.longitude}, ${location.latitude}, ${location.speed}], distance: $distance, minDistance: $min, poiType: ${v2XRoadEventEntity.poiType}"
"--- trigger show before ---:data=>[${location.longitude}, ${location.latitude}, ${location.gnssSpeed}], distance: $distance, minDistance: $min, poiType: ${v2XRoadEventEntity.poiType}"
)
if (distance >= min) {
CallerLogger.d(

View File

@@ -1,7 +1,5 @@
package com.mogo.eagle.core.function.v2x.events.alarm;
import android.util.Log;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
@@ -51,7 +49,7 @@ public class V2XAlarmServer {
if (poiLocation == null) {
continue;
}
if (isOutOfRange(poiLocation.getLon(), poiLocation.getLat(), currentLocation.getLongitude(), currentLocation.getLatitude(), currentLocation.getBearing())) {
if (isOutOfRange(poiLocation.getLon(), poiLocation.getLat(), currentLocation.getLongitude(), currentLocation.getLatitude(), currentLocation.getHeading())) {
iterator.remove();
}
}
@@ -75,7 +73,7 @@ public class V2XAlarmServer {
}
}
// 2、道路事件方向与当前行驶方向角度偏差《20度以内
double carBearing = currentLocation.getBearing();
double carBearing = currentLocation.getHeading();
double eventBearing = eventLocation.getAngle();
double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing);
Logger.d(TAG, "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle);
@@ -86,7 +84,7 @@ public class V2XAlarmServer {
currentLocation.getLatitude(),
eventLocation.getLon(),
eventLocation.getLat(),
(int) currentLocation.getBearing()
(int) currentLocation.getHeading()
);
Logger.d(TAG, "eventAngle:" + eventAngle);

View File

@@ -4,13 +4,14 @@ import android.os.Handler
import android.os.HandlerThread
import android.util.Log
import com.mogo.cloud.commons.utils.CoordinateUtils
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
import com.mogo.map.marker.IMogoMarker
import com.mogo.map.overlay.IMogoPolyline
import kotlinx.coroutines.Runnable
import mogo.telematics.pad.MessagePad.GnssInfo
import java.util.LinkedList
import java.util.*
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicReference
@@ -83,7 +84,7 @@ object MarkerRemoveManager {
}
Log.d(TAG, "--- checkTask --- 3 ---")
val toRemove = toRemoveMakers.iterator()
val carLoc = AtomicReference<GnssInfo>()
val carLoc = AtomicReference<MogoLocation>()
while (toRemove.hasNext()) {
val marker = toRemove.next()
if (carLoc.get() == null) {

View File

@@ -45,7 +45,7 @@ class V2XAiRoadEventMarker {
if (polygons.size > 0) {
val l2 = entity.noveltyInfo?.location ?: return
v2xLocation.set(MogoLocation().also {
it.longitude = l2.lon; it.latitude = l2.lat; it.bearing = l2.angle.toFloat()
it.longitude = l2.lon; it.latitude = l2.lat; it.heading = l2.angle
})
val options = MogoPolylineOptions()

View File

@@ -7,8 +7,11 @@ import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
import com.mogo.eagle.core.data.msgbox.MsgBoxBean;
import com.mogo.eagle.core.data.msgbox.MsgBoxType;
@@ -19,14 +22,13 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario;
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import java.math.BigDecimal;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import mogo.telematics.pad.MessagePad;
/**
* @author liujing
* @description 车路云—场景预警-V1.0 前车/行人/摩托车/盲区碰撞预警
@@ -128,7 +130,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
sV2XWarningMarker.onCarLocationChanged2(gnssInfo);
}

View File

@@ -3,32 +3,33 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.warning;
import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA;
import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.utils.Trigonometric;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.v2x.DrawLineInfo;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
import com.mogo.eagle.core.data.v2x.DrawLineInfo;
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoPersonWarnPolylineManager;
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoStopPolylineManager;
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoWarnPolylineManager;
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation;
import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.commons.utils.Trigonometric;
import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation;
import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import mogo.telematics.pad.MessagePad;
/**
* @author liujing
@@ -52,7 +53,7 @@ public class V2XWarningMarker implements IV2XMarker {
* */
private MogoLatLng middleLocationInStopLine = new MogoLatLng(0, 0);
private static long showTime = 6000;
private float bearing;
private double bearing;
private boolean hasStopLines = false;
@Override
@@ -75,7 +76,7 @@ public class V2XWarningMarker implements IV2XMarker {
if (location == null) {
return;
}
bearing = location.getBearing();
bearing = location.getHeading();
if (mCloundWarningInfo != null && mCloundWarningInfo.getStopLines() != null) {
hasStopLines = mCloundWarningInfo.getStopLines().size() > 0;
@@ -428,7 +429,7 @@ public class V2XWarningMarker implements IV2XMarker {
}
//线随车动
public void onCarLocationChanged2(MessagePad.GnssInfo latLng) {
public void onCarLocationChanged2(MogoLocation latLng) {
carLocation = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude());
if (MogoStatusManager.getInstance().isVrMode() && !isSelfLineClear) {
if (mCloundWarningInfo != null) {

View File

@@ -1,17 +1,12 @@
package com.mogo.eagle.core.data.map;
import android.os.Parcel;
import android.os.Parcelable;
import mogo.telematics.pad.MessagePad;
public class MogoLocation implements Cloneable, Parcelable {
public class MogoLocation implements Cloneable {
private MessagePad.GnssInfo gnssInfo = MessagePad.GnssInfo.newBuilder().build();
private int locType = 0;
private double latitude = 0;
private double longitude = 0;
private double altitude = 0;
private long time = 0;
private float bearing = 0;
private float accuracy = 0;
private float speed = 0;
private String cityName = "";
private String cityCode = "";
private String provider = "";
@@ -22,29 +17,45 @@ public class MogoLocation implements Cloneable, Parcelable {
private String locationDetail = "";
private String poiName = "";
private String aoiName = "";
private int errCode = 0;
private String errInfo = "";
private String street = "";
private String streetNum = "";
private String description = "";
private String buildingId = "";
private String floor = "";
private int errorCode = 0;
private String errorInfo = "";
private int gpsAccuracyStatus = 0;
private int satellite = 0;
public float getBearing() {
return bearing;
// 记录最后一次收到的时间戳ms用于计算是否要切换GPS数据源
private long lastReceiveTime;
public MessagePad.GnssInfo getGnssInfo() {
return gnssInfo;
}
public void setBearing( float bearing ) {
this.bearing = bearing;
public void setGnssInfo(MessagePad.GnssInfo gnssInfo) {
this.gnssInfo = gnssInfo;
}
public double getHeading() {
if (gnssInfo != null) {
return gnssInfo.getHeading();
}
return 0;
}
public void setHeading(double bearing) {
if (gnssInfo != null) {
gnssInfo = gnssInfo.toBuilder().setHeading(bearing).build();
}
}
public float getAccuracy() {
return accuracy;
}
public void setAccuracy( float accuracy ) {
public void setAccuracy(float accuracy) {
this.accuracy = accuracy;
}
@@ -52,23 +63,41 @@ public class MogoLocation implements Cloneable, Parcelable {
return provider;
}
public void setProvider( String provider ) {
public void setProvider(String provider) {
this.provider = provider;
}
public float getSpeed() {
return speed;
public float getGnssSpeed() {
if (gnssInfo != null) {
return (float) gnssInfo.getGnssSpeed();
}
return 0;
}
public void setSpeed( float speed ) {
this.speed = speed;
public void setGnssSpeed(float speed) {
if (gnssInfo != null) {
gnssInfo = gnssInfo.toBuilder().setGnssSpeed(speed).build();
}
}
public float getAcceleration() {
if (gnssInfo != null) {
return (float) gnssInfo.getAcceleration();
}
return 0;
}
public void setAcceleration(double acceleration) {
if (gnssInfo != null) {
gnssInfo = gnssInfo.toBuilder().setAcceleration(acceleration).build();
}
}
public String getLocationDetail() {
return locationDetail;
}
public void setLocationDetail( String locationDetail ) {
public void setLocationDetail(String locationDetail) {
this.locationDetail = locationDetail;
}
@@ -76,7 +105,7 @@ public class MogoLocation implements Cloneable, Parcelable {
return poiName;
}
public void setPoiName( String poiName ) {
public void setPoiName(String poiName) {
this.poiName = poiName;
}
@@ -84,24 +113,24 @@ public class MogoLocation implements Cloneable, Parcelable {
return aoiName;
}
public void setAoiName( String aoiName ) {
public void setAoiName(String aoiName) {
this.aoiName = aoiName;
}
public int getErrCode() {
return errCode;
public int getErrorCode() {
return errorCode;
}
public void setErrCode( int errCode ) {
this.errCode = errCode;
public void setErrorCode(int errorCode) {
this.errorCode = errorCode;
}
public String getErrInfo() {
return errInfo;
public String getErrorInfo() {
return errorInfo;
}
public void setErrInfo( String errInfo ) {
this.errInfo = errInfo;
public void setErrorInfo(String errorInfo) {
this.errorInfo = errorInfo;
}
public String getStreet() {
@@ -116,7 +145,7 @@ public class MogoLocation implements Cloneable, Parcelable {
return streetNum;
}
public void setStreetNum( String streetNum ) {
public void setStreetNum(String streetNum) {
this.streetNum = streetNum;
}
@@ -124,7 +153,7 @@ public class MogoLocation implements Cloneable, Parcelable {
return description;
}
public void setDescription( String description ) {
public void setDescription(String description) {
this.description = description;
}
@@ -132,7 +161,7 @@ public class MogoLocation implements Cloneable, Parcelable {
return buildingId;
}
public void setBuildingId( String buildingId ) {
public void setBuildingId(String buildingId) {
this.buildingId = buildingId;
}
@@ -140,7 +169,7 @@ public class MogoLocation implements Cloneable, Parcelable {
return floor;
}
public void setFloor( String floor ) {
public void setFloor(String floor) {
this.floor = floor;
}
@@ -148,7 +177,7 @@ public class MogoLocation implements Cloneable, Parcelable {
return gpsAccuracyStatus;
}
public void setGpsAccuracyStatus( int gpsAccuracyStatus ) {
public void setGpsAccuracyStatus(int gpsAccuracyStatus) {
this.gpsAccuracyStatus = gpsAccuracyStatus;
}
@@ -156,24 +185,151 @@ public class MogoLocation implements Cloneable, Parcelable {
return satellite;
}
public void setSatellite( int satellite ) {
public void setSatellite(int satellite) {
this.satellite = satellite;
}
public MogoLocation() {
}
public double getAltitude() {
if (gnssInfo != null) {
return gnssInfo.getAltitude();
}
return 0;
}
public void setAltitude(double altitude) {
if (gnssInfo != null) {
gnssInfo = gnssInfo.toBuilder().setAltitude(altitude).build();
}
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getAdCode() {
return adCode;
}
public void setAdCode(String adCode) {
this.adCode = adCode;
}
public int getLocType() {
return locType;
}
public void setLocType(int locType) {
this.locType = locType;
}
public double getLatitude() {
if (gnssInfo != null) {
return gnssInfo.getLatitude();
}
return 0;
}
public void setLatitude(double latitude) {
if (gnssInfo != null) {
gnssInfo = gnssInfo.toBuilder().setLatitude(latitude).build();
}
}
public double getLongitude() {
if (gnssInfo != null) {
return gnssInfo.getLongitude();
}
return 0;
}
public void setLongitude(double longitude) {
if (gnssInfo != null) {
gnssInfo = gnssInfo.toBuilder().setLongitude(longitude).build();
}
}
public long getSatelliteTime() {
if (gnssInfo != null) {
return (long) gnssInfo.getSatelliteTime();
}
return 0;
}
public void setSatelliteTime(long time) {
if (gnssInfo != null) {
gnssInfo = gnssInfo.toBuilder().setSatelliteTime(time).build();
}
}
public String getCityCode() {
return cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
@Override
public MogoLocation clone() {
try {
return (MogoLocation) super.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return this;
}
public long getLastReceiveTime() {
return lastReceiveTime;
}
public void setLastReceiveTime(long lastReceiveTime) {
this.lastReceiveTime = lastReceiveTime;
}
@Override
public String toString() {
return "MogoLocation{" +
"locType=" + locType +
", latitude=" + latitude +
", longitude=" + longitude +
", altitude=" + altitude +
", time=" + time +
", bearing=" + bearing +
", latitude=" + getLatitude() +
", longitude=" + getLongitude() +
", altitude=" + getAltitude() +
", time=" + getSatelliteTime() +
", bearing=" + getHeading() +
", accuracy=" + accuracy +
", speed=" + speed +
", speed=" + getGnssSpeed() +
", cityName='" + cityName + '\'' +
", cityCode='" + cityCode + '\'' +
", provider='" + provider + '\'' +
@@ -184,8 +340,8 @@ public class MogoLocation implements Cloneable, Parcelable {
", locationDetail='" + locationDetail + '\'' +
", poiName='" + poiName + '\'' +
", aoiName='" + aoiName + '\'' +
", errCode=" + errCode +
", errInfo='" + errInfo + '\'' +
", errCode=" + errorCode +
", errInfo='" + errorInfo + '\'' +
", street='" + street + '\'' +
", streetNum='" + streetNum + '\'' +
", description='" + description + '\'' +
@@ -195,180 +351,4 @@ public class MogoLocation implements Cloneable, Parcelable {
", satellite=" + satellite +
'}';
}
public double getAltitude() {
return altitude;
}
public void setAltitude( double altitude ) {
this.altitude = altitude;
}
public String getAddress() {
return address;
}
public void setAddress( String address ) {
this.address = address;
}
public String getDistrict() {
return district;
}
public void setDistrict( String district ) {
this.district = district;
}
public String getProvince() {
return province;
}
public void setProvince( String province ) {
this.province = province;
}
public String getAdCode() {
return adCode;
}
public void setAdCode( String adCode ) {
this.adCode = adCode;
}
public int getLocType() {
return locType;
}
public void setLocType( int locType ) {
this.locType = locType;
}
public double getLatitude() {
return latitude;
}
public void setLatitude( double latitude ) {
this.latitude = latitude;
}
public double getLongitude() {
return longitude;
}
public void setLongitude( double longitude ) {
this.longitude = longitude;
}
public long getTime() {
return time;
}
public void setTime( long time ) {
this.time = time;
}
public String getCityCode() {
return cityCode;
}
public void setCityCode( String cityCode ) {
this.cityCode = cityCode;
}
public String getCityName() {
return cityName;
}
public void setCityName( String cityName ) {
this.cityName = cityName;
}
@Override
public MogoLocation clone() {
try {
return ( MogoLocation ) super.clone();
} catch ( CloneNotSupportedException e ) {
e.printStackTrace();
}
return this;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel( Parcel dest, int flags ) {
dest.writeInt( this.locType );
dest.writeDouble( this.latitude );
dest.writeDouble( this.longitude );
dest.writeDouble( this.altitude );
dest.writeLong( this.time );
dest.writeFloat( this.bearing );
dest.writeFloat( this.accuracy );
dest.writeFloat( this.speed );
dest.writeString( this.cityName );
dest.writeString( this.cityCode );
dest.writeString( this.provider );
dest.writeString( this.address );
dest.writeString( this.district );
dest.writeString( this.province );
dest.writeString( this.adCode );
dest.writeString( this.locationDetail );
dest.writeString( this.poiName );
dest.writeString( this.aoiName );
dest.writeInt( this.errCode );
dest.writeString( this.errInfo );
dest.writeString( this.street );
dest.writeString( this.streetNum );
dest.writeString( this.description );
dest.writeString( this.buildingId );
dest.writeString( this.floor );
dest.writeInt( this.gpsAccuracyStatus );
dest.writeInt( this.satellite );
}
protected MogoLocation( Parcel in ) {
this.locType = in.readInt();
this.latitude = in.readDouble();
this.longitude = in.readDouble();
this.altitude = in.readDouble();
this.time = in.readLong();
this.bearing = in.readFloat();
this.accuracy = in.readFloat();
this.speed = in.readFloat();
this.cityName = in.readString();
this.cityCode = in.readString();
this.provider = in.readString();
this.address = in.readString();
this.district = in.readString();
this.province = in.readString();
this.adCode = in.readString();
this.locationDetail = in.readString();
this.poiName = in.readString();
this.aoiName = in.readString();
this.errCode = in.readInt();
this.errInfo = in.readString();
this.street = in.readString();
this.streetNum = in.readString();
this.description = in.readString();
this.buildingId = in.readString();
this.floor = in.readString();
this.gpsAccuracyStatus = in.readInt();
this.satellite = in.readInt();
}
public static final Parcelable.Creator< MogoLocation > CREATOR = new Parcelable.Creator< MogoLocation >() {
@Override
public MogoLocation createFromParcel( Parcel source ) {
return new MogoLocation( source );
}
@Override
public MogoLocation[] newArray( int size ) {
return new MogoLocation[size];
}
};
}

View File

@@ -10,7 +10,7 @@ import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
* @date 2021/9/22 8:27 下午
* 自动驾驶节点
*/
interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
/**
* 重新连接自动驾驶域控制器指定IP地址
*

View File

@@ -0,0 +1,18 @@
package com.mogo.eagle.core.function.api.autopilot
import mogo.telematics.pad.MessagePad
/**
* 车辆定位 WGS84 坐标系-高精度坐标系 数据 回调监听
* @author donghongyu
* @date 2023/1/11 2:06 下午
*/
interface IMoGoChassisGnssListener {
/**
* 车辆定位 GCJ02 坐标系-高德坐标系 数据
*
* @param gnssInfo
*/
fun onChassisGnss(gnssInfo: MessagePad.GnssInfo)
}

View File

@@ -1,6 +1,6 @@
package com.mogo.eagle.core.function.api.autopilot
import mogo.telematics.pad.MessagePad
import com.mogo.eagle.core.data.map.MogoLocation
/**
* @author donghongyu
@@ -14,5 +14,5 @@ interface IMoGoChassisLocationGCJ02Listener {
*
* @param gnssInfo
*/
fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?)
fun onChassisLocationGCJ02(mogoLocation: MogoLocation?)
}

View File

@@ -1,11 +1,11 @@
package com.mogo.eagle.core.function.api.autopilot
import mogo.telematics.pad.MessagePad
import com.mogo.eagle.core.data.map.MogoLocation
/**
* 车辆定位 WGS84 坐标系-高精度坐标系 数据 回调监听
* @author donghongyu
* @date 2023/1/11 2:06 下午
* 车辆定位 WGS84 坐标系-高精度坐标系 数据 回调监听
*/
interface IMoGoChassisLocationWGS84Listener {
@@ -14,5 +14,5 @@ interface IMoGoChassisLocationWGS84Listener {
*
* @param gnssInfo
*/
fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo)
fun onChassisLocationWGS84(gnssInfo: MogoLocation)
}

View File

@@ -10,7 +10,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_C
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotControlProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.zhjt.service.chain.ChainLog
@@ -23,12 +23,12 @@ import kotlin.random.Random
*@date 2021/10/14 2:15 下午
* 域控制器管理
*/
object CallerAutoPilotManager {
object CallerAutoPilotControlManager {
private val TAG = "CallerAutoPilotManager"
private val providerApi: IMoGoAutopilotProvider?
private val providerApi: IMoGoAutopilotControlProvider?
get() = CallerBase.getApiInstance(
IMoGoAutopilotProvider::class.java,
IMoGoAutopilotControlProvider::class.java,
MogoServicePaths.PATH_AUTO_PILOT
)

View File

@@ -6,9 +6,9 @@ import mogo.telematics.pad.MessagePad
import perception.TrafficLightOuterClass
/**
* 域控制器感知数据
* @author xiaoyuzhou
* @date 2021/9/30 5:48 下午
* 域控制器感知数据
*/
object CallerAutopilotIdentifyListenerManager : CallerBase<IMoGoAutopilotIdentifyListener>() {

View File

@@ -0,0 +1,27 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGnssListener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.telematics.pad.MessagePad
/**
* 车辆定位 WGS84 坐标系-高精度坐标系 数据 回调监听
* @author xiaoyuzhou
* @date 2021/9/30 5:48 下午
*/
object CallerChassisGnssListenerManager : CallerBase<IMoGoChassisGnssListener>() {
/**
* 车辆定位 WGS84 坐标系-高精度坐标系 数据
* @param gnssInfo
*/
@Synchronized
fun invokeChassisGnssListener(gnssInfo: MessagePad.GnssInfo) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onChassisGnss(gnssInfo)
}
}
}

View File

@@ -1,10 +1,12 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
import mogo.telematics.pad.MessagePad
import com.mogo.eagle.core.utilcode.util.TimeUtils
/**
* @author xiaoyuzhou
@@ -16,9 +18,21 @@ object CallerChassisLocationGCJ20ListenerManager : CallerBase<IMoGoChassisLocati
val TAG = "CallerChassisLocationGCJ20ListenerManager"
@Volatile
private var mGnssInfo: MessagePad.GnssInfo? = null
private var mGnssInfo: MogoLocation? = null
fun getChassisLocationGCJ02(): MessagePad.GnssInfo? {
/**
* 添加监听并指定回掉频率
*/
fun addListener(
tag: String,
callBackHz: Int,
listener: IMoGoChassisLocationGCJ02Listener
) {
addListener(tag, listener)
setListenerHz(tag, callBackHz)
}
fun getChassisLocationGCJ02(): MogoLocation? {
return mGnssInfo
}
@@ -27,25 +41,62 @@ object CallerChassisLocationGCJ20ListenerManager : CallerBase<IMoGoChassisLocati
* @param gnssInfo
*/
@Synchronized
fun invokeChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
fun invokeChassisLocationGCJ02(gnssInfo: MogoLocation?,sourceType: DataSourceType) {
gnssInfo?.let {
// 转换 WGS84-->GCJ02 坐标
val gcj20Location = CoordinateTransform.WGS84ToGCJ02(gnssInfo.longitude, gnssInfo.latitude)
val gcj20Location =
CoordinateTransform.WGS84ToGCJ02(gnssInfo.longitude, gnssInfo.latitude)
val gnssBuilder = gnssInfo.toBuilder()
gnssBuilder.longitude = gcj20Location[0]
gnssBuilder.latitude = gcj20Location[1]
gnssInfo.longitude = gcj20Location[0]
gnssInfo.latitude = gcj20Location[1]
this.mGnssInfo = gnssBuilder.build()
this.mGnssInfo = gnssInfo
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onChassisLocationGCJ02(this.mGnssInfo)
// 获取数据监听需要的HZ
val hz = M_LISTENERS_HZ[tag]
if (hz != null && hz > 0) {
val hzTime = (1.0 / hz.toDouble()) * 1000
// 获取最后一次回调的时间
val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag]
if (hzLastSendTime != null && hzLastSendTime > 0) {
// 计算是否进入下一次回调周期
val nowTime = TimeUtils.getNowMills()
if (nowTime - hzLastSendTime > hzTime) {
syncLocationCallback(tag, it, gnssInfo, sourceType)
}
} else {
syncLocationCallback(tag, it, gnssInfo, sourceType)
}
} else {
syncLocationCallback(tag, it, gnssInfo, sourceType)
}
}
} ?: let {
Logger.e(TAG, "定位数据为Null")
}
}
/**
* 向订阅位置信息的发出定位信息
* @param tag
* @param it
* @param gnssInfo
* @param sourceType 数据来源
*/
private fun syncLocationCallback(
tag: String,
it: Map.Entry<String, IMoGoChassisLocationGCJ02Listener>,
mogoLocation: MogoLocation,
sourceType: DataSourceType
) {
// 记录最后一次回调时间
M_LISTENERS_HZ_LAST_SEND_TIME[tag] = TimeUtils.getNowMills()
val listener = it.value
listener.onChassisLocationGCJ02(mogoLocation)
}
}

View File

@@ -1,8 +1,10 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.telematics.pad.MessagePad
import com.mogo.eagle.core.utilcode.util.TimeUtils
/**
* @author xiaoyuzhou
@@ -12,24 +14,74 @@ import mogo.telematics.pad.MessagePad
object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocationWGS84Listener>() {
@Volatile
private var gnssInfo: MessagePad.GnssInfo? = null
private var gnssInfo: MogoLocation? = null
fun getChassisLocationWGS84(): MessagePad.GnssInfo? {
fun getChassisLocationWGS84(): MogoLocation? {
return gnssInfo
}
/**
* 添加监听并指定回掉频率
*/
fun addListener(
tag: String,
callBackHz: Int,
listener: IMoGoChassisLocationWGS84Listener
) {
addListener(tag, listener)
setListenerHz(tag, callBackHz)
}
/**
* 车辆定位 WGS84 坐标系-高精度坐标系 数据
* @param gnssInfo
*/
@Synchronized
fun invokeChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
fun invokeChassisLocationWGS84(gnssInfo: MogoLocation,sourceType: DataSourceType) {
this.gnssInfo = gnssInfo
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onChassisLocationWGS84(gnssInfo)
// 获取数据监听需要的HZ
val hz = M_LISTENERS_HZ[tag]
if (hz != null && hz > 0) {
val hzTime = (1.0 / hz.toDouble()) * 1000
// 获取最后一次回调的时间
val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag]
if (hzLastSendTime != null && hzLastSendTime > 0) {
// 计算是否进入下一次回调周期
val nowTime = TimeUtils.getNowMills()
if (nowTime - hzLastSendTime > hzTime) {
syncLocationCallback(tag, it, gnssInfo, sourceType)
}
} else {
syncLocationCallback(tag, it, gnssInfo, sourceType)
}
} else {
syncLocationCallback(tag, it, gnssInfo, sourceType)
}
}
}
/**
* 向订阅位置信息的发出定位信息
* @param tag
* @param it
* @param gnssInfo
* @param sourceType 数据来源
*/
private fun syncLocationCallback(
tag: String,
it: Map.Entry<String, IMoGoChassisLocationWGS84Listener>,
mogoLocation: MogoLocation,
sourceType: DataSourceType
) {
// 记录最后一次回调时间
M_LISTENERS_HZ_LAST_SEND_TIME[tag] = TimeUtils.getNowMills()
val listener = it.value
listener.onChassisLocationWGS84(mogoLocation)
}
}

View File

@@ -30,12 +30,14 @@ open class CallerBase<T : Any> {
/**
* 设置对应监听指定Hz频率
* @param tag 订阅者标记
* @param callBackHz 订阅者想要接受的回调的hz频率
*/
fun setListenerHz(tag: String, hz: Int) {
fun setListenerHz(tag: String, callBackHz: Int) {
if (M_LISTENERS_HZ.containsKey(tag)) {
return
}
M_LISTENERS_HZ[tag] = hz
M_LISTENERS_HZ[tag] = callBackHz
}
/**

View File

@@ -24,7 +24,6 @@ import com.zhidaoauto.map.sdk.open.tools.MapTools
import kotlinx.coroutines.*
import kotlinx.coroutines.android.asCoroutineDispatcher
import kotlinx.coroutines.internal.synchronized
import mogo.telematics.pad.MessagePad.GnssInfo
import java.util.*
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeUnit.SECONDS
@@ -65,7 +64,7 @@ object CallerVisualAngleManager {
val displayThreshold: Long //最大展示时长 > 0; 表示最长展示多长时间, -1 表示,一直展示,直到触发默认视角, 0: 默认视角专用值,
}
private val triggerLocation = AtomicReference<GnssInfo>()
private val triggerLocation = AtomicReference<MogoLocation>()
private val distanceOfCarToStopLine = AtomicReference(0.0)

View File

@@ -9,7 +9,7 @@ public class MogoLocationSource extends LocationServiceProvider {
@Override
public float getBearing() {
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
return MogoLocationInfoServices.getInstance().getLocation().getBearing();
return (float) MogoLocationInfoServices.getInstance().getLocation().getHeading();
}
return 0;
}
@@ -33,7 +33,7 @@ public class MogoLocationSource extends LocationServiceProvider {
@Override
public float getSpeed() {
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
return MogoLocationInfoServices.getInstance().getLocation().getSpeed();
return MogoLocationInfoServices.getInstance().getLocation().getGnssSpeed();
}
return 0;
}
@@ -81,7 +81,7 @@ public class MogoLocationSource extends LocationServiceProvider {
@Override
public long getTime() {
if (MogoLocationInfoServices.getInstance().getLocation() != null) {
return MogoLocationInfoServices.getInstance().getLocation().getTime();
return MogoLocationInfoServices.getInstance().getLocation().getSatelliteTime();
}
return 0;
}

View File

@@ -27,7 +27,7 @@ public class LocationUtils {
double carLat = carLocal.getLatitude();
double poiLon = pointLocal.getLon();
double poiLat = pointLocal.getLat();
float carAngle = carLocal.getBearing();
double carAngle = carLocal.getHeading();
// 计算车辆与点之间的夹角
int diffAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(

Some files were not shown because too many files have changed in this diff Show More