@@ -0,0 +1,75 @@
|
||||
package com.mogo.eagle.core.function.autopilot
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlCmdParameter
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/9/22 8:43 下午
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_AUTO_PILOT)
|
||||
class MoGoAutopilotProvider :
|
||||
IMoGoAutopilotProvider {
|
||||
private val TAG = "MoGoAutoPilotProvider"
|
||||
|
||||
override val functionName: String
|
||||
get() = TAG
|
||||
|
||||
|
||||
override fun init(context: Context) {
|
||||
// 初始化ADAS 域控制器
|
||||
//AdasManager.getInstance().create(context)
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun connectAutoPilot() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun startAutoPilot(result: AutopilotControlParameters) {
|
||||
if (AdasManager.getInstance().isSocketConnect) {
|
||||
val parameter =
|
||||
AutopilotControlCmdParameter(
|
||||
TAG,
|
||||
result
|
||||
)
|
||||
AdasManager.getInstance().aiCloudToAdasData(GsonUtils.toJson(parameter))
|
||||
} else {
|
||||
LogUtils.eTag(TAG, "车机与工控机链接失败,无法开启自动驾驶")
|
||||
}
|
||||
}
|
||||
|
||||
override fun cancelAutoPilot() {
|
||||
if (AdasManager.getInstance().isSocketConnect) {
|
||||
AdasManager.getInstance().controlAutopilotCarHead()
|
||||
} else {
|
||||
LogUtils.eTag(TAG, "车机与工控机链接失败,无法断开自动驾驶")
|
||||
}
|
||||
}
|
||||
|
||||
override fun getAutopilotStatus(): Int {
|
||||
// int status = IMoGoAutoPilotStatusListener.STATUS_AUTOPILOT_DISABLE;
|
||||
// try {
|
||||
// status = adasProvider.autopilotStateCall().getState();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
override fun recordPackage(): Boolean {
|
||||
return AdasManager.getInstance().recordPackage()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.eagle.core.function.autopilot.utils
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/10/18 1:32 下午
|
||||
*/
|
||||
class AdasObjectConvertUtils {
|
||||
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.data.autopilot.*
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
@@ -38,7 +38,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
|
||||
IMoGoAutoPilotStatusListener {
|
||||
IMoGoAutopilotStatusListener {
|
||||
|
||||
private val TAG = "DebugSettingView"
|
||||
|
||||
@@ -107,19 +107,37 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶相关回调
|
||||
*/
|
||||
override fun onAutoPilotArriveAtStation(data: AutoPilotStationInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutoPilotStateChanged(state: Int, reason: String?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutoPilotStatusResponse(autoPilotStatusInfo: AutoPilotStatusInfo?) {
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
tvAutopilotInfo.text = GsonUtils.toJson(autoPilotStatusInfo)
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(autopilotWayArrive: AutopilotStationInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotCarStateData(autoPilotCarStateInfo: AutopilotCarStateInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotRoute(autopilotRoute: AutopilotRouteInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotSNRequest() {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrafficData>?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotWarnMessage(autopilotWarnMessage: AutopilotWarnMessage?) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,8 +5,8 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
@@ -68,10 +68,10 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
}
|
||||
private fun startAutoPilot() {
|
||||
val currentAutopilot =
|
||||
AutoPilotControlParameters()
|
||||
AutopilotControlParameters()
|
||||
currentAutopilot.isSpeakVoice = false
|
||||
currentAutopilot.startLatLon = AutoPilotControlParameters.AutoPilotLonLat(40.199157289445921,116.73675895051454);
|
||||
currentAutopilot.endLatLon = AutoPilotControlParameters.AutoPilotLonLat(40.199255159538758,116.73274535677977);
|
||||
currentAutopilot.startLatLon = AutopilotControlParameters.AutoPilotLonLat(40.199157289445921,116.73675895051454);
|
||||
currentAutopilot.endLatLon = AutopilotControlParameters.AutoPilotLonLat(40.199255159538758,116.73274535677977);
|
||||
currentAutopilot.vehicleType = 10
|
||||
MogoApisHandler.getInstance().apis.adasControllerApi.aiCloudToAdasData(currentAutopilot)
|
||||
}
|
||||
@@ -103,7 +103,7 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun onArriveAt(data: AutoPilotStationInfo?) {
|
||||
override fun onArriveAt(data: AutopilotStationInfo?) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user