Merge remote-tracking branch 'origin/dev_robotaxi-d_240227_6.3.0' into dev_robotaxi-d_240227_6.3.0
This commit is contained in:
@@ -32,6 +32,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
@@ -69,6 +70,7 @@ import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
import com.mogo.och.common.module.utils.MultiRequestLimitChecker;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager;
|
||||
import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.och.common.module.utils.ToastUtilsOch;
|
||||
import com.mogo.och.common.module.voice.VoiceManager;
|
||||
@@ -151,7 +153,7 @@ public class OrderModel {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,10, mMapLocationListener);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,5, mMapLocationListener);
|
||||
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
@@ -384,13 +386,19 @@ public class OrderModel {
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
if (null == gnssInfo) return;
|
||||
Logger.d(TAG, "onChassisLocationGCJ02");
|
||||
if (mControllerStatusCallback != null) {
|
||||
mControllerStatusCallback.onCarLocationChanged(gnssInfo);
|
||||
}
|
||||
|
||||
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
|
||||
if (isGoingToNextStation && !isArrivedStation) {
|
||||
judgeArrivedStation(gnssInfo);
|
||||
OCHThreadPoolManager.getsInstance().locationExecute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
judgeArrivedStation(gnssInfo);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -61,6 +61,7 @@ import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceM
|
||||
import com.mogo.och.common.module.manager.loopmanager.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loopmanager.LoopInfo
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import com.mogo.och.common.module.utils.PinYinUtil
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
@@ -342,7 +343,7 @@ object BusPassengerModel {
|
||||
mMogoStatusChangedListener
|
||||
)
|
||||
// 定位监听
|
||||
addListener(TAG, 10, mMapLocationListener)
|
||||
addListener(TAG, 3, mMapLocationListener)
|
||||
|
||||
//监听司机端消息
|
||||
CallerTelematicListenerManager.addListener(TAG, mReceivedMsgListener)
|
||||
@@ -466,8 +467,10 @@ object BusPassengerModel {
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
if (null == mogoLocation) return
|
||||
mLocation = mogoLocation
|
||||
for (callback in mControllerStatusCallbackMap.values) {
|
||||
callback.onCarLocationChanged(mogoLocation)
|
||||
OCHThreadPoolManager.getsInstance().locationExecute {
|
||||
for (callback in mControllerStatusCallbackMap.values) {
|
||||
callback.onCarLocationChanged(mogoLocation)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.mogo.och.common.module.manager.distancemamager.IDistanceListener
|
||||
import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager
|
||||
import com.mogo.och.common.module.manager.loopmanager.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loopmanager.LoopInfo
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import kotlin.math.abs
|
||||
|
||||
/**
|
||||
@@ -108,7 +109,7 @@ class PM2DrivingModel private constructor() {
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
|
||||
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 10, mMapLocationListener)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, mMapLocationListener)
|
||||
|
||||
//司乘屏通信监听
|
||||
CallerTelematicListenerManager.addListener(TAG, mReceivedMsgListener)
|
||||
@@ -257,7 +258,9 @@ class PM2DrivingModel private constructor() {
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
if (null == mogoLocation) return
|
||||
mLocation = mogoLocation
|
||||
updateSpeed(mogoLocation)
|
||||
OCHThreadPoolManager.getsInstance().locationExecute {
|
||||
updateSpeed(mogoLocation)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ class DriverM1Model {
|
||||
fun init(context: Context) {
|
||||
mContext = context
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 10, mMapLocationListener)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 5, mMapLocationListener)
|
||||
|
||||
//开启自驾后 异常信息返回
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener)
|
||||
@@ -365,7 +365,9 @@ class DriverM1Model {
|
||||
|
||||
//是否到站的围栏判断 自动驾驶还未触发到站
|
||||
if (!isArrivedStation) {
|
||||
judgeArrivedStation(gnssInfo)
|
||||
OCHThreadPoolManager.getsInstance().locationExecute {
|
||||
judgeArrivedStation(gnssInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class CarStatusViewModel: ViewModel(), IMoGoAutopilotStatusListener,
|
||||
|
||||
fun setAutopilotStatusCallback(viewCallback:ICarStatusCallback){
|
||||
this.viewCallback = viewCallback
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(DriverM1Model.TAG, 10, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(DriverM1Model.TAG, 3, this)
|
||||
}
|
||||
|
||||
interface ICarStatusCallback{
|
||||
|
||||
@@ -24,7 +24,7 @@ class ItineraryViewModel : ViewModel(), IMoGoChassisLocationGCJ02Listener, IDist
|
||||
private var viewCallback: ItineraryViewCallback? = null
|
||||
|
||||
init {
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 4, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, this)
|
||||
CharterPassengerModel.setStationDistanceListener(TAG, this)
|
||||
CharterPassengerModel.setStatusChangeListener(TAG, this)
|
||||
}
|
||||
|
||||
@@ -134,6 +134,49 @@ public class OCHThreadPoolManager<T> {
|
||||
}
|
||||
}
|
||||
|
||||
//======================================================================================
|
||||
//=============== 位置坐标回调处理线程池 ==========
|
||||
//======================================================================================
|
||||
/**
|
||||
* 线程池的对象(高频坐标处理, keepAliveTime=30s, 等待队列容量=200, 异常处理机制=丢弃队列最前面的任务)
|
||||
*/
|
||||
private ThreadPoolExecutor locationExecutor;
|
||||
|
||||
/**
|
||||
* 开启一个无返回结果的线程
|
||||
*/
|
||||
public void locationExecute(Runnable r) {
|
||||
if (locationExecutor == null) {
|
||||
/*
|
||||
* corePoolSize:核心线程数
|
||||
* maximumPoolSize:线程池所容纳最大线程数(workQueue队列满了之后才开启)
|
||||
* keepAliveTime:非核心线程闲置时间超时时长
|
||||
* unit:keepAliveTime的单位
|
||||
* workQueue:等待队列,存储还未执行的任务
|
||||
* threadFactory:线程创建的工厂
|
||||
* handler:异常处理机制
|
||||
*
|
||||
*/
|
||||
locationExecutor = new ThreadPoolExecutor(CPU_COUNT + 1, CPU_COUNT * 2 + 1,
|
||||
30, TimeUnit.SECONDS, new ArrayBlockingQueue<>(200),
|
||||
Executors.defaultThreadFactory(), new ThreadPoolExecutor.DiscardOldestPolicy());
|
||||
}
|
||||
// 把一个任务丢到了线程池中
|
||||
try {
|
||||
locationExecutor.execute(r);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 把任务移除等待队列
|
||||
*/
|
||||
public void locationCancel(Runnable r) {
|
||||
if (r != null) {
|
||||
locationExecutor.getQueue().remove(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.mogo.och.common.module.bean.dpmsg.LoginCacheStatus;
|
||||
import com.mogo.och.common.module.bean.dpmsg.TaskDetailsMsg;
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
|
||||
import com.mogo.och.common.module.utils.MultiRequestLimitChecker;
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.data.SystemMsg;
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
@@ -131,7 +132,7 @@ public class OrderModel {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,10,mMapLocationListener);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,5,mMapLocationListener);
|
||||
|
||||
//开启自驾后 异常信息返回
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener);
|
||||
@@ -310,7 +311,12 @@ public class OrderModel {
|
||||
|
||||
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
|
||||
if (isGoingToNextStation && !isArrivedStation) {
|
||||
judgeArrivedStation(mogoLocation);
|
||||
OCHThreadPoolManager.getsInstance().locationExecute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
judgeArrivedStation(mogoLocation);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -342,7 +342,7 @@ public class BusPassengerModel {
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 10,mMapLocationListener);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 3,mMapLocationListener);
|
||||
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
|
||||
|
||||
@@ -107,7 +107,7 @@ class PM2DrivingModel private constructor() {
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
|
||||
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 10, mMapLocationListener)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, mMapLocationListener)
|
||||
|
||||
//司乘屏通信监听
|
||||
CallerTelematicListenerManager.addListener(TAG, mReceivedMsgListener)
|
||||
|
||||
@@ -54,6 +54,7 @@ import com.mogo.och.common.module.manager.distancemamager.ITrajectoryListener;
|
||||
import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager;
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager;
|
||||
import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.och.common.module.utils.ToastUtilsOch;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
@@ -222,7 +223,7 @@ public class TaxiModel {
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener);
|
||||
|
||||
//定位监听, 传false是高德坐标系
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,10, mMapLocationListener);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,5, mMapLocationListener);
|
||||
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
|
||||
@@ -1093,18 +1094,23 @@ public class TaxiModel {
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
//位置变化时,通过围栏判断是否到达x点
|
||||
if (null == gnssInfo) return;
|
||||
if (checkCurrentOCHOrder()) {
|
||||
if (getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToStart) {
|
||||
judgeStartStation(gnssInfo);
|
||||
}
|
||||
if (getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToEnd) {
|
||||
judgeEndStation(gnssInfo);
|
||||
}
|
||||
}
|
||||
OCHThreadPoolManager.getsInstance().locationExecute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (checkCurrentOCHOrder()) {
|
||||
if (getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToStart) {
|
||||
judgeStartStation(gnssInfo);
|
||||
}
|
||||
if (getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToEnd) {
|
||||
judgeEndStation(gnssInfo);
|
||||
}
|
||||
}
|
||||
|
||||
mLongitude = gnssInfo.getLongitude();
|
||||
mLatitude = gnssInfo.getLatitude();
|
||||
mLocation = gnssInfo;
|
||||
mLongitude = gnssInfo.getLongitude();
|
||||
mLatitude = gnssInfo.getLatitude();
|
||||
mLocation = gnssInfo;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class TaxiMapDirectionView @JvmOverloads constructor(
|
||||
initAMapView()
|
||||
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 10, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
|
||||
@@ -23,7 +23,7 @@ class SpeedViewModel: ViewModel(), IMoGoChassisLocationGCJ02Listener {
|
||||
fun setAutopilotStatusCallback(viewCallback: ISpeedCallback){
|
||||
this.viewCallback = viewCallback
|
||||
//定位监听, 传false是高德坐标系
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 10, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, this)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class SpeedView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
if(isVisible){
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 4, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, this)
|
||||
}else{
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class TaxiMapDirectionView @JvmOverloads constructor(
|
||||
initAMapView()
|
||||
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 10, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import com.mogo.och.taxi.bean.ContrailBean
|
||||
import com.mogo.och.taxi.bean.EndGrayContrailTaskReq
|
||||
import com.mogo.och.taxi.bean.EndGrayTaskFeedbackType
|
||||
@@ -144,52 +145,54 @@ object TaxiRoutingModel {
|
||||
if (null == currentLocation) return
|
||||
val endSite = currentGrayLineBean?.endSite ?: return
|
||||
|
||||
val endLon = endSite.gcjLon
|
||||
val endLat = endSite.gcjLat
|
||||
OCHThreadPoolManager.getsInstance().locationExecute {
|
||||
val endLon = endSite.gcjLon
|
||||
val endLat = endSite.gcjLat
|
||||
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
endLon,
|
||||
endLat,
|
||||
currentLocation.longitude,
|
||||
currentLocation.latitude
|
||||
).toDouble()
|
||||
CallerLogger.i(TAG, "judgeEndStation() distance = $distance")
|
||||
//1、当前位置和站点围栏15m内
|
||||
if (distance <= TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE) {
|
||||
//2、开始计算当前位置和站点的向量角度 < 90度 未经过 >90度 经过
|
||||
val stationAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
currentLocation.longitude,
|
||||
currentLocation.latitude,
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
endLon,
|
||||
endLat,
|
||||
currentLocation.heading.toInt()
|
||||
currentLocation.longitude,
|
||||
currentLocation.latitude
|
||||
).toDouble()
|
||||
CallerLogger.i(TAG, "judgeEndStation() stationAngle = $stationAngle")
|
||||
CallerLogger.i(TAG, "judgeEndStation() distance = $distance")
|
||||
//1、当前位置和站点围栏15m内
|
||||
if (distance <= TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE) {
|
||||
//2、开始计算当前位置和站点的向量角度 < 90度 未经过 >90度 经过
|
||||
val stationAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
currentLocation.longitude,
|
||||
currentLocation.latitude,
|
||||
endLon,
|
||||
endLat,
|
||||
currentLocation.heading.toInt()
|
||||
).toDouble()
|
||||
CallerLogger.i(TAG, "judgeEndStation() stationAngle = $stationAngle")
|
||||
|
||||
//3、刚过站且过站距离在15m内, 提交到站
|
||||
if (stationAngle > 90) {
|
||||
CallerLogger.i(TAG, "judgeEndStation() = 刚过站且在15m内")
|
||||
DebugView.printInfoMsg(
|
||||
"[自车定位围栏] 触发围栏, endSiteId=${currentGrayLineBean?.endSite?.siteId}, endSiteName=${currentGrayLineBean?.endSite?.siteName}, lineId=${currentGrayLineBean?.lineId},围栏范围:${TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE}米 刚过站且在15m内"
|
||||
)
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onGDMapArriveAtEndStation(currentGrayId)
|
||||
}
|
||||
} else {
|
||||
// 4、 没有过站距离小于15m 速度小于0.3(根据M1来的模数 可能要调)
|
||||
if (currentLocation.gnssSpeed < 0.3) {
|
||||
CallerLogger.i(
|
||||
TAG,
|
||||
"judgeEndStation() = 没有过站、速度基本为零且在15m内"
|
||||
)
|
||||
//3、刚过站且过站距离在15m内, 提交到站
|
||||
if (stationAngle > 90) {
|
||||
CallerLogger.i(TAG, "judgeEndStation() = 刚过站且在15m内")
|
||||
DebugView.printInfoMsg(
|
||||
"[自车定位围栏] 触发围栏, endSiteId=${currentGrayLineBean?.endSite?.siteId}, endSiteName=${currentGrayLineBean?.endSite?.siteName}, lineId=${currentGrayLineBean?.lineId},围栏范围:${TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE}米 没有过站、速度基本为零且在15m内"
|
||||
"[自车定位围栏] 触发围栏, endSiteId=${currentGrayLineBean?.endSite?.siteId}, endSiteName=${currentGrayLineBean?.endSite?.siteName}, lineId=${currentGrayLineBean?.lineId},围栏范围:${TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE}米 刚过站且在15m内"
|
||||
)
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onGDMapArriveAtEndStation(currentGrayId)
|
||||
}
|
||||
} else {
|
||||
// 4、 没有过站距离小于15m 速度小于0.3(根据M1来的模数 可能要调)
|
||||
if (currentLocation.gnssSpeed < 0.3) {
|
||||
CallerLogger.i(
|
||||
TAG,
|
||||
"judgeEndStation() = 没有过站、速度基本为零且在15m内"
|
||||
)
|
||||
DebugView.printInfoMsg(
|
||||
"[自车定位围栏] 触发围栏, endSiteId=${currentGrayLineBean?.endSite?.siteId}, endSiteName=${currentGrayLineBean?.endSite?.siteName}, lineId=${currentGrayLineBean?.lineId},围栏范围:${TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE}米 没有过站、速度基本为零且在15m内"
|
||||
)
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onGDMapArriveAtEndStation(currentGrayId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,7 +201,7 @@ object TaxiRoutingModel {
|
||||
|
||||
fun addGDMapCurrentLocationListener() {
|
||||
//定位监听, 传false是高德坐标系 10 -> 100ms一次
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 10, mMapLocationListener)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 5, mMapLocationListener)
|
||||
}
|
||||
|
||||
fun removeGDMapCurrentLocationListener() {
|
||||
|
||||
@@ -53,6 +53,7 @@ import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceM
|
||||
import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager.setStationPoint
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil.coordinateConverterWgsToGcjLocations
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import com.mogo.och.common.module.voice.VoiceNotice
|
||||
import com.mogo.och.taxi.bean.PrepareTaskRespBean
|
||||
import com.mogo.och.taxi.bean.QueryCarOrderByNoRespBean
|
||||
@@ -215,7 +216,7 @@ object TaxiTaskModel {
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mMogoAutopilotStatusListener)
|
||||
//定位监听, 传false是高德坐标系 10 -> 100ms一次
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 10, mMapLocationListener)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 5, mMapLocationListener)
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.addListener(TAG, mMogoAutopilotPlanningListener)
|
||||
//开启自驾后 异常信息返回
|
||||
@@ -416,17 +417,19 @@ object TaxiTaskModel {
|
||||
//位置变化时,通过围栏判断是否到达x点
|
||||
if (null == mogoLocation) return
|
||||
|
||||
if (mDriveToNearestStationTask != null) {
|
||||
judgeDriveToNearestStationTaskStation(mDriveToNearestStationTask, mogoLocation)
|
||||
}
|
||||
OCHThreadPoolManager.getsInstance().locationExecute {
|
||||
if (mDriveToNearestStationTask != null) {
|
||||
judgeDriveToNearestStationTaskStation(mDriveToNearestStationTask, mogoLocation)
|
||||
}
|
||||
|
||||
if (checkCurrentTaskCondition()
|
||||
&& QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder)
|
||||
) {
|
||||
judgeTaskEndSiteStation(mogoLocation)
|
||||
}
|
||||
if (checkCurrentTaskCondition()
|
||||
&& QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder)
|
||||
) {
|
||||
judgeTaskEndSiteStation(mogoLocation)
|
||||
}
|
||||
|
||||
mControllerStatusCallback?.onCarLocationChanged(mogoLocation)
|
||||
mControllerStatusCallback?.onCarLocationChanged(mogoLocation)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class SpeedView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
if(isVisible){
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 4, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, this)
|
||||
}else{
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user