[8.5.0]
[车门、安全带、站点停车]
This commit is contained in:
@@ -121,6 +121,7 @@ public enum MessageType {
|
||||
TYPE_RECEIVE_FSM_EVENT(MessagePad.MessageType.MsgTypeFsmEvent, R.string.adas_data_MsgTypeFsmEvent),
|
||||
TYPE_SEND_TASK_MANAGER(MessagePad.MessageType.MsgTypeTaskMgrAndPad, R.string.adas_data_MsgTypeTaskMgrAndPad_SEND),
|
||||
TYPE_RECEIVE_TASK_MANAGER(MessagePad.MessageType.MsgTypeTaskMgrAndPad, R.string.adas_data_MsgTypeTaskMgrAndPad_RECEIVE),
|
||||
TYPE_RECEIVE_TASK_MANAGER_StationStop(MessagePad.MessageType.MsgTypeTaskMgrAndPad, R.string.adas_data_MsgTypeTaskMgrAndPad_RECEIVE),
|
||||
|
||||
//TODO 透传原始pb文件中不存在以下type。由于Java中无法强转,所以在mogo-adas-data/message_pad.proto中放开注释
|
||||
TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, R.string.adas_data_MsgTypePlanningDecisionState),
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.zhjt.mogo.adas.unmanned.task.dto.cmd;
|
||||
|
||||
import taskmgr.TmInfo;
|
||||
|
||||
public class TaskStationStop {
|
||||
/**
|
||||
* 停靠站信息, 仅stop=true时候有效, 否则会变更
|
||||
*/
|
||||
private VehicleSite stopStation;
|
||||
/**
|
||||
* 下一站是否停车, true 停车,false 不停车
|
||||
*/
|
||||
private boolean stop;
|
||||
/**
|
||||
* 停车原因,0:未定义原因,1:底盘stop信号,2:站点挥手拦停
|
||||
*/
|
||||
private int stopReason;
|
||||
/**
|
||||
* 到停靠站的距离,单位m
|
||||
*/
|
||||
private Double stopDistance;
|
||||
|
||||
public VehicleSite getStopStation() {
|
||||
return stopStation;
|
||||
}
|
||||
|
||||
public void setStopStation(VehicleSite stopStation) {
|
||||
this.stopStation = stopStation;
|
||||
}
|
||||
|
||||
public boolean isStop() {
|
||||
return stop;
|
||||
}
|
||||
|
||||
public void setStop(boolean stop) {
|
||||
this.stop = stop;
|
||||
}
|
||||
|
||||
public int getStopReason() {
|
||||
return stopReason;
|
||||
}
|
||||
|
||||
public void setStopReason(int stopReason) {
|
||||
this.stopReason = stopReason;
|
||||
}
|
||||
|
||||
public Double getStopDistance() {
|
||||
return stopDistance;
|
||||
}
|
||||
|
||||
public void setStopDistance(Double stopDistance) {
|
||||
this.stopDistance = stopDistance;
|
||||
}
|
||||
|
||||
public static TaskStationStop toTaskStationStop(TmInfo.StationStopInfo stationStopInfo){
|
||||
if(stationStopInfo==null){
|
||||
return null;
|
||||
}
|
||||
TaskStationStop taskStationStop = new TaskStationStop();
|
||||
taskStationStop.setStop(stationStopInfo.getStop());
|
||||
taskStationStop.setStopReason(stationStopInfo.getStopReason());
|
||||
taskStationStop.setStopDistance(stationStopInfo.getStopDistance());
|
||||
TmInfo.Location stopStation = stationStopInfo.getStopStation();
|
||||
if(stopStation!=null){
|
||||
VehicleSite vehicleSite = VehicleSite.builder()
|
||||
.coordinateType(stopStation.getCoordinateType())
|
||||
.point(new AutopilotPoint(stopStation.getPoint().getX(), stopStation.getPoint().getY()))
|
||||
.station(stopStation.getStation())
|
||||
.stationId(stopStation.getStationId())
|
||||
.stationName(stopStation.getStationName())
|
||||
.stationSeq(Math.toIntExact(stopStation.getStationSeq()))
|
||||
.build();
|
||||
taskStationStop.setStopStation(vehicleSite);
|
||||
}
|
||||
return taskStationStop;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ enum MessageType
|
||||
MsgTypePredictionObjects2025 = 0x10015; //自车他车轨迹预测2025 定频10hz
|
||||
MsgTypevllm = 0x10016; //vllm 定频 5秒一条 T1-2025(东风Taxi),map是在5.1.0routing
|
||||
MsgTypeVllmImage60 = 0x10017; //vllm图像 定频 5秒一条 T1-2025(东风Taxi),map是在5.1.0routing
|
||||
MsgTypeTaskMgrAndPadStationStop = 0x10018; //是否有人按停车
|
||||
|
||||
//### 以下消息全部不定频 ###
|
||||
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
|
||||
|
||||
124
libraries/mogo-adas-data/src/main/proto/tm_info.proto
Normal file
124
libraries/mogo-adas-data/src/main/proto/tm_info.proto
Normal file
@@ -0,0 +1,124 @@
|
||||
syntax = "proto2";
|
||||
package taskmgr;
|
||||
|
||||
import "geometry.proto";
|
||||
import "header.proto";
|
||||
|
||||
message TaskQueryRequest {
|
||||
required uint32 taskId = 1; //任务ID
|
||||
required uint32 lineId = 2; //轨迹id
|
||||
}
|
||||
message Location {
|
||||
optional uint32 coordinateType = 1 [default = 0]; //坐标类型 0:WGS84 1:GCJ02 2:UTM
|
||||
optional geometry.Point point = 2; //经纬度
|
||||
optional uint32 station = 3; // 判断此点是站点还是途径点 ------- 0:站点, 1:简单的途径点
|
||||
optional uint64 stationId = 4; //站点编号,对应云平台数据库固定值
|
||||
optional string stationName = 5; //站点名称
|
||||
optional uint64 stationSeq = 6; //站点序号,对应列表里站点流程,从1开始,1为起始点,途径点填写0
|
||||
}
|
||||
message TaskQueryResponse {
|
||||
required Location curLocation = 1;
|
||||
// required Location preStation = 2; //前一站站点信息,用于过站同步
|
||||
// required Location nextStation = 3; //下一站站点信息
|
||||
required double accumulatedStationDis = 4; //从前一站点到目前的总距离(单位m)
|
||||
required double reversedAccumulatedStationDis = 5; //从当前到下一站点的距离(单位m)
|
||||
required double stationTimeLeft = 6; //到达下一站需要的时间(单位s)
|
||||
// optional double velocity = 7; //速度, m/s
|
||||
// optional double acceleration = 8; //加速度, m/s^2
|
||||
// optional double theta = 9; //速度方向
|
||||
// optional double kappa = 10; //曲率
|
||||
optional double accumulatedTaskDis = 11; //任务全程的行进里程
|
||||
optional double reversedAccumulatedTaskDis = 12; //任务全程的剩余里程
|
||||
optional double taskTimeLeft = 13; //到达终点需要的时间(单位s)
|
||||
}
|
||||
|
||||
enum TaskState {
|
||||
NONE = 0; //无任务
|
||||
WAITING = 10; //任务待执行Waiting, 轨迹下载完成,算路请求完成,等待发车
|
||||
RUNNING = 20; //任务行进中running,收到发车名称,自驾成功,多站点多次进入该状态
|
||||
STOPED = 30; //到站停车,到达中间站点站点,上报了到站提醒
|
||||
FINISH = 40; //任务结束,收到任务结束指令或者到达终点后5秒,要主动发出停止自驾
|
||||
ABORT = 50; //任务中止,存在故障或者异常,无法自驾
|
||||
CANCEL = 60; //任务取消,收到取消指令
|
||||
}
|
||||
|
||||
|
||||
message TaskStationsQueryRequest {
|
||||
optional string src = 1; //查询来源,建议填写为rosnode名称
|
||||
}
|
||||
|
||||
message TaskStationsQueryResponse {
|
||||
required TaskState state = 1; //任务状态
|
||||
repeated Location stations = 2; //站点列表
|
||||
}
|
||||
|
||||
|
||||
message StationStopInfo { //2Hz定频上报
|
||||
required bool stop = 1; //下一站是否停车, true 停车,false 不停车
|
||||
optional uint32 stopReason = 2; //停车原因,0:未定义原因,1:底盘stop信号,2:站点挥手拦停
|
||||
optional Location stopStation = 3; //停靠站信息, 仅stop=true时候有效, 否则会变更
|
||||
optional double stopDistance = 4; //到停靠站的距离,单位m
|
||||
}
|
||||
|
||||
message TaskInfo {
|
||||
required uint64 taskId = 1; //任务ID, 同原接口的orderid
|
||||
required TaskState task_state = 2; //任务状态
|
||||
required uint64 lineId = 3; //轨迹id
|
||||
required Location curLocation = 4;
|
||||
required Location preStation = 5; //前一站站点信息
|
||||
required Location nextStation = 6; //下一站站点信息
|
||||
optional uint64 taskStartTime = 7; //任务开始时间
|
||||
optional double taskTimeLeft = 8; //任务结束剩余时间, 可用于升级提示
|
||||
}
|
||||
|
||||
message TaskEndNotify { //任务结束通知
|
||||
required bool normal= 1; //true:正常结束 false: 异常中止
|
||||
optional string order_id = 2; //订单号
|
||||
}
|
||||
|
||||
message TaskStartOrContinueNotify { //任务开始或继续通知,给规划
|
||||
optional common.Header header = 1;
|
||||
optional string order_id = 2; //任务ID, 同原接口的orderid
|
||||
optional geometry.Point start_pos = 3; //起始站点utm坐标
|
||||
required geometry.Point end_pos = 4; //结束站点utm坐标
|
||||
optional geometry.Point end_pos_lon_lat = 5; //结束站点信息, 经纬度坐标
|
||||
}
|
||||
|
||||
message TaskStopNotify { //任务停止通知,给规划,当前用于站点停止发车
|
||||
optional common.Header header = 1;
|
||||
optional string order_id = 2; //任务ID, 同原接口的orderid
|
||||
optional uint32 stop_reason = 3; //停止原因, 1: 底盘stop信号 2: 站点挥手拦停,0:未定义原因
|
||||
}
|
||||
|
||||
|
||||
|
||||
enum VoiceEvent {
|
||||
UNKNOWN = 0;
|
||||
//这里只罗列目前需要收集的语音事件,后续扩展按需增加
|
||||
ENTER_STATION = 3001; //进站
|
||||
LEAVE_STATION = 3002; //出站
|
||||
AVOIDANCE = 3103; //绕障
|
||||
TURN_LEFT = 3204; //左转
|
||||
TURN_RIGHT = 3205; //右转
|
||||
|
||||
PEDESTRIAN_AVOIDANCE = 2001; //行人避让
|
||||
CROSSWALK_AVOIDANCE = 2002; //过人行横道,礼让
|
||||
STUCK = 2101; //陷入困境
|
||||
CROSSROAD = 2102; //路口通行\
|
||||
|
||||
COLLISION = 1001; //碰撞事故
|
||||
}
|
||||
|
||||
message VoiceEventItems {
|
||||
required uint32 event = 1; //语音事件码, 同产品语音播发类型需求,定义uint32 便于扩展。 目前定义参考VoiceEvent
|
||||
optional string action = 2; //自驾行为或者环境示警描述,目前主要有:进出站,绕障,左/右转,行人避让,路口通信
|
||||
optional string extra = 3; //额外信息补充,如进站时候站点名称,开门操作对应得门的信息等,便于语音播报准确扩展
|
||||
}
|
||||
|
||||
message VoiceEventReport {
|
||||
required string src = 1; //语音事件来源,填写模块名称,rosnode 填写node名称即可
|
||||
repeated VoiceEventItems items = 2; //语音事件列表,当前模块的需要播报的行为列表
|
||||
optional Location curLocation = 3; //事件上报时候,车辆当前位置
|
||||
optional uint64 millisecond = 4; //毫秒时间戳
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ import prediction2025.Prediction2025;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
import system_master.SsmInfo;
|
||||
import system_master.SystemStatusInfo;
|
||||
import taskmgr.TmInfo;
|
||||
import vllm.Vlm;
|
||||
|
||||
/**
|
||||
@@ -809,16 +810,20 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onAdasTaskManagerOriginal(@NonNull MessagePad.Header header, @NonNull String data);
|
||||
|
||||
/**
|
||||
* 域控任务管理站点停车原始数据
|
||||
*
|
||||
* @param header 头
|
||||
* @param data 数据
|
||||
*/
|
||||
void onAdasTaskManagerStationStopOriginal(@NonNull MessagePad.Header header, @NonNull String data);
|
||||
|
||||
|
||||
/**
|
||||
* 域控任务管理离站通知
|
||||
*
|
||||
* @param taskId
|
||||
* @param siteId
|
||||
* @param sequence
|
||||
* @param ack
|
||||
* @param reason
|
||||
* @param stationTimeLeft
|
||||
* @param closeDoorStartAuto
|
||||
* @param taskStartNotification
|
||||
*/
|
||||
void onAdasTaskManagerDeparture(Long taskId, TaskStartNotification taskStartNotification);
|
||||
|
||||
@@ -826,9 +831,7 @@ public interface OnAdasListener {
|
||||
* 域控任务管理到站通知
|
||||
*
|
||||
* @param taskId 任务ID, 同原接口的orderid, 首次和头部校验
|
||||
* @param siteId 站点编号,对应云平台固定值
|
||||
* @param sequence 站点序号,对应顺序列表里站点流程,从1开始,1为起始点,最大值为终点。 途径点填写0
|
||||
* @param mileage 任务全程的已经行进的里程
|
||||
* @param taskArrivalNotification 到站信息
|
||||
*/
|
||||
void onAdasTaskManagerArrival(Long taskId, TaskArrivalNotification taskArrivalNotification);
|
||||
|
||||
@@ -852,6 +855,12 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onAdasTaskManagerRunning(Long taskId, Long lineId, TaskLocationQueryResponse taskLocationQueryResponse);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param stationStopInfo 到站的信息
|
||||
*/
|
||||
void onAdasTaskManagerStationStop(TmInfo.StationStopInfo stationStopInfo);
|
||||
/**
|
||||
* 是否有能力启动自动驾驶
|
||||
*
|
||||
|
||||
@@ -66,6 +66,7 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg planningStopLineMessage;//决策停止线
|
||||
private IMsg fSMEventMessage;//FSM事件
|
||||
private IMsg taskMgrAndPadMessage;//任务管理消息
|
||||
private IMsg taskMgrAndPadStationStopMessage;//任务管理消息
|
||||
|
||||
private final AutopilotReview autopilotReview;
|
||||
private final TurnLightState lightLeft = new TurnLightState();
|
||||
@@ -388,6 +389,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
fSMEventMessage = new FSMEventMessage();
|
||||
}
|
||||
return fSMEventMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_TASK_MANAGER_StationStop.typeCode) {
|
||||
//任务管理消息发出的站点停车
|
||||
if (taskMgrAndPadStationStopMessage == null) {
|
||||
taskMgrAndPadStationStopMessage = new TaskManagerStationStopMessage();
|
||||
}
|
||||
return taskMgrAndPadStationStopMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_TASK_MANAGER.typeCode) {
|
||||
//任务管理消息
|
||||
if (taskMgrAndPadMessage == null) {
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.AdasChannel;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import taskmgr.TmInfo;
|
||||
|
||||
/**
|
||||
* 任务管理消息
|
||||
*/
|
||||
public class TaskManagerStationStopMessage extends MyAbstractMessageHandler {
|
||||
private static final String TAG = TaskManagerStationStopMessage.class.getSimpleName();
|
||||
|
||||
public TaskManagerStationStopMessage() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
TmInfo.StationStopInfo stationStopInfo = TmInfo.StationStopInfo.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("底盘信息", raw.receiveTime);
|
||||
long nowTime = 0;
|
||||
adasListener.onAdasTaskManagerStationStop(stationStopInfo);
|
||||
AdasChannel.calculateTimeConsumingBusiness("底盘信息", nowTime);
|
||||
}
|
||||
|
||||
private void parse(OnAdasListener adasListener, String data) {
|
||||
Log.i(TAG, "任务管理接收原始数据=" + data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user