message_base.proto 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. syntax = "proto2";
  2. package message;
  3. //消息类型定义;每个在网络上传输的消息必须含有这个属性
  4. enum Message_type
  5. {
  6. eBase_msg=0x00;
  7. eCommand_msg=0x01; //指令消息
  8. eLocate_status_msg=0x11; //定位模块状态消息
  9. eLocate_request_msg=0x12; //定位请求消息
  10. eLocate_response_msg=0x13; //定位反馈消息
  11. eDispatch_status_msg=0x21; //调度模块硬件状态消息
  12. eDispatch_request_msg=0x22; //请求调度消息
  13. eDispatch_response_msg=0x23; //调度结果反馈消息
  14. eParkspace_allocation_status_msg = 0x31; //车位分配模块状态消息,包括车位信息
  15. eParkspace_allocation_request_msg = 0x32; //请求分配车位消息
  16. eParkspace_allocation_response_msg = 0x33; //分配车位结果反馈消息
  17. eParkspace_search_request_msg = 0x34; //查询车位请求消息
  18. eParkspace_search_response_msg = 0x35; //查询车位反馈消息
  19. eParkspace_release_request_msg = 0x36; //释放车位请求消息
  20. eParkspace_release_response_msg = 0x37; //释放车位反馈消息
  21. eStore_command_request_msg=0x41; //终端停车请求消息
  22. eStore_command_response_msg=0x42; //停车请求反馈消息
  23. ePickup_command_request_msg=0x43; //取车请求消息
  24. ePickup_command_response_msg=0x44; //取车请求反馈消息
  25. eEntrance_statu_msg=0x51; //出入口状态消息
  26. }
  27. //通讯单元
  28. enum Communicator
  29. {
  30. eEmpty=0x0000;
  31. eMain=0x0001; //主流程
  32. eTerminor=0x0100;
  33. eParkspace=0x0200; //车位表
  34. eMeasurer=0x0300; //测量单元
  35. eDispatch=0x0400; //调度机构
  36. }
  37. ////base message 用于解析未知类型的消息
  38. message Base_info
  39. {
  40. required Message_type msg_type=1;
  41. optional int32 timeout_ms=2;
  42. required Communicator sender=3; //发送者
  43. required Communicator receiver=4; //接收者
  44. }
  45. message Base_msg
  46. {
  47. required Base_info base_info=1;
  48. }
  49. //错误等级,用来做故障处理
  50. enum Error_level
  51. {
  52. NORMAL = 0; // 正常,没有错误,默认值0
  53. NEGLIGIBLE_ERROR = 1; // 轻微故障;可忽略的故障,NEGLIGIBLE_ERROR
  54. MINOR_ERROR = 2; // 一般故障,MINOR_ERROR
  55. MAJOR_ERROR = 3; // 严重故障,MAJOR_ERROR
  56. CRITICAL_ERROR = 4; // 致命故障,CRITICAL_ERROR
  57. }
  58. message Error_manager
  59. {
  60. required int32 error_code = 1;
  61. optional Error_level error_level = 2;
  62. optional string error_description = 3;
  63. }
  64. //测量结果结构体
  65. message Locate_information
  66. {
  67. optional float locate_x = 1; //整车的中心点x值; 四轮的中心
  68. optional float locate_y = 2; //整车的中心点y值; 四轮的中心
  69. optional float locate_angle = 3; //整车的旋转角; 四轮的旋转角
  70. optional float locate_length = 4; //整车的长度; 用于规避碰撞
  71. optional float locate_width = 5; //整车的宽度; 用于规避碰撞
  72. optional float locate_height = 6; //整车的高度; 用于规避碰撞
  73. optional float locate_wheel_base = 7; //整车的轮距; 前后轮的距离; 用于机器人或agv的抓车
  74. optional float locate_wheel_width = 8; //整车的轮距; 左右轮的距离; 用于机器人或agv的抓车
  75. optional bool locate_correct = 9; //整车的校准标记位
  76. }
  77. message Car_info
  78. {
  79. optional float car_length=1; //车长
  80. required float car_width=2; //车宽
  81. required float car_height=3; //车高
  82. required string license=4; //车辆凭证号
  83. }
  84. //车位状态枚举
  85. enum Parkspace_status
  86. {
  87. eParkspace_empty = 0; //空闲,可分配
  88. eParkspace_occupied = 1; //被占用,不可分配
  89. eParkspace_reserverd = 2; //被预约,预约车辆可分配
  90. eParkspace_error = 3; //车位机械结构或硬件故障
  91. }
  92. enum Direction
  93. {
  94. eForward = 1;
  95. eBackward = 2;
  96. }
  97. //单个车位基本信息与状态信息
  98. message Parkspace_info
  99. {
  100. optional int32 parkspace_id=1; //车位编号
  101. optional int32 index=2; //同层编号
  102. optional Direction direction=3; //前后
  103. optional int32 floor=4; //楼层
  104. optional float length=5; //车位长
  105. optional float width=6; //车位宽
  106. optional float height=7; //车位高
  107. optional Parkspace_status parkspace_status=8; //车位当前状态
  108. optional Car_info car_info=9; //当前车位存入车辆的凭证号
  109. optional string entry_time=10; //入场时间
  110. optional string leave_time=11; //离场时间
  111. }