[pb10][金旅M1][靠边停车] 更新planning决策状态接口 新增了靠边停车状态,添加给planning发送命令接口, 目前用于发送靠边停车指令以及起步命令

This commit is contained in:
xinfengkun
2023-01-12 14:54:16 +08:00
parent d8728fe8c9
commit f68c5cbe20
7 changed files with 83 additions and 0 deletions

View File

@@ -679,6 +679,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
titleBtnData.add(Constants.TITLE.SEND_DETOURING_CLOSE);
titleBtnData.add(Constants.TITLE.SEND_DETOURING_SPEED);
titleBtnData.add(Constants.TITLE.SEND_TRIP_INFO);
titleBtnData.add(Constants.TITLE.SEND_PLANNING_CMD);
}
@@ -1466,6 +1467,10 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
AdasManager.getInstance().sendTripInfoReq(4, "x19", "x20", "x21", true);
AdasManager.getInstance().sendTripInfoReq(5, "x22", "x23", "x24", false);
break;
case Constants.TITLE.SEND_PLANNING_CMD:
AdasManager.getInstance().sendPlanningCmd(1);
AdasManager.getInstance().sendPlanningCmd(2);
break;
}
}

View File

@@ -196,6 +196,7 @@ public class Constants {
String SEND_DETOURING_CLOSE = "绕障类功能关";
String SEND_DETOURING_SPEED = "绕障速度阈值";
String SEND_TRIP_INFO = "行程信息";
String SEND_PLANNING_CMD = "给Planning指令";
}

View File

@@ -59,6 +59,7 @@ enum MessageType
MsgTypeSetParamReq = 0x10119; //设置参数命令
MsgTypeTripInfoEvent = 0x1011a; //行程信息
MsgTypeBagManagerCmd = 0x1011b; //bag管理
MsgTypePlanningCmd = 0x1011c; //给planning的指令
}
message Header
@@ -489,6 +490,11 @@ enum DrivingAction
DRIVING_ACTION_STATE_TWO = 2;
DRIVING_ACTION_STATE_THREE = 3;
DRIVING_ACTION_STATE_FOUR = 4;
DRIVING_ACTION_STATE_FIVE = 5;
DRIVING_ACTION_STATE_SIX = 6;
DRIVING_ACTION_STATE_SEVEN = 7;
DRIVING_ACTION_STATE_EIGHT = 8;
DRIVING_ACTION_STATE_NINE = 9;
}
message DrivingActionMsg
@@ -497,10 +503,36 @@ message DrivingActionMsg
DrivingAction driving_action = 2;
}
enum ParkScenarioDrivingState
{
PARK_SENARIO_NO_AUTODRIVING = 0; //不在自动驾驶状态
PARK_SENARIO_LANKE_KEEP = 1; //车道保持状态
PARK_SENARIO_LANE_AVOID_LEFT = 2; //主动向左绕行状态: driving_action1 表示触发绕行driving_action:2 表示执行绕行driving_action:3 表示绕行取消driving_action:4 表示绕行完成
PARK_SENARIO_LANE_AVOID_RIGHT = 3; //主动向右绕行状态: driving_action1 表示触发绕行driving_action:2 表示执行绕行driving_action:3 表示绕行取消driving_action:4 表示绕行完成
PARK_SENARIO_START_UP = 4; //起步状态: driving_action1 表示正常启动driving_action:2 表示择机起步;
PARK_SENARIO_PULL_OVER = 5; //站点停车状态: driving_action1 表示正常站点停车driving_action:2 表示择机站点停车;
PARK_SENARIO_FORCE_PULL_OVER_ON = 6; //响应触发靠边停车状态: driving_action1 表示开始靠边停车driving_action:2 表示靠边停车成功3靠边停车失败;
PARK_SENARIO_FORCE_PULL_OVER_OFF = 7; //不响应触发靠边停车状态: driving_action1 表示距离前方站点100mdriving_action:2 表示距离路口100m3 正在变道 。。。
}
message ParkScenarioDrivingAction
{
ParkScenarioDrivingState driving_state = 1; //决策场景
DrivingAction driving_action = 2; //决策场景状态
}
message ParkScenarioPlanningAction
{
ParkScenarioDrivingAction action_msg = 1; //决策场景(包含场景以及响应状态)
double destination_acc = 2; //驾驶的意图(规划期望的加速或者减速值)
}
message PlanningActionMsg
{
DrivingActionMsg action_msg = 1;
double destination_acc = 2; //驾驶的意图(规划期望的加速或者减速值)
ParkScenarioPlanningAction park_scenario_action = 3;
}
//message definition for MsgTypeSpecialVehicleTaskCmd
@@ -543,4 +575,15 @@ message TripInfoEvent
//message definition for MsgTypeBagManagerCmd
//refer to bag_manager.proto for details
//message definition for MsgTypePlanningCmd
message PullOverCmd
{
uint32 cmd = 1; //0: default 1: 靠边停车 2:重新起步
}
message PlanningCmd
{
PullOverCmd pullOverCmd = 1;
}

