「Change」
1、增加启动自动驾驶时传入 AutoPilotLine 数据更新路线 2、增加轨迹下发请求CallerAutoPilotManager.sendTrajectoryDownloadReq(AutoPilotLine) Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -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 //线路id(bus用)
|
||||
|
||||
@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
|
||||
|
||||
Reference in New Issue
Block a user