Merge branch 'dev_trajectory_from270' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_trajectory_from270

This commit is contained in:
xinfengkun
2022-06-07 18:26:08 +08:00
4 changed files with 87 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.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters 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.autopilot.toRouteInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MoGoConfig 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() { override fun cancelAutoPilot() {
if (AdasManager.getInstance().ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) { if (AdasManager.getInstance().ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
AdasManager.getInstance().sendAutoPilotModeReq(0, 1, null) AdasManager.getInstance().sendAutoPilotModeReq(0, 1, null)

View File

@@ -1,10 +1,9 @@
package com.mogo.eagle.core.data.autopilot package com.mogo.eagle.core.data.autopilot
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
import mogo.telematics.pad.MessagePad import mogo.telematics.pad.MessagePad
/** /**
* @author donghongyu * @author donghongyuO
* @since 2021/09/22 * @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 routeInfo = MessagePad.RouteInfo.newBuilder()
val startLoc = routeInfo.startLocationBuilder val startLoc = routeInfo.startLocationBuilder
val endLoc = routeInfo.endLocationBuilder val endLoc = routeInfo.endLocationBuilder
@@ -61,27 +60,61 @@ fun AutopilotControlParameters.toRouteInfo(): MessagePad.RouteInfo{
routeInfo.speedLimit = this.speedLimit.toDouble() routeInfo.speedLimit = this.speedLimit.toDouble()
routeInfo.startLocation = startLoc.build() routeInfo.startLocation = startLoc.build()
routeInfo.endLocation = endLoc.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() 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 { class AutopilotControlParameters {
@JvmField @JvmField
var startName = "" var startName = ""
@JvmField @JvmField
var endName = "" var endName = ""
@JvmField @JvmField
var startLatLon: AutoPilotLonLat? = null var startLatLon: AutoPilotLonLat? = null
@JvmField @JvmField
var wayLatLons: List<AutoPilotLonLat>? = null var wayLatLons: List<AutoPilotLonLat>? = null
@JvmField @JvmField
var endLatLon: AutoPilotLonLat? = null var endLatLon: AutoPilotLonLat? = null
var speedLimit = 0f
@JvmField @JvmField
var vehicleType // 运营类型 var speedLimit = 0f
= 0
@JvmField
var vehicleType = 0// 运营类型
@JvmField @JvmField
var routeID = 0 //线路idbus用 var routeID = 0 //线路idbus用
@JvmField @JvmField
var routeName = "" //线路名称bus用 var routeName = "" //线路名称bus用
@@ -91,6 +124,37 @@ class AutopilotControlParameters {
@JvmField @JvmField
var isSpeakVoice = true 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 { class AutoPilotLonLat {
var lat = 0.0 var lat = 0.0
var lon = 0.0 var lon = 0.0

View File

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

View File

@@ -72,6 +72,13 @@ object CallerAutoPilotManager {
providerApi?.sendTrafficLightData(trafficLightResult) providerApi?.sendTrafficLightData(trafficLightResult)
} }
/**
* 发送 轨迹下载请求
*/
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) {
providerApi?.sendTrajectoryDownloadReq(autoPilotLine)
}
/** /**
* 结束自动驾驶 * 结束自动驾驶
*/ */