「Change」

1、增加启动自动驾驶时传入 AutoPilotLine 数据更新路线
2、增加轨迹下发请求CallerAutoPilotManager.sendTrajectoryDownloadReq(AutoPilotLine)

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2022-06-07 17:38:42 +08:00
parent c2de7226a6
commit a4e4300bfc
3 changed files with 80 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.autopilot.toAutoPilotLine
import com.mogo.eagle.core.data.autopilot.toRouteInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MoGoConfig
@@ -262,6 +263,10 @@ class MoGoAutopilotProvider :
)
}
override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) {
AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine())
}
override fun cancelAutoPilot() {
if (AdasManager.getInstance().ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
AdasManager.getInstance().sendAutoPilotModeReq(0, 1, null)

View File

@@ -1,10 +1,9 @@
package com.mogo.eagle.core.data.autopilot
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
import mogo.telematics.pad.MessagePad
/**
* @author donghongyu
* @author donghongyuO
* @since 2021/09/22
*
*
@@ -32,7 +31,7 @@ import mogo.telematics.pad.MessagePad
* }
*/
fun AutopilotControlParameters.toRouteInfo(): MessagePad.RouteInfo{
fun AutopilotControlParameters.toRouteInfo(): MessagePad.RouteInfo {
val routeInfo = MessagePad.RouteInfo.newBuilder()
val startLoc = routeInfo.startLocationBuilder
val endLoc = routeInfo.endLocationBuilder
@@ -61,27 +60,61 @@ fun AutopilotControlParameters.toRouteInfo(): MessagePad.RouteInfo{
routeInfo.speedLimit = this.speedLimit.toDouble()
routeInfo.startLocation = startLoc.build()
routeInfo.endLocation = endLoc.build()
val line = MessagePad.Line.newBuilder()
this.autoPilotLine?.let {
line.lineId = it.lineId
line.trajMd5 = it.trajMd5
line.trajUrl = it.trajUrl
line.stopMd5 = it.stopMd5
line.stopUrl = it.stopUrl
line.timestamp = it.timestamp
line.setVehicleModel(it.vehicleModel)
}
routeInfo.line = line.build()
return routeInfo.build()
}
fun AutopilotControlParameters.AutoPilotLine.toAutoPilotLine(): MessagePad.Line {
val line = MessagePad.Line.newBuilder()
line.lineId = this.lineId
line.trajMd5 = this.trajMd5
line.trajUrl = this.trajUrl
line.stopMd5 = this.stopMd5
line.stopUrl = this.stopUrl
line.timestamp = this.timestamp
line.vehicleModel = this.vehicleModel
return line.build()
}
class AutopilotControlParameters {
@JvmField
var startName = ""
@JvmField
var endName = ""
@JvmField
var startLatLon: AutoPilotLonLat? = null
@JvmField
var wayLatLons: List<AutoPilotLonLat>? = null
@JvmField
var endLatLon: AutoPilotLonLat? = null
var speedLimit = 0f
@JvmField
var vehicleType // 运营类型
= 0
var speedLimit = 0f
@JvmField
var vehicleType = 0// 运营类型
@JvmField
var routeID = 0 //线路idbus用
@JvmField
var routeName = "" //线路名称bus用
@@ -91,6 +124,37 @@ class AutopilotControlParameters {
@JvmField
var isSpeakVoice = true
@JvmField
var autoPilotLine: AutoPilotLine? = null // 自动驾驶路线
class AutoPilotLine {
var lineId = 0L
var trajUrl = ""
var trajMd5 = ""
var stopUrl = ""
var stopMd5 = ""
var timestamp = 0L
var vehicleModel = ""
constructor(lineId: Long, trajUrl: String,
trajMd5: String, stopUrl: String,
stopMd5: String, timestamp: Long,
vehicleModel: String) {
this.lineId = lineId
this.trajUrl = trajUrl
this.trajMd5 = trajMd5
this.stopUrl = stopUrl
this.stopMd5 = stopMd5
this.timestamp = timestamp
this.vehicleModel = vehicleModel
}
override fun toString(): String {
return "AutoPilotLine(lineId=$lineId, trajUrl='$trajUrl', trajMd5='$trajMd5', stopUrl='$stopUrl', stopMd5='$stopMd5', timestamp=$timestamp, vehicleModel='$vehicleModel')"
}
}
class AutoPilotLonLat {
var lat = 0.0
var lon = 0.0

View File

@@ -34,6 +34,11 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
*/
fun sendTrafficLightData(trafficLightResult: TrafficLightResult)
/**
* 发送 轨迹下载请求
*/
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine)
/**
* 结束自动驾驶
*/