[Routing dev]
1、开发启动Routing自动驾驶的逻辑
This commit is contained in:
@@ -492,6 +492,7 @@ object TaxiRoutingModel {
|
||||
CallerLogger.e(TAG, "AutopilotControlParameters is empty.")
|
||||
return
|
||||
}
|
||||
parameters.isAutoRouting = true
|
||||
|
||||
OchAutoPilotManager.startAutoPilot(parameters);
|
||||
|
||||
|
||||
@@ -380,6 +380,11 @@ class MoGoAutopilotControlProvider :
|
||||
startAutoPilot(controlParameters, Constants.AUTOPILOT_SOURCE.MO_FANG)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 无参数启动自动驾驶,现在的调用方有:魔方
|
||||
* @param source 数据来源
|
||||
*/
|
||||
private fun startAutoPilotWithNoParameter(source: Int) {
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
val invokeResult = AdasManager.getInstance()
|
||||
@@ -396,15 +401,16 @@ class MoGoAutopilotControlProvider :
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun startAutoPilot(controlParameters: AutopilotControlParameters, source: Int) {
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
val invokeResult = AdasManager.getInstance()
|
||||
.sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), false)
|
||||
.sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), controlParameters.isAutoRouting)
|
||||
invokeAutoPilotResult(if (invokeResult > -1) "自动驾驶调用成功:${invokeResult}" else "自动驾驶调用失败, socket 或者 rawPack 可能为空")
|
||||
} else {
|
||||
if (AdasManager.getInstance().ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CONNECTED) {
|
||||
val invokeResult = AdasManager.getInstance()
|
||||
.sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), false)
|
||||
.sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo(), controlParameters.isAutoRouting)
|
||||
invokeAutoPilotResult(if (invokeResult > -1) "自动驾驶调用成功:${invokeResult}" else "自动驾驶调用失败, socket 或者 rawPack 可能为空")
|
||||
} else {
|
||||
invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶")
|
||||
@@ -440,11 +446,11 @@ class MoGoAutopilotControlProvider :
|
||||
)
|
||||
}
|
||||
|
||||
override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo) {
|
||||
override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo?) {
|
||||
AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine(),isAutoRouting,routeInfo)
|
||||
}
|
||||
|
||||
override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo) {
|
||||
override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo?) {
|
||||
AdasManager.getInstance().sendTrajectoryDownloadReq(
|
||||
autoPilotLine.toAutoPilotLine(),
|
||||
downloadType,
|
||||
|
||||
@@ -139,6 +139,8 @@ class AutopilotControlParameters {
|
||||
@JvmField
|
||||
var autoPilotLine: AutoPilotLine? = null // 自动驾驶路线
|
||||
|
||||
var isAutoRouting = false//是否进行自动算路,true--使用车端自动算路,false--不使用自动算路,使用轨迹循迹
|
||||
|
||||
class AutoPilotLine {
|
||||
var lineId = 0L
|
||||
var lineName = ""
|
||||
@@ -216,15 +218,20 @@ class AutopilotControlParameters {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "AutopilotControlParameters{" +
|
||||
"startName='" + startName + '\'' +
|
||||
", endName='" + endName + '\'' +
|
||||
", startLatLon=" + startLatLon +
|
||||
", wayLatLons=" + wayLatLons +
|
||||
", endLatLon=" + endLatLon +
|
||||
", speedLimit=" + speedLimit +
|
||||
", vehicleType=" + vehicleType +
|
||||
", isSpeakVoice=" + isSpeakVoice +
|
||||
'}'
|
||||
return "AutopilotControlParameters(" +
|
||||
"startName='$startName', " +
|
||||
"endName='$endName', " +
|
||||
"startLatLon=$startLatLon, " +
|
||||
"wayLatLons=$wayLatLons," +
|
||||
"endLatLon=$endLatLon," +
|
||||
"speedLimit=$speedLimit, " +
|
||||
"vehicleType=$vehicleType, " +
|
||||
"routeID=$routeID, " +
|
||||
"routeName='$routeName', " +
|
||||
"isSpeakVoice=$isSpeakVoice, " +
|
||||
"autoPilotLine=$autoPilotLine, " +
|
||||
"isAutoRouting=$isAutoRouting)"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -56,7 +56,7 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
|
||||
/**
|
||||
* 发送 轨迹下载请求
|
||||
*/
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo)
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo?)
|
||||
|
||||
/**
|
||||
* 发送 轨迹下载请求
|
||||
@@ -66,7 +66,7 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
|
||||
* @param isAutoRouting 20240523 是否进行自动算路
|
||||
* @param routeInfo 20240523 进行自动算路,务必下单时候携带自动驾驶路径信息,否则可不填!
|
||||
*/
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo)
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int, isAutoRouting: Boolean, routeInfo: MessagePad.RouteInfo?)
|
||||
/**
|
||||
* 结束自动驾驶
|
||||
*/
|
||||
|
||||
@@ -182,8 +182,8 @@ object CallerAutoPilotControlManager {
|
||||
*/
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
//TODO 需要传参 isAutoRouting, routeInfo
|
||||
// providerApi?.sendTrajectoryDownloadReq(autoPilotLine, isAutoRouting, routeInfo)
|
||||
//TODO Routing 需要传参 isAutoRouting, routeInfo
|
||||
providerApi?.sendTrajectoryDownloadReq(autoPilotLine, false, null)
|
||||
CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, 0)
|
||||
}
|
||||
}
|
||||
@@ -194,8 +194,8 @@ object CallerAutoPilotControlManager {
|
||||
*/
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
//TODO 需要传参 isAutoRouting, routeInfo
|
||||
// providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType, isAutoRouting, routeInfo)
|
||||
//TODO Routing 需要传参 isAutoRouting, routeInfo
|
||||
providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType, false, null)
|
||||
CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, downloadType)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user