[sweeper] fix: 子任务结束后 先取消自动驾驶;

This commit is contained in:
aibingbing
2023-03-15 17:10:01 +08:00
parent f4aa331934
commit 43e0764ed1

View File

@@ -10,6 +10,8 @@ import chassis.ChassisStatesOuterClass
import com.amap.api.maps.model.LatLng
import com.mogo.commons.AbsMogoApplication
import com.mogo.eagle.core.data.map.MogoLocation
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.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.ClickUtils
@@ -68,7 +70,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
sweeper_current_task_view.readyTaskBtn.setOnClickListener {
if (ClickUtils.isFastClick()) {//防止重复点击
if (mSubTaskType.code == SubTaskTypeEnum.MANUAL_DRIVING_SUBTYPE.code) {
manualDriving()
manualDriving(false)
} else {
//开始执行任务
mSubInfo?.apply {
@@ -293,7 +295,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
}
sweeper_current_task_view.setCurrentData(mCurrentSubPosition)
} else {
manualDriving()
manualDriving(true)
}
}
TaskStatusEnum.JUMP_OVER_SUBTASK.code -> { //子任务跳过
@@ -310,7 +312,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
}
sweeper_current_task_view.setCurrentData(mCurrentSubPosition)
} else {
manualDriving()
manualDriving(true)
}
}
TaskStatusEnum.START_SUBTASK.code -> { //子任务开始
@@ -404,7 +406,12 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
/**
* 人工驾驶子任务
*/
private fun manualDriving() {
private fun manualDriving(isCancelAutoPoilot: Boolean) {
if (isCancelAutoPoilot) { // 人工子任务 先取消自动驾驶
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(null)
CallerAutoPilotControlManager.cancelAutoPilot()
}
mSubInfo?.apply {
val builder = SweeperManualDrivingDialog.Builder()
val endConfirmDialog = builder