[Fix]解决单位改变导致的自动驾驶速度的设置问题

This commit is contained in:
chenfufeng
2022-03-31 14:21:29 +08:00
parent 401c92e4f9
commit b0c565e6ac
3 changed files with 7 additions and 1 deletions

View File

@@ -284,7 +284,7 @@ class MoGoAutopilotProvider :
}
override fun setAutoPilotSpeed(speed: Int): Boolean {
return AdasManager.getInstance().sendAutopilotSpeedReq(speed.toDouble())
return AdasManager.getInstance().sendAutopilotSpeedReq(speed/3.6)
}
override fun setIPCShutDown() {

View File

@@ -86,6 +86,9 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
*/
fun setEnableLog(isEnableLog: Boolean)
/**
* speed单位:km/h
*/
fun setAutoPilotSpeed(speed: Int): Boolean
/**

View File

@@ -95,6 +95,9 @@ object CallerAutoPilotManager {
providerApi?.setEnableLog(isEnableLog)
}
/**
* speed单位km/h
*/
fun setAutoPilotSpeed(speed: Int): Boolean {
return providerApi?.setAutoPilotSpeed(speed) ?: false
}