[fea]
[driver]
[启动自驾添加startPosType参数]
This commit is contained in:
yangyakun
2025-01-06 10:46:38 +08:00
parent 8997550c18
commit 93121ec923
3 changed files with 15 additions and 5 deletions

View File

@@ -44,9 +44,9 @@ import kotlin.properties.Delegates
object LineManager : CallerBase<ILineCallback>() {
const val TAG = M_OCHCOMMON+"LineManager"
const val firstStationFirstStartAutopilotFlag = 1
const val middleStationFirstStartAutopilotFlag = 2
const val norFirstStartAutopilotFlag = 3
const val firstStationFirstStartAutopilotFlag = 0
const val middleStationFirstStartAutopilotFlag = 1
const val norFirstStartAutopilotFlag = 2
/**
* 线路信息
@@ -393,6 +393,7 @@ object LineManager : CallerBase<ILineCallback>() {
parameters?.endLatLon = AutoPilotLonLat(end.lat, end.lon)
parameters?.vehicleType = 10
parameters?.orderId = this.teleOrderId
parameters?.firstStationFlag = autopilotFlag
parameters?.firstAutopilotFlag = teleIsFirstStartAutopilot
if (parameters?.autoPilotLine == null) {

View File

@@ -411,15 +411,20 @@ class MoGoAutopilotControlProvider :
}
private fun startAutoPilot(controlParameters: AutopilotControlParameters, source: Int): Long {
val startPosType = if(controlParameters.firstStationFlag==null){
null
}else{
MessagePad.StartPosType.forNumber(controlParameters.firstStationFlag!!)
}
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
val invokeResult = AdasManager.getInstance()
.sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), controlParameters.toAutoPilotCmdInfo(), null)
.sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), controlParameters.toAutoPilotCmdInfo(), startPosType)
invokeAutoPilotResult(if (invokeResult > -1) "自动驾驶调用成功:${invokeResult}" else "自动驾驶调用失败, socket 或者 rawPack 可能为空")
return invokeResult
} else {
if (AdasManager.getInstance().ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CONNECTED) {
val invokeResult = AdasManager.getInstance()
.sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), controlParameters.toAutoPilotCmdInfo(), null)
.sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), controlParameters.toAutoPilotCmdInfo(), startPosType)
invokeAutoPilotResult(if (invokeResult > -1) "自动驾驶调用成功:${invokeResult}" else "自动驾驶调用失败, socket 或者 rawPack 可能为空")
return invokeResult
} else {

View File

@@ -166,6 +166,9 @@ class AutopilotControlParameters {
@JvmField
var orderId = ""//订单号
@JvmField
var firstStationFlag: Int? = null
class AutoPilotLine {
var lineId = 0L
@@ -284,6 +287,7 @@ class AutopilotControlParameters {
"isSpeakVoice=$isSpeakVoice, " +
"orderId=$orderId, " +
"firstAutopilotFlag=$firstAutopilotFlag, " +
"firstStationFlag=$firstStationFlag, " +
"autoPilotLine=$autoPilotLine)"
}