[dev_arch_opt_3.0]

[Change]
[1、分离工控机引导线、全路径规划]

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2023-01-05 18:17:27 +08:00
parent 6740a518b4
commit 5fcc0f42ea
18 changed files with 154 additions and 173 deletions

View File

@@ -10,13 +10,13 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener
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.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -30,8 +30,10 @@ import mogo.telematics.pad.MessagePad
//负责监听自动驾驶状态并进行状态上报,自动驾驶路线上报,接收调度指令展示指令弹窗
class DispatchAutoPilotManager private constructor() :
IMogoOnMessageListener<DispatchAdasAutoPilotLocReceiverBean>, IMoGoCheckAutoPilotBtnListener,
IMoGoAutopilotPlanningListener, IMoGoAutopilotStatusListener {
IMogoOnMessageListener<DispatchAdasAutoPilotLocReceiverBean>,
IMoGoCheckAutoPilotBtnListener,
IMoGoPlanningRottingListener,
IMoGoAutopilotStatusListener {
companion object {
private const val TAG = "DispatchAutoPilotManager"
@@ -77,7 +79,7 @@ class DispatchAutoPilotManager private constructor() :
// 添加自动驾驶按钮选中监听
CallerHmiListenerManager.addListener(TAG, this)
// 添加 规划路径相关回调 监听
CallerAutopilotPlanningListenerManager.addListener(TAG, this)
CallerPlanningRottingListenerManager.addListener(TAG, this)
// 添加 ADAS状态 监听
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
handler.sendEmptyMessageDelayed(MSG_TYPE_UPLOAD_AUTOPILOT_STATUS, 1000L)
@@ -87,7 +89,7 @@ class DispatchAutoPilotManager private constructor() :
// 添加自动驾驶按钮选中监听
CallerHmiListenerManager.removeListener(TAG)
// 添加 规划路径相关回调 监听
CallerAutopilotPlanningListenerManager.removeListener(TAG)
CallerPlanningRottingListenerManager.removeListener(TAG)
// 添加 ADAS状态 监听
CallerAutoPilotStatusListenerManager.removeListener(TAG)
}

View File

@@ -42,11 +42,11 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListen
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyPlanningObj
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotWarnMessage
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningActionsListenerManager.invokePNCActions
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotRotting
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotTrajectory
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.CallerPlanningRottingListenerManager.invokeAutopilotRotting
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager.invokeAutopilotTrajectory
import com.mogo.eagle.core.function.call.autopilot.CallerStartAutopilotFailedListenerManager.invokeStartAutopilotFailed
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger

View File

@@ -104,7 +104,8 @@ class DebugSettingView @JvmOverloads constructor(
IMoGoAutopilotCarStateListener,
IMoGoMapLocationListener,
IMoGoAutopilotIdentifyListener,
IMoGoAutopilotPlanningListener,
IMoGoPlanningRottingListener,
IMoGoPlanningTrajectoryListener,
IMoGoAutopilotVehicleStateListener,
IMoGoDevaToolsFuncConfigListener,
IMoGoChassisLamplightListener,
@@ -198,7 +199,8 @@ class DebugSettingView @JvmOverloads constructor(
// 添加 域控制器感知数据 监听
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
// 添加 规划路径相关回调 监听
CallerAutopilotPlanningListenerManager.addListener(TAG, this)
CallerPlanningRottingListenerManager.addListener(TAG, this)
CallerPlanningTrajectoryListenerManager.addListener(TAG, this)
//添加 车辆底盘数据回调 监听
CallerAutopilotVehicleStateListenerManager.addListener(TAG, this)
//添加 开发套件工具接口 监听
@@ -235,7 +237,8 @@ class DebugSettingView @JvmOverloads constructor(
// 移除 域控制器感知数据 监听
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
// 移除 规划路径相关回调 监听
CallerAutopilotPlanningListenerManager.removeListener(TAG)
CallerPlanningRottingListenerManager.removeListener(TAG)
CallerPlanningTrajectoryListenerManager.removeListener(TAG)
// 移除 车辆底盘数据回调 监听
CallerAutopilotVehicleStateListenerManager.removeListener(TAG)
// 移除 开发套件工具接口 监听

View File

@@ -5,14 +5,15 @@ import androidx.annotation.NonNull;
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.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningTrajectoryListener;
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import org.jetbrains.annotations.NotNull;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -23,7 +24,9 @@ import mogo_msg.MogoReportMsg;
import system_master.SystemStatusInfo;
public class MogoRouteOverlayManager implements
IMoGoAutopilotPlanningListener, IMoGoAutopilotStatusListener, IMoGoMapLocationListener {
IMoGoPlanningTrajectoryListener,
IMoGoAutopilotStatusListener,
IMoGoMapLocationListener {
private static volatile MogoRouteOverlayManager sInstance;
private static final String TAG = "Route";
@@ -36,7 +39,7 @@ public class MogoRouteOverlayManager implements
public void init() {
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, this);
CallerPlanningTrajectoryListenerManager.INSTANCE.addListener(TAG, this);
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this, false);
}
@@ -84,10 +87,6 @@ public class MogoRouteOverlayManager implements
}
}
@Override
public void onAutopilotRotting(MessagePad.GlobalPathResp globalPathResp) {}
@Override
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autoPilotStatusInfo) {
int mode = autoPilotStatusInfo.getPilotmode();

View File

@@ -12,13 +12,13 @@ import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
import com.mogo.eagle.core.data.map.CenterLine;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
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;
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber;
import com.mogo.eagle.core.function.business.MapPointCloudSubscriber;
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.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
import com.mogo.eagle.core.function.overview.InfStructureManager;
@@ -33,8 +33,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.zhidaoauto.map.sdk.open.MapAutoApi;
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper;
import java.util.List;
import mogo.telematics.pad.MessagePad;
/**
@@ -96,7 +94,7 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
}
// 添加换肤监听
CallerSkinModeListenerManager.INSTANCE.addListener(TAG, this);
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
}
@NonNull
@@ -214,7 +212,7 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
viewModel.fetchInfStructures();
}
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener() {
private final IMoGoPlanningRottingListener moGoAutopilotPlanningListener = new IMoGoPlanningRottingListener() {
@Override
public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp globalPathResp) {
@@ -223,8 +221,6 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
});
}
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {}
};
@Override
@@ -235,7 +231,7 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
@Override
public void onDestroyView() {
CallerSkinModeListenerManager.INSTANCE.removeListener(TAG);
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(TAG);
CallerPlanningRottingListenerManager.INSTANCE.removeListener(TAG);
if (mMogoMapView != null) {
mMogoMapView.onDestroy();
mMogoMapView = null;

View File

@@ -32,9 +32,9 @@ 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.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.function.map.R;
@@ -45,8 +45,6 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -132,7 +130,7 @@ public class AMapCustomView
arrivedBitmap = BitmapDescriptorFactory.fromResource(R.drawable.arrow_arrived_img);
unArrivedBitmap = BitmapDescriptorFactory.fromResource(R.drawable.amap_bus_smooth_route);
}
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
initAMapView(context);
// 注册定位监听
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this, false);
@@ -217,12 +215,7 @@ public class AMapCustomView
.icon(BitmapDescriptorFactory.fromResource(R.drawable.module_small_map_view_dir_end)));
}
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener() {
@Override
public void onAutopilotTrajectory(@NotNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
Log.d(TAG, "onAutopilotTrajectory");
}
private final IMoGoPlanningRottingListener moGoAutopilotPlanningListener = new IMoGoPlanningRottingListener() {
/**
* 根据全路径获取起始点和经停点进行导航路线绘制
@@ -308,7 +301,7 @@ public class AMapCustomView
super.onDetachedFromWindow();
// 注册定位监听
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG, false);
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(TAG);
CallerPlanningRottingListenerManager.INSTANCE.removeListener(TAG);
}
@Override

View File

@@ -15,7 +15,6 @@ 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.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.function.overview.InfStructureManager;
import com.mogo.eagle.core.function.overview.ViewModelExtKt;
@@ -160,6 +159,5 @@ public class OverviewMapFragment extends BaseFragment
if (mAMapCustomView != null) {
mAMapCustomView.onDestroy();
}
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(TAG);
}
}

View File

@@ -12,11 +12,11 @@ import com.mogo.commons.mvp.BaseFragment;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
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.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -35,7 +35,8 @@ import system_master.SystemStatusInfo;
*/
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_SMP)
public class SmallMapFragment extends BaseFragment
implements IMogoSmallMapProvider, IMoGoAutopilotPlanningListener,
implements IMogoSmallMapProvider,
IMoGoPlanningRottingListener,
IMoGoAutopilotStatusListener {
private final String TAG = "SmallMapFragment";
protected SmallMapDirectionView mSmallMapDirectionView;
@@ -65,7 +66,7 @@ public class SmallMapFragment extends BaseFragment
super.initViews(savedInstanceState);
mSmallMapDirectionView = mRootView.findViewById(R.id.smallMapDirectionView);
mSmallMapDirectionView.onCreateView(savedInstanceState);
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, this);
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, this);
}
@Override
@@ -120,12 +121,7 @@ public class SmallMapFragment extends BaseFragment
if (mSmallMapDirectionView != null) {
mSmallMapDirectionView.onDestroy();
}
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(TAG);
}
@Override
public void onAutopilotTrajectory(List<MessagePad.TrajectoryPoint> trajectoryInfos) {
CallerPlanningRottingListenerManager.INSTANCE.removeListener(TAG);
}
@Override