This commit is contained in:
zhongchao
2022-03-11 19:40:23 +08:00
parent c6adf078ee
commit b16e7edbd3
710 changed files with 78933 additions and 26 deletions

View File

@@ -0,0 +1,41 @@
syntax = "proto2";
package chassis;
enum GearPosition {
GEAR_NONE = 0;
GEAR_N = 1;
GEAR_R = 2;
GEAR_P = 3;
GEAR_D = 4;
}
enum LightSwitch {
LIGHT_NONE = 0;
LIGHT_LEFT = 1;
LIGHT_RIGHT = 2;
LIGHT_FLASH = 3;
LIGHT_MANUAL = 4;
LIGHT_AUTO = 5;
}
enum PilotMode {
MODE_MANUAL = 0;
MODE_AUTO_DRIVE = 1;
MODE_STEER_ONLY = 2;
MODE_SPEED_ONLY = 3;
}
enum LongitudeDrivingMode {
ManualMode = 0;
AutomaticStandby = 1;
AutomaticAcceleration = 2;
AutomaticDeceleration = 3;
}
enum EPSSteeringMode {
Manual = 0;
Automatic = 1;
ManualFromInterference = 2;
ManualFromEPSFailure = 3;
TemporaryInhibited = 4;
}

View File

@@ -0,0 +1,23 @@
syntax = "proto2";
package common;
message Time {
optional uint32 sec = 1;
optional uint32 nsec = 2;
}
message Header {
// Sequence number for each message. Each module maintains its own counter for
// sequence_num, always starting from 1 on boot.
optional uint32 seq = 1;
// Message publishing time in seconds.
optional Time stamp = 2;
// frame id
optional string frame_id = 3;
// Module name.
optional string module_name = 4;
}

View File

