准备抽离AutoPilot调用逻辑,有些多,放在10月份进行
Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.eagle.core.function.hmi">
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.mogo.eagle.core.function.autopilot;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AdasControlCommandParameter;
|
||||
import com.mogo.eagle.core.data.autopilot.RemoteControlAutoPilotParameters;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotProvider;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotStatusListener;
|
||||
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 下午
|
||||
*/
|
||||
public class MoGoAutoPilotProvider implements IMoGoAutoPilotProvider {
|
||||
|
||||
private static final String TAG = "MogoAutoPilotProvider";
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAutoPilot(RemoteControlAutoPilotParameters result) {
|
||||
if (AdasManager.getInstance().isSocketConnect()) {
|
||||
AdasControlCommandParameter parameter = new AdasControlCommandParameter(TAG, result);
|
||||
AdasManager.getInstance().aiCloudToAdasData(GsonUtils.toJson(parameter));
|
||||
} else {
|
||||
LogUtils.eTag(TAG, "车机与工控机链接失败,无法开启自动驾驶");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelAutoPilot() {
|
||||
if (AdasManager.getInstance().isSocketConnect()) {
|
||||
AdasManager.getInstance().controlAutopilotCarHead();
|
||||
} else {
|
||||
LogUtils.eTag(TAG, "车机与工控机链接失败,无法断开自动驾驶");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAutopilotStatus() {
|
||||
// int status = IMoGoAutoPilotStatusListener.STATUS_AUTOPILOT_DISABLE;
|
||||
// try {
|
||||
// status = adasProvider.autopilotStateCall().getState();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user