@@ -2,8 +2,8 @@ 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.AdasControlCommandParameter
|
||||
import com.mogo.eagle.core.data.autopilot.RemoteControlAutoPilotParameters
|
||||
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
|
||||
@@ -18,9 +18,13 @@ import com.zhidao.support.adas.high.AdasManager
|
||||
class MoGoAutoPilotProvider : IMoGoAutoPilotProvider {
|
||||
override fun init(context: Context) {}
|
||||
override fun connectAutoPilot() {}
|
||||
override fun startAutoPilot(result: RemoteControlAutoPilotParameters) {
|
||||
override fun startAutoPilot(result: AutoPilotControlParameters) {
|
||||
if (AdasManager.getInstance().isSocketConnect) {
|
||||
val parameter = AdasControlCommandParameter(TAG, result)
|
||||
val parameter =
|
||||
AutoPilotControlCmdParameter(
|
||||
TAG,
|
||||
result
|
||||
)
|
||||
AdasManager.getInstance().aiCloudToAdasData(GsonUtils.toJson(parameter))
|
||||
} else {
|
||||
LogUtils.eTag(TAG, "车机与工控机链接失败,无法开启自动驾驶")
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AdasOCHData
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
@@ -100,7 +100,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
/**
|
||||
* 自动驾驶相关回调
|
||||
*/
|
||||
override fun onAutoPilotArriveAtStation(data: AdasOCHData?) {
|
||||
override fun onAutoPilotArriveAtStation(data: AutoPilotStationInfo?) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,17 +5,14 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.autopilot.AdasOCHData
|
||||
import com.mogo.eagle.core.data.autopilot.RemoteControlAutoPilotParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters
|
||||
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
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.service.adas.IMogoAdasOCHCallback
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.android.synthetic.main.view_autopilot_status.view.*
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -70,10 +67,11 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
// startAutoPilot();
|
||||
}
|
||||
private fun startAutoPilot() {
|
||||
val currentAutopilot = RemoteControlAutoPilotParameters()
|
||||
val currentAutopilot =
|
||||
AutoPilotControlParameters()
|
||||
currentAutopilot.isSpeakVoice = false
|
||||
currentAutopilot.startLatLon = RemoteControlAutoPilotParameters.AutoPilotLonLat(40.194795425,116.724476409);
|
||||
currentAutopilot.endLatLon = RemoteControlAutoPilotParameters.AutoPilotLonLat(40.199730,116.735687);
|
||||
currentAutopilot.startLatLon = AutoPilotControlParameters.AutoPilotLonLat(40.194795425,116.724476409);
|
||||
currentAutopilot.endLatLon = AutoPilotControlParameters.AutoPilotLonLat(40.199730,116.735687);
|
||||
currentAutopilot.vehicleType = 10
|
||||
MogoApisHandler.getInstance().apis.adasControllerApi.aiCloudToAdasData(currentAutopilot)
|
||||
}
|
||||
@@ -105,7 +103,7 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun onArriveAt(data: AdasOCHData?) {
|
||||
override fun onArriveAt(data: AutoPilotStationInfo?) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,14 +5,14 @@ public
|
||||
* @author congtaowang
|
||||
* @since 2020/10/22
|
||||
*
|
||||
* 描述
|
||||
* 域控制器 控制指令发送
|
||||
*/
|
||||
class AdasControlCommandParameter {
|
||||
class AutoPilotControlCmdParameter {
|
||||
|
||||
public String action;
|
||||
public Object result;
|
||||
|
||||
public AdasControlCommandParameter( String action, Object result ) {
|
||||
public AutoPilotControlCmdParameter(String action, Object result ) {
|
||||
this.action = action;
|
||||
this.result = result;
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import java.util.List;
|
||||
* <p>
|
||||
* 启动自动驾驶参数
|
||||
*/
|
||||
public class RemoteControlAutoPilotParameters {
|
||||
public class AutoPilotControlParameters {
|
||||
|
||||
public AutoPilotLonLat startLatLon;
|
||||
public List<AutoPilotLonLat> wayLatLons;
|
||||
@@ -7,13 +7,13 @@ public
|
||||
*
|
||||
* 自动驾驶网约车回调数据
|
||||
*/
|
||||
class AdasOCHData {
|
||||
class AutoPilotStationInfo {
|
||||
|
||||
public int type;
|
||||
public double lon;
|
||||
public double lat;
|
||||
|
||||
public AdasOCHData( int type, double lon, double lat ) {
|
||||
public AutoPilotStationInfo(int type, double lon, double lat ) {
|
||||
this.type = type;
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.RemoteControlAutoPilotParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider;
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ public interface IMoGoAutoPilotProvider extends IMoGoFunctionServerProvider {
|
||||
*
|
||||
* @param result
|
||||
*/
|
||||
void startAutoPilot(RemoteControlAutoPilotParameters result);
|
||||
void startAutoPilot(AutoPilotControlParameters result);
|
||||
|
||||
/**
|
||||
* 结束自动驾驶
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AdasOCHData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo;
|
||||
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ public interface IMoGoAutoPilotStatusListener {
|
||||
*
|
||||
* @param data 所到车站的简单信息
|
||||
*/
|
||||
void onAutoPilotArriveAtStation(AdasOCHData data);
|
||||
void onAutoPilotArriveAtStation(AutoPilotStationInfo data);
|
||||
|
||||
/**
|
||||
* 自动驾驶状态发生改变
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.data.autopilot.AdasOCHData
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
@@ -97,15 +97,15 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
|
||||
/**
|
||||
* 自动驾驶网约车回调数据 回调
|
||||
* @param adasOCHData 自动驾驶网约车回调数据
|
||||
* @param autoPilotStationInfo 自动驾驶网约车回调数据
|
||||
*/
|
||||
fun invokeArriveAtStationListener(adasOCHData: AdasOCHData) {
|
||||
LogUtils.dTag(TAG, "$adasOCHData")
|
||||
fun invokeArriveAtStationListener(autoPilotStationInfo: AutoPilotStationInfo) {
|
||||
LogUtils.dTag(TAG, "$autoPilotStationInfo")
|
||||
mAutoPilotStatusListeners.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutoPilotArriveAtStation(adasOCHData)
|
||||
listener.onAutoPilotArriveAtStation(autoPilotStationInfo)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user