View File

@@ -1179,6 +1179,20 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
return subscribeInterface != null && subscribeInterface.subscribeInterface(role, type, messageType);
}
/**
* 给Planning发送指令
*
* @param cmd 命令 0: default 1: 靠边停车 2:重新起步
* @return boolean
*/
@Override
public boolean sendPlanningCmd(int cmd) {
MessagePad.PlanningCmd planningCmd = MessagePad.PlanningCmd.newBuilder()
.setPullOverCmd(MessagePad.PullOverCmd.newBuilder().setCmd(cmd))
.build();
return sendPBMessage(MessageType.TYPE_SEND_PLANNING_CMD.typeCode, planningCmd.toByteArray());
}
/**
* 福田清扫车业务指令下发
*

View File

@@ -601,6 +601,17 @@ public class AdasManager implements IAdasNetCommApi {
return mChannel != null && mChannel.subscribeInterface(role, type, messageType);
}
/**
* 给Planning发送指令
*
* @param cmd 命令 0: default 1: 靠边停车 2:重新起步
* @return boolean
*/
@Override
public boolean sendPlanningCmd(int cmd) {
return mChannel != null && mChannel.sendPlanningCmd(cmd);
}
/**
* 福田清扫车业务指令下发
*

View File

@@ -319,6 +319,14 @@ public interface IAdasNetCommApi {
*/
boolean subscribeInterface(@Define.TerminalRole int role, @Define.SubscribeType int type, @NonNull MessageType messageType);
/**
* 给Planning发送指令
*
* @param cmd 命令 0: default 1: 靠边停车 2:重新起步
* @return boolean
*/
boolean sendPlanningCmd(int cmd);
/**
* 福田清扫车业务指令下发
*

View File

@@ -56,6 +56,7 @@ public enum MessageType {
TYPE_SEND_TRIP_INFO_REQ(MessagePad.MessageType.MsgTypeTripInfoEvent, "行程信息"),
TYPE_SEND_BAG_MANAGER_CMD(MessagePad.MessageType.MsgTypeBagManagerCmd, "Bag管理请求"),
TYPE_RECEIVE_BAG_MANAGER_CMD(MessagePad.MessageType.MsgTypeBagManagerCmd, "Bag管理应答"),
TYPE_SEND_PLANNING_CMD(MessagePad.MessageType.MsgTypePlanningCmd, "给Planning指令"),
//TODO 透传原始pb文件中不存在以下type。由于Java中无法强转,所以在mogo-adas-data/message_pad.proto中放开注释
TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态"),
TYPE_RECEIVE_SWEEPER_TASK_INDEX_DATA(MessagePad.MessageType.MsgTypeSweeperTaskIndexData, "清扫车指标数据"),