添加绕桩开关和绕桩速度设置
This commit is contained in:
@@ -4,7 +4,7 @@ package mogo.telematics.pad;
|
||||
enum ProtocolVersion
|
||||
{
|
||||
Defaultver = 0;
|
||||
CurrentVersion = 7; //每次修改proto文件增加1
|
||||
CurrentVersion = 8; //每次修改proto文件增加1
|
||||
}
|
||||
|
||||
enum MessageType
|
||||
@@ -50,6 +50,7 @@ enum MessageType
|
||||
MsgTypeOperatorCmdReq = 0x10116; //操控指令
|
||||
MsgTypeSubscribeDataReq = 0x10117; //数据订阅、取消订阅请求
|
||||
MsgTypeSpecialVehicleTaskCmd = 0x10118; //特种车辆命令
|
||||
MsgTypeSetParamReq = 0x10119; //设置参数命令
|
||||
}
|
||||
|
||||
message Header
|
||||
@@ -141,11 +142,11 @@ message GnssInfo
|
||||
// message definition for MessageType: MsgTypeAutopilotState
|
||||
message AutopilotState
|
||||
{
|
||||
uint32 state = 1; //0: 不可用(abandoned), 1:ready, 2:自动驾驶中,3:平行驾驶
|
||||
uint32 state = 1; //0: 不可用(abandoned), 1:ready, 2:自动驾驶中
|
||||
uint32 camera = 2; //camera节点状态 1:开启,0:关闭
|
||||
uint32 radar = 3; //雷达节点状态 1:开启,0:关闭
|
||||
uint32 rtk = 4; //RTK节点状态 1:开启,0:关闭
|
||||
uint32 autopilotMode = 5; //自动驾驶状态 0: 非自动驾驶,1: 自动驾驶,2平行驾驶
|
||||
uint32 autopilotMode = 5; //自动驾驶状态 0: 非自动驾驶,1: 自动驾驶
|
||||
double speed = 6; //惯导车速 m/s
|
||||
string reason = 7; //不可用原因(abandoned)
|
||||
}
|
||||
@@ -166,7 +167,7 @@ message AutopilotState
|
||||
message PlanningObject
|
||||
{
|
||||
uint32 uuid = 1;
|
||||
uint32 type = 2; //影响自车决策的类型, 和感知的障碍物类型不是一回事 0是leading障碍物,1是避障和择机的障碍物
|
||||
uint32 type = 2; //影响自车决策的类型, 和感知的障碍物类型不是一回事
|
||||
}
|
||||
|
||||
message PlanningObjects
|
||||
@@ -466,3 +467,15 @@ message PlanningActionMsg
|
||||
//message definition for MsgTypeSpecialVehicleTaskCmd
|
||||
//refer to special_vehicle_task_cmd.proto for details
|
||||
|
||||
//message definition for MsgTypeSetParamReq
|
||||
message SetOneParam
|
||||
{
|
||||
uint32 type = 1; // 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
|
||||
string value = 2; // 转成字符串的值
|
||||
}
|
||||
|
||||
message SetParamReq
|
||||
{
|
||||
repeated SetOneParam reqs = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_LOG_WEB_SO
|
||||
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -300,6 +301,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
if (mSocket == null || bytes == null || bytes.length <= 0) {
|
||||
return false;
|
||||
}
|
||||
Log.d("liyz", "sendWsMessag bytes = " + bytes); //TODO
|
||||
ByteString byteString = ByteString.of(bytes);
|
||||
if (!byteString.startsWith(Constants.RAW_MG)) {
|
||||
CupidLogUtils.e(TAG, "协议不匹配,命令下发失败 bytes=" + ByteUtil.byteArrToHex(bytes));
|
||||
@@ -1194,5 +1196,22 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
public boolean sendOperatorCmdStopHonking() {
|
||||
return sendOperatorCmdSetHorn(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绕障开关和速度控制
|
||||
* @param type
|
||||
* @param value
|
||||
*/
|
||||
@Override
|
||||
public boolean setDetouring(int type, String value) {
|
||||
MessagePad.SetOneParam oneParam = MessagePad.SetOneParam
|
||||
.newBuilder().setType(type).setValue(value).build();
|
||||
MessagePad.SetParamReq req = MessagePad.SetParamReq
|
||||
.newBuilder()
|
||||
.addReqs(oneParam)
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_DETOURING_DATA_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -570,6 +570,15 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.sendOperatorCmdStopHonking();
|
||||
}
|
||||
|
||||
/**
|
||||
* 绕障开关和速度控制
|
||||
* @param type
|
||||
* @param value
|
||||
*/
|
||||
@Override
|
||||
public boolean setDetouring(int type, String value) {
|
||||
return mChannel != null && mChannel.setDetouring(type, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工控机固定IP列表
|
||||
|
||||
@@ -349,6 +349,11 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
void setEnableLog(boolean isEnableLog);
|
||||
|
||||
/**
|
||||
* 绕障开关和速度相关
|
||||
*/
|
||||
boolean setDetouring(int type, String value);
|
||||
|
||||
/**
|
||||
* 获取与当前连接工控机兼容性
|
||||
* 连接状态=已连接 时正常返回,其他状态全部为null
|
||||
|
||||
@@ -49,6 +49,7 @@ public enum MessageType {
|
||||
TYPE_SEND_RECORD_DATA_CONFIG_REQ(MessagePad.MessageType.MsgTypeRecordDataConfigReq, "数据采集配置查询"),
|
||||
TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP(MessagePad.MessageType.MsgTypeRecordDataConfigResp, "数据采集配置"),
|
||||
TYPE_SEND_SUBSCRIBE_DATA_REQ(MessagePad.MessageType.MsgTypeSubscribeDataReq, "数据订阅、取消订阅请求"),
|
||||
TYPE_SEND_DETOURING_DATA_REQ(MessagePad.MessageType.MsgTypeSetParamReq, "绕障开关和阈值"),
|
||||
//透传 原始pb文件中不存在以下type。由于Java中无法强转所以在mogo-adas-data message_pad.proto中放开注释
|
||||
TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user