@@ -0,0 +1,277 @@
syntax = "proto3";
package mogo.telematics.pad;
enum ProtocolVersion{
Defaultver = 0;
CurrentVersion = 1; //每次修改proto文件增加1
}
enum MessageType
{
MsgTypeDefault = 0;
MsgTypeTrajectory = 0x10000; //局部轨迹,车前引导线
MsgTypeTrackedObjects = 0x10001; //障碍物信息
MsgTypeGnssInfo = 0x10002; //惯导信息
MsgTypeVehicleState = 0x10003; //底盘信息, 透传底盘状态pb参考底盘
MsgTypeAutopilotState = 0x10004; //自动驾驶状态
MsgTypeReportMessage = 0x10005; //监控事件报告
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
MsgTypeBasicInfoResp = 0x10101; //自动驾驶设备基础信息应答
MsgTypeSetAutopilotModeReq = 0x10102; //设置自动驾驶模式
MsgTypeSetDemoModeReq = 0x10103; //设置演示模式
MsgTypeCarConfigReq = 0x10104; //车机基础信息请求
MsgTypeCarConfigResp = 0x10105; //车机基础信息应答
MsgTypeRecordCause = 0x10106; //记录人工接管原因
MsgTypeRecordData = 0x10107; //数据采集请求
MsgTypeRecordResult = 0x10108; //数据采集结果
MsgTypeSetAutopilotSpeedReq = 0x10109; //设置自动驾驶最大速度
MsgTypeGlobalPathReq = 0x1010a; //自动驾驶路径请求
MsgTypeGlobalPathResp = 0x1010b; //自动驾驶路径应答
MsgTypeTrafficLightData = 0x1010c; //发送红绿灯数据到工控机
MsgTypeWarn = 0x1010d; //预警数据
MsgTypeArrivalNotification = 0x1010e; //到站提醒
}
message Header
{
uint64 msgID = 1; //消息唯一id自增
MessageType msgType = 2; //消息类型
double timestamp = 3; //telematics消息发送时间, 单位:秒
double sourceTimestamp = 4; //数据源消息发送时间, 单位:秒
}
// message definition for MsgTypeTrajectory
message TrajectoryPoint
{
double longitude = 1;
double latitude = 2;
double altitude = 3;
double time = 4; //时间, 单位:秒
double velocity = 5; //速度, m/s
double acceleration = 6; //加速度, m/s^2
double theta = 7; //速度方向
double kappa = 8; //曲率
double accumulatedDis = 9; //从起点到目前的总距离
double reversedAccumulatedDis = 10; //从当前到终点的距离
}
message Trajectory
{
repeated TrajectoryPoint points = 1;
}
// message definition for MsgTypeTrackedObjects
message TrackedObject
{
uint32 type = 1; //物体类型, 0:Background, 1:Person, 2:Bicycle, 3:Car, 4:MotorCycle,
//5:TrafficSign, 6:Bus, 7:CellPhone, 8:Truck, 9:Bottle, 10:TrafficLight,
//11:Rider, 12:TriangleRoadblock, 13:WarningTriangle, 100:Unknown
double longitude = 2; //经度
double latitude = 3; //纬度
double altitude = 4; //海拔
double systemTime = 5; //系统时间 单位秒s
double satelliteTime = 6; //gps时间 单位秒s
uint32 uuid = 7; //车辆id
string carID = 8; //车牌id
string color = 9; //车辆颜色
double heading = 10; //车辆朝向
double speed = 11; //车辆速度
uint32 drawLevel = 12; //危险等级 1 绿,2 黄,3 红
double driverTime = 13; //驱动感知时间
}
message TrackedObjects
{
repeated TrackedObject objs = 1;
}
// message definition for MsgTypeGnssInfo
message GnssInfo
{
double longitude = 1; //经度
double latitude = 2; //纬度
double altitude = 3; //海拔
double heading = 4; //航向角
double acceleration = 5; //加速度
double yawRate = 6; //曲率
double gnssSpeed = 7; //惯导车速 m/s
double vehicleSpeed = 8; //车辆车速 m/s
double satelliteTime = 9; //gps时间 单位秒s
double systemTime = 10; //系统时间 单位秒s
}
// message definition for MessageType: MsgTypeVehicleState
// refer to VehicleState in vehicle_state.proto
// message definition for MessageType: MsgTypeAutopilotState
message AutopilotState
{
uint32 state = 1; //0: 不可用, 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: 自动驾驶
double speed = 6; //惯导车速 m/s
string reason = 7; //不可用原因
}
// message definition for MessageType: MsgTypeReportMessage
// refer to mogo_report_msg.proto
// message definition for MessageType: MsgTypeBasicInfoReq
message BasicInfoReq
{
}
// message definition for MessageType: MsgTypeBasicInfoRsp
message BasicInfoResp
{
string sn = 1;
uint32 environment = 2; //1: 研发环境, 2:测试环境, 3:生产环境 4:演示环境
}
// message definition for MsgTypeSetAutopilotModeReq
message Location
{
double longitude = 1;
double latitude = 2;
double altitude = 3;
double heading = 4;
}
message RouteInfo{
Location startLocation = 1;
string startName = 2;
Location endLocation = 3;
string endName = 4;
repeated Location wayPoints = 5;
double speedLimit = 6;
uint32 vehicleType = 7;
bool isSpeakVoice = 8;
}
message SetAutopilotModeReq
{
uint32 mode = 1; //1: enter autopilot mode, 0: quit autopilot mode
uint32 source = 2; //命令来源: 0: pad模拟, 1: aicloud业务
RouteInfo routeInfo = 3; //自动驾驶路径信息
}
// message definition for MsgTypeSetDemoModeReq
message SetDemoModeReq
{
uint32 enable = 1; //1: enable, 0: disable
}
// message definition for MsgTypeCarConfigReq
message CarConfigReq
{
}
// message definition for MsgTypeCarConfigResp
message CarConfigResp
{
string dockVersion = 1;
string plateNumber = 2; //车牌
string macAddress = 3;
ProtocolVersion protocolVersion = 4; //通信协议版本
double speedLimit = 5; //自动驾驶限速, 单位m/s
double maxSpeedLimit = 6; //最大自动驾驶限速, 单位m/s
double minAcceleration = 7; //最小加速度, 单位m/s²
double maxAcceleration = 8; //最大加速度, 单位m/s²
}
// message definition for MsgTypeRecordCause
message RecordCause
{
uint64 key = 1; //bag key 唯一标识
string filename = 2; //文件路径
string reason = 3; //接管原因
string reasonID = 4; //接管原因id
}
// message definition for MsgTypeRecordData
message RecordData
{
uint32 id = 1; //采集id
uint32 duration = 2; //采集时间长
uint32 type = 3; //采集类型, 1:badcase, 2: map; 3: rests
bool isRecord = 4; //采集指令, true: 采集, false: 停止采集
bool sustain = 5; //是否持续采集
}
// message definition for MsgTypeRecordResult
// refer to RecordPanel in record_panel.proto
// message definition for MsgTypeSetAutopilotSpeedReq
message SetAutopilotSpeedReq
{
double speedLimit = 1; //最大车辆速度, 单位m/s
}
// message definition for MsgTypeGlobalPathReq
message GlobalPathReq
{
}
// message definition for MsgTypeGlobalPathResp
message GlobalPathResp
{
repeated Location wayPoints = 1;
}
// message definition for MsgTypeTrafficLightData
message TrafficLightStatus
{
string phaseNo = 1; //相位编号
string color = 2; //灯态: 红灯-R绿灯-G绿闪-FG黄-YB-黑
int32 remain = 3; //倒计时-秒
}
message TrafficLightDetail
{
TrafficLightStatus left = 1; //左灯
TrafficLightStatus mid = 2; //中间灯
TrafficLightStatus right = 3; //右灯
}
message TrafficLightData
{
string crossID = 1; //roadID
double latitude = 2;
double longitude = 3;
string heading = 4; //红绿灯方向
string direction = 5; //路的航向角
int32 lightId = 6; //红绿灯ID
int32 laneNo = 7; //车道号
int32 arrowNo = 8; //当前车道对应地面要素转向
int32 flashYellow = 9; //黄灯总时间
TrafficLightDetail laneDetail = 10; //灯态具体信息
}
// message definition for MsgTypeWarn
message Warn
{
uint32 type = 1; //16: 小心行人, 17: 前车起步, 18: 左车道偏离, 19: 右车道偏离
//20: 保持车距/小心前车, 23:摩托车碰撞
//40: 禁止掉头, 41: 禁止左转, 42: 禁止右转, 43: 禁止鸣喇叭, 44: 禁止通行, 45: 限速%d
string content = 2; //words describe type
uint32 level = 3; //1:low 2:high
string value = 4; //reserved
}
// message definition for MsgTypeArrivalNotification
message ArrivalNotification
{
uint32 carType = 1;
Location endLocation = 2;
}

