[Change]
增加了模拟开启自动驾驶,方便调试,但需要工控机支持 TODO 下周考虑自己维护状态数据 Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -203,4 +203,17 @@ class MoGoAutopilotProvider :
|
||||
AdasManager.getInstance().disableDemoMode()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 办公室调试使用,强制开启自动驾驶,将 status,pilotmode,control_pilotmode,强追设置为 1
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
*/
|
||||
override fun setControlAutopilotCarAuto(isEnable: Boolean) {
|
||||
if (isEnable) {
|
||||
AdasManager.getInstance().controlAutopilotCarAuto()
|
||||
} else {
|
||||
AdasManager.getInstance().controlAutopilotCarHead()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -304,6 +304,11 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
SharedPrefsMgr.getInstance(context).putBoolean(MoGoConfig.IS_DEMO_MODE, isChecked)
|
||||
}
|
||||
|
||||
// 模拟自动驾驶中
|
||||
tbChangeAutoPilotStatus.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
CallerAutoPilotManager.setControlAutopilotCarAuto(isChecked)
|
||||
}
|
||||
|
||||
tbSelfLog.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if (isChecked) {
|
||||
LogUtils.getConfig().isLogSwitch = false
|
||||
|
||||
@@ -244,6 +244,16 @@
|
||||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_start">
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbChangeAutoPilotStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:textOff="开启模拟自动驾驶中"
|
||||
android:textOn="关闭模拟自动驾驶中"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbIsDrawIdentifyData"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -117,4 +117,12 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
|
||||
* isEnable = false 关闭
|
||||
*/
|
||||
fun setDemoMode(isEnable: Boolean)
|
||||
|
||||
/**
|
||||
* 办公室调试使用,强制开启自动驾驶,将 status,pilotmode,control_pilotmode,强追设置为 1
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
*/
|
||||
fun setControlAutopilotCarAuto(isEnable: Boolean)
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import kotlin.random.Random
|
||||
|
||||
/**
|
||||
@@ -120,4 +119,13 @@ object CallerAutoPilotManager {
|
||||
fun setDemoMode(isEnable: Boolean) {
|
||||
providerApi?.setDemoMode(isEnable)
|
||||
}
|
||||
|
||||
/**
|
||||
* 办公室调试使用,强制开启自动驾驶,将 status,pilotmode,control_pilotmode,强追设置为 1
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
*/
|
||||
fun setControlAutopilotCarAuto(isEnable: Boolean) {
|
||||
providerApi?.setControlAutopilotCarAuto(isEnable)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user