This commit is contained in:
zhongchao
2022-03-14 14:11:29 +08:00
parent 3ffcb4bd27
commit d35700cb08
32 changed files with 332 additions and 1874 deletions

View File

@@ -1,28 +0,0 @@
package com.mogo.eagle.core.data.autopilot;
/**
* @author congtaowang
* @since 2020/10/22
*
* 域控制器 控制指令发送
*
*/
public class AutopilotControlCmdParameter {
public String action;
public Object result;
public AutopilotControlCmdParameter(String action, Object result) {
this.action = action;
this.result = result;
}
@Override
public String toString() {
return "AutoPilotControlCmdParameter{" +
"action='" + action + '\'' +
", result=" + result +
'}';
}
}

View File

@@ -1,79 +0,0 @@
package com.mogo.eagle.core.data.autopilot;
import java.util.List;
/**
* @author donghongyu
* @since 2021/09/22
* <p>
* 启动自动驾驶参数
* <p>
* {
* "action": "aiCloudToStartAutopilot",
* "result": {
* "endLatLon": {
* "lat": 40.2023065,
* "lon": 116.7328583
* },
* "isSpeakVoice": false,
* "speedLimit": 0.0,
* "startLatLon": {
* "lat": 40.20070823669507,
* "lon": 116.73264342448671
* },
* "startName": "HYKXC",
* "endName": "HYJC",
* "vehicleType": 10,
* "wayLatLons": null
* }
* }
*/
public class AutopilotControlParameters {
public String startName="";
public String endName="";
public AutoPilotLonLat startLatLon;
public List<AutoPilotLonLat> wayLatLons;
public AutoPilotLonLat endLatLon;
public float speedLimit;
public int vehicleType;// 运营类型
/**
* 是否播放adas的 开始自动驾驶 语音
*/
public boolean isSpeakVoice = true;
public static class AutoPilotLonLat {
public double lat;
public double lon;
public AutoPilotLonLat() {
}
public AutoPilotLonLat(double lat, double lon) {
this.lat = lat;
this.lon = lon;
}
@Override
public String toString() {
return "AutoPilotLonLat{" +
"lat=" + lat +
", lon=" + lon +
'}';
}
}
@Override
public String toString() {
return "AutopilotControlParameters{" +
"startName='" + startName + '\'' +
", endName='" + endName + '\'' +
", startLatLon=" + startLatLon +
", wayLatLons=" + wayLatLons +
", endLatLon=" + endLatLon +
", speedLimit=" + speedLimit +
", vehicleType=" + vehicleType +
", isSpeakVoice=" + isSpeakVoice +
'}';
}
}

View File