View File

@@ -0,0 +1,21 @@
syntax = "proto2";
package mogo_msg;
message MogoMsgTimestamp {
required fixed32 sec = 1;
required fixed32 nsec = 2;
}
message MogoReportMessage {
required MogoMsgTimestamp timestamp = 1; //来自消息源的时间戳,转发消息时不应修改
required string src = 2; //消息来源
required string level = 3; //error info
optional string msg = 4; //研发自己看的信息;对标准日志来说就是日志内容
optional string code = 5; //error日志中的错误原因这是一个类似宏的受约束字段用字符串的目的是便于排查问题时查看
repeated string result = 6; //带来的后果例如pad无法启动驾驶远程驾驶无法启动等可供监控后台做错误分类pad无法理解code时也可参考此字段
repeated string actions = 16; //试验性字段。消息发出者希望触发的动作例如触发短信报警自动创建工单要求pad弹框等
}

View File

@@ -0,0 +1,35 @@
syntax = "proto2";
package record_cache;
import "header.proto";
message RecordItem {
optional string topic = 1; //topic name of record data
optional int32 nums = 2; //quantity of this topic's data
}
message TriggerInfo {
required bool auto_trig = 1; //trigger mode: true - auto trig when autopilot mode turn to handle | false - subscribe topic to trig
optional string trig_topic = 2; //name of topic used to trig(mode is 0 available)
optional string trig_msg = 3; //topic message(mode is 0 available)
}
message RecordPanel {
optional common.Header header = 1;
optional int32 stat = 2; //record stat100 - record succeed,auto stop | 101 - record succeed,handle stop | 200 - record failed
optional int64 disk_free = 3; //disk space available
optional int64 total_size = 4; //space used by bag
optional string timestamp = 5; //timestamp
optional float duration = 6; //data duration
optional TriggerInfo triggerinfo = 7; //information of trigger
optional string filename = 8; //bag's filename
repeated RecordItem records = 9; //information of each topic's record
optional string note = 10; //other message(warn,error or other message included)
optional int32 type = 11;
optional int32 id = 12;
required uint64 key = 13;
repeated string topics = 14;
}

View File

@@ -0,0 +1,41 @@
syntax = "proto2";
package chassis;
import "header.proto";
import "chassis.proto";
message VehicleState {
optional common.Header header = 1;
optional chassis.PilotMode pilot_mode = 2 [default = MODE_MANUAL];
optional float steering = 3 [default = 0]; // steering angle in degrees
optional float speed = 4 [default = 0]; // speed in m/s
optional float accel = 5 [default = 0]; // target acceleration in m/s^2
optional float throttle = 6 [default = 0]; // target throttle in percentage [0, 100]
optional float brake = 7 [default = 0]; // target brake in percentage [0, 100]
optional chassis.GearPosition gear = 8 [default = GEAR_NONE];
optional chassis.LightSwitch light = 9 [default = LIGHT_NONE];
//TODO: move to chassis
optional bool horn = 10 [default = false]; //鸣笛
optional bool highbeam = 11 [default = false]; //远光灯
optional bool lowbeam = 12 [default = false]; //近光灯
optional bool foglight = 13 [default = false]; //雾灯
optional bool clearance_lamps = 14 [default = false]; //示廓灯
optional bool warn_light = 15 [default = false]; //报警灯
optional bool parking_brake = 16 [default = false];
optional chassis.LongitudeDrivingMode longitude_driving_mode = 20;
optional chassis.EPSSteeringMode eps_steering_mode = 21;
optional uint32 steering_sign = 22;
optional bool steer_inference = 23 [default = false]; //方向盘干预
optional bool brake_inference = 24 [default = false]; //制动踏板干预
optional bool accel_inference = 25 [default = false]; //加速踏板干预
optional bool gear_switch_inference = 26 [default = false]; //档位切换干预
optional bool location_missing = 27 [default = false]; //未收到定位
optional bool trajectory_missing = 28 [default = false]; //未收到轨迹
optional bool chassis_status_missing = 29 [default = false]; //未收到车辆底盘反馈信息
optional bool brake_light_status = 30 [default = false]; //自驾模式下制动灯状态
optional bool pilot_mode_condition_met = 31 [default = false];
}