[2.15.0][mogo-adas] 添加AEB控制接口

This commit is contained in:
xinfengkun
2023-03-31 14:27:29 +08:00
parent df9d253812
commit 662a8cdb51
9 changed files with 58 additions and 2 deletions

View File

@@ -43,6 +43,7 @@ public class SendCmd<T> {
cmds.add(new SendCmdOption<Boolean>("关闭", SendCmdOption.TAG.BLIND_AREA, false));
return new SendCmd<Boolean>(Constants.TITLE.SEND_BLIND_AREA, cmds);
}
//V2N数据到PnC
public static SendCmd<Boolean> getSendV2nToPnc() {
List<SendCmdOption<Boolean>> cmds = new ArrayList<>();
@@ -50,6 +51,7 @@ public class SendCmd<T> {
cmds.add(new SendCmdOption<Boolean>("关闭", SendCmdOption.TAG.V2N_TO_PNC, false));
return new SendCmd<Boolean>(Constants.TITLE.SEND_V2N_TO_PNC, cmds);
}
//雨天模式开关
public static SendCmd<Integer> getSendRainMode() {
List<SendCmdOption<Integer>> cmds = new ArrayList<>();
@@ -65,4 +67,12 @@ public class SendCmd<T> {
cmds.add(new SendCmdOption<Integer>("", SendCmdOption.TAG.DETOURING, 0));
return new SendCmd<Integer>(Constants.TITLE.SEND_DETOURING, cmds);
}
//AEB
public static SendCmd<Integer> getSendAeb() {
List<SendCmdOption<Integer>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Integer>("", SendCmdOption.TAG.AEB, 1));
cmds.add(new SendCmdOption<Integer>("", SendCmdOption.TAG.AEB, 0));
return new SendCmd<Integer>(Constants.TITLE.SEND_AEB, cmds);
}
}

View File

@@ -8,7 +8,8 @@ public class SendCmdOption<T> {
int BLIND_AREA = 3;//盲区数据开关
int RAIN_MODE = 4;//雨天模式
int DETOURING = 5;//绕障类功能
int V2N_TO_PNC = 5;//V2N数据到PnC
int V2N_TO_PNC = 6;//V2N数据到PnC
int AEB = 7;//AEB开关
}
public final String name;

View File

@@ -226,6 +226,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
// wifiLock = wifiManager.createWifiLock(wifiLockType, TAG);
// wifiLock.acquire();
}
private void initRegisterForActivityResult() {
intentActivityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback<ActivityResult>() {
@Override
@@ -323,6 +324,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
public void onPermissionsSucceed() {
}
};
private void showHint() {
boolean isShowHint = PreferencesUtils.getBoolean(this, "show_hint", true);
if (isShowHint) {
@@ -856,6 +858,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
titleBtnData.add(Constants.TITLE.SEND_PLANNING_CMD);
titleBtnData.add(Constants.TITLE.SEND_BLIND_AREA);
titleBtnData.add(Constants.TITLE.SEND_V2N_TO_PNC);
titleBtnData.add(Constants.TITLE.SEND_AEB);
}
private void initBtnRecyclerView() {
@@ -1663,6 +1666,10 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
//绕障类功能
new SendCmdDialog(this, SendCmd.getSendDetouring()).show();
break;
case Constants.TITLE.SEND_AEB:
//AEB
new SendCmdDialog(this, SendCmd.getSendAeb()).show();
break;
case Constants.TITLE.SEND_DETOURING_SPEED:
//绕障速度设置
showDetouringSpeedDialog();

View File

@@ -92,6 +92,10 @@ public class SendCmdDialog extends Dialog {
if (data.tag == SendCmdOption.TAG.DETOURING) {
AdasManager.getInstance().sendDetouring((int) data.value);
}
} else if (Constants.TITLE.SEND_AEB.equals(name)) {
if (data.tag == SendCmdOption.TAG.AEB) {
AdasManager.getInstance().sendAebCmd((int) data.value);
}
}
}
});

View File

@@ -203,6 +203,7 @@ public class Constants {
String SEND_PLANNING_CMD = "Planning指令";
String SEND_BLIND_AREA = "盲区数据开关";
String SEND_V2N_TO_PNC = "V2N数据到PnC";
String SEND_AEB = "AEB开关";
}
}

View File

@@ -575,7 +575,7 @@ message PlanningActionMsg
//message definition for MsgTypeSetParamReq
message SetOneParam
{
uint32 type = 1; // 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
uint32 type = 1; // 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s) 3:AEB开关(bool)
string value = 2; // 转成字符串的值
}

View File

@@ -1553,6 +1553,18 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
return sendSetParamReq(2, String.valueOf(speed));
}
/**
* AEB开关
* TODO 目前仅襄阳牌照考试支持
*
* @param enable 0关闭1开启
* @return boolean
*/
@Override
public boolean sendAebCmd(int enable) {
return sendSetParamReq(3, String.valueOf(enable));
}
/**
* 发生行程相关
* type=1或2的时 需要参数 lineName

View File

@@ -834,6 +834,18 @@ public class AdasManager implements IAdasNetCommApi {
return mChannel != null && mChannel.sendDetouringSpeed(speed);
}
/**
* AEB开关
* TODO 目前仅襄阳牌照考试支持
*
* @param enable 0关闭1开启
* @return boolean
*/
@Override
public boolean sendAebCmd(int enable) {
return mChannel != null && mChannel.sendAebCmd(enable);
}
/**
* 发生行程相关
* type=1或2的时 需要参数 lineName

View File

@@ -501,6 +501,15 @@ public interface IAdasNetCommApi {
*/
boolean sendDetouringSpeed(double speed);
/**
* AEB开关
* TODO 目前仅襄阳牌照考试支持
*
* @param enable 0关闭1开启
* @return boolean
*/
boolean sendAebCmd(int enable);
/**
* 发生行程相关
* type=1或2的时 需要参数 lineName