@@ -0,0 +1,116 @@
package com.mogo.eagle.core.data.autopilot
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
import mogo.telematics.pad.MessagePad
/**
* @author donghongyu
* @since 2021/09/22
*
*
* 启动自动驾驶参数
*
*
* {
* "action": "aiCloudToStartAutopilot",
* "result": {
* "endLatLon": {
* "lat": 40.2023065,
* "lon": 116.7328583
* },
* "isSpeakVoice": false,
* "speedLimit": 0.0,
* "startLatLon": {
* "lat": 40.20070823669507,
* "lon": 116.73264342448671
* },
* "startName": "HYKXC",
* "endName": "HYJC",
* "vehicleType": 10,
* "wayLatLons": null
* }
* }
*/
fun AutopilotControlParameters.toRouteInfo(): MessagePad.RouteInfo{
val routeInfo = MessagePad.RouteInfo.newBuilder()
val startLoc = routeInfo.startLocationBuilder
val endLoc = routeInfo.endLocationBuilder
this.startLatLon?.let {
startLoc.latitude = it.lat
startLoc.longitude = it.lon
}
this.endLatLon?.let {
endLoc.latitude = it.lat
endLoc.longitude = it.lon
}
this.wayLatLons?.forEach {
val locBuilder = MessagePad.Location.newBuilder()
locBuilder.latitude = it.lat
locBuilder.longitude = it.lon
routeInfo.addWayPoints(locBuilder.build())
}
routeInfo.startName = this.startName
routeInfo.endName = this.endName
routeInfo.vehicleType = this.vehicleType
routeInfo.isSpeakVoice = this.isSpeakVoice
routeInfo.speedLimit = this.speedLimit.toDouble()
routeInfo.startLocation = startLoc.build()
routeInfo.endLocation = endLoc.build()
return routeInfo.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
/**
* 是否播放adas的 开始自动驾驶 语音
*/
@JvmField
var isSpeakVoice = true
class AutoPilotLonLat {
var lat = 0.0
var lon = 0.0
constructor() {}
constructor(lat: Double, lon: Double) {
this.lat = lat
this.lon = lon
}
override fun toString(): String {
return "AutoPilotLonLat{" +
"lat=" + lat +
", lon=" + lon +
'}'
}
}
override fun toString(): String {
return "AutopilotControlParameters{" +
"startName='" + startName + '\'' +
", endName='" + endName + '\'' +
", startLatLon=" + startLatLon +
", wayLatLons=" + wayLatLons +
", endLatLon=" + endLatLon +
", speedLimit=" + speedLimit +
", vehicleType=" + vehicleType +
", isSpeakVoice=" + isSpeakVoice +
'}'
}
}

View File

@@ -4,20 +4,22 @@ class SceneConstant {
companion object {
//lib包
const val M_ADAS = "lib-mogo-adas_"
const val M_ADAS = "LIB-ADAS_"
//核心module
const val M_NETWORK = "core-network_"
const val M_NETWORK = "CORE-NETWORK_"
//core业务module
const val M_DEVA = "core-impl-deva_"
const val M_OBU = "core-impl-obu_"
const val M_DISPATCH = "core-impl-dispatch_"
const val M_V2X = "core-impl-v2x_"
const val M_HMI = "core-impl-hmi_"
const val M_ADAS_IMPL = "CORE-ADAS_"
const val M_CHAT = "CORE-CHAT_"
const val M_DEVA = "CORE-DEVA_"
const val M_DISPATCH = "CORE-DISPATCH_"
const val M_HMI = "CORE-HMI_"
const val M_OBU = "CORE-OBU_"
const val M_V2X = "CORE-V2X_"
//旧module
const val M_ROUTE = "old-module-service_"
const val M_OTHER = "all-modules_"
const val M_ROUTE = "OLD-MODULE-SERVICE_"
const val M_OTHER = "ALL-MODULES_"
}
}

View File

@@ -1,5 +1,7 @@
package com.mogo.eagle.core.data.trafficlight
import mogo.telematics.pad.MessagePad
fun TrafficLightResult.currentRoadTrafficLight(): TrafficLightStatus? {
return TrafficLightStatusHelper.getCurrentRoadTrafficLight(this)
}
@@ -8,6 +10,23 @@ fun TrafficLightResult.currentRoadIsRight():Boolean{
return TrafficLightStatusHelper.currentRoadIsRight(this)
}
fun TrafficLightResult.toTrafficLightDetail():MessagePad.TrafficLightDetail{
val trafficLightBuilder = MessagePad.TrafficLightDetail.newBuilder()
val left = trafficLightBuilder.leftBuilder
val mid = trafficLightBuilder.midBuilder
val right = trafficLightBuilder.rightBuilder
left.phaseNo = this.laneList.left.phaseNo
left.color = this.laneList.left.color
left.remain = this.laneList.left.remain
mid.phaseNo = this.laneList.mid.phaseNo
mid.color = this.laneList.mid.color
mid.remain = this.laneList.mid.remain
right.phaseNo = this.laneList.right.phaseNo
right.color = this.laneList.right.color
right.remain = this.laneList.right.remain
return trafficLightBuilder.build()
}
/**
* 路口红绿灯请求返回数据
*/