[3.3.0] fix bug of request global path

This commit is contained in:
zhongchao
2023-06-28 22:01:34 +08:00
parent ea8a15c922
commit 6c28f9031f
2 changed files with 55 additions and 43 deletions

View File

@@ -41,22 +41,23 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen
}
override fun onAutopilotStatusResponse(state: Int) {
bizLog(SceneConstant.M_D_C + TAG, "自动驾驶状态变化:$state,准备请求全局路线")
createSubscribe?.let {
if (!it.isDisposed) {
bizLog(SceneConstant.M_D_C + TAG, "自动驾驶状态变化取消前置轨迹请求间隔2s重新请求底盘轨迹")
createSubscribe?.dispose()
}
when (state) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
createSubscribe = Observable.timer(2000L, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
bizLog(SceneConstant.M_D_C + TAG, "请求底盘轨迹")
CallerAutoPilotControlManager.getGlobalPath()
}
}
else -> {}
}
when (state) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
createSubscribe = Observable.timer(2000L, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
bizLog(SceneConstant.M_D_C + TAG, "请求底盘轨迹")
CallerAutoPilotControlManager.getGlobalPath()
}
}
else -> {}
}
}