message_base.proto 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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. eParkspace_force_update_request_msg = 0x38; //手动修改车位消息
  22. eParkspace_force_update_response_msg = 0x39;//手动修改车位反馈消息
  23. eParkspace_confirm_alloc_request_msg = 0x3A;//确认分配车位请求消息
  24. eParkspace_confirm_alloc_response_msg = 0x3B;//确认分配车位反馈消息
  25. eParkspace_allocation_data_msg = 0x3C; //车位分配模块车位数据消息
  26. eStore_command_request_msg=0x41; //终端停车请求消息
  27. eStore_command_response_msg=0x42; //停车请求反馈消息
  28. ePickup_command_request_msg=0x43; //取车请求消息
  29. ePickup_command_response_msg=0x44; //取车请求反馈消息
  30. eStoring_process_statu_msg=0x90; //停车指令进度条消息
  31. ePicking_process_statu_msg=0x91; //取车指令进度消息
  32. eCentral_controller_statu_msg=0xa0; //中控系统状态消息
  33. eEntrance_manual_operation_msg=0xb0; //针对出入口状态操作的手动消息
  34. eProcess_manual_operation_msg=0xb1; //针对流程的手动消息
  35. }
  36. //通讯单元
  37. enum Communicator
  38. {
  39. eEmpty=0x0000;
  40. eMain=0x0001; //主流程
  41. eTerminor=0x0100;
  42. //车位表
  43. eParkspace=0x0200;
  44. //测量单元
  45. eMeasurer=0x0300;
  46. //调度机构
  47. eDispatch=0x0400;
  48. //...
  49. }
  50. ////base message 用于解析未知类型的消息
  51. message Base_info
  52. {
  53. required Message_type msg_type=1;
  54. optional int32 timeout_ms=2;
  55. required Communicator sender=3; //发送者
  56. required Communicator receiver=4; //接收者
  57. }
  58. // 事件,停车或者取车
  59. enum Process_type
  60. {
  61. eStoring=1;
  62. ePicking=2;
  63. }
  64. message Base_msg
  65. {
  66. required Base_info base_info=1;
  67. }
  68. //错误等级,用来做故障处理
  69. enum Error_level
  70. {
  71. NORMAL = 0; // 正常,没有错误,默认值0
  72. NEGLIGIBLE_ERROR = 1; // 轻微故障;可忽略的故障,NEGLIGIBLE_ERROR
  73. MINOR_ERROR = 2; // 一般故障,MINOR_ERROR
  74. MAJOR_ERROR = 3; // 严重故障,MAJOR_ERROR
  75. CRITICAL_ERROR = 4; // 致命故障,CRITICAL_ERROR
  76. }
  77. message Error_manager
  78. {
  79. required int32 error_code = 1;
  80. optional Error_level error_level = 2;
  81. optional string error_description = 3;
  82. }
  83. //测量结果结构体
  84. message Locate_information
  85. {
  86. optional float locate_x = 1; //整车的中心点x值; 四轮的中心
  87. optional float locate_y = 2; //整车的中心点y值; 四轮的中心
  88. optional float locate_angle = 3; //整车的旋转角; 四轮的旋转角
  89. optional float locate_length = 4; //整车的长度; 用于规避碰撞
  90. optional float locate_width = 5; //整车的宽度; 用于规避碰撞
  91. optional float locate_height = 6; //整车的高度; 用于规避碰撞
  92. optional float locate_wheel_base = 7; //整车的轮距; 前后轮的距离; 用于机器人或agv的抓车
  93. optional float locate_wheel_width = 8; //整车的轮距; 左右轮的距离; 用于机器人或agv的抓车
  94. optional bool locate_correct = 9; //整车的校准标记位
  95. }
  96. //车辆基本信息
  97. message Car_info
  98. {
  99. optional float car_length=1; //车长
  100. optional float car_width=2; //车宽
  101. optional float car_height=3; //车高
  102. optional string license=4; //车辆凭证号
  103. }
  104. //车位状态枚举
  105. enum Parkspace_status
  106. {
  107. eParkspace_empty = 0; //空闲,可分配
  108. eParkspace_occupied = 1; //被占用,不可分配
  109. eParkspace_reserved = 2; //被预约,预约车辆可分配
  110. eParkspace_locked = 3; //临时锁定,不可分配
  111. eParkspace_error = 4; //车位机械结构或硬件故障
  112. }
  113. enum Direction
  114. {
  115. eForward = 1;
  116. eBackward = 2;
  117. }
  118. //车位分配路线(根据中跑车的路线来定)
  119. enum Parkspace_path
  120. {
  121. OPTIMAL_PATH = 1;
  122. LEFT_PATH = 2;
  123. RIGHT_PATH = 3;
  124. TEMPORARY_CACHE_PATH = 4;
  125. }
  126. //车位类型
  127. enum Parkspace_type
  128. {
  129. MIN_PARKINGSPACE = 1;//小车位
  130. MID_PARKINGSPACE = 2;//中车位
  131. BIG_PARKINGSPACE = 3;//大车位
  132. }
  133. //单个车位基本信息与状态信息,车位信息以及车位上的车辆信息
  134. message Parkspace_info
  135. {
  136. optional int32 parkingspace_index_id = 1; //车位ID
  137. optional Parkspace_type parkingspace_type = 2; //车位类型
  138. optional int32 parkingspace_unit_id = 3; //车位单元号
  139. optional int32 parkingspace_room_id = 4; //同层编号
  140. optional Direction parkingspace_direction = 5; //前后
  141. optional int32 parkingspace_floor_id = 6; //楼层
  142. optional float parkingspace_width = 7; //车位宽
  143. optional float parkingspace_height = 8; //车位高
  144. optional Parkspace_status parkingspace_status = 9; //车位当前状态
  145. optional Car_info car_info = 10; //当前车位存入车辆的凭证号
  146. optional string entry_time = 11; //入场时间
  147. optional string leave_time = 12; //离场时间
  148. optional Parkspace_path parkspace_path = 13; // 车位分配路线
  149. optional float path_estimate_time = 14; //车位分配路线 time(s)
  150. optional Parkspace_status parkspace_status_target=15; //车位目标状态
  151. }
  152. /*
  153. *流程中的步骤类型, 例如:停车流程包含5个步骤 , 分配车位-测量-检验结果-搬运-更新车位表
  154. */
  155. enum Step_type
  156. {
  157. eAlloc_step=0;
  158. eMeasure_step=1;
  159. eCompare_step=2;
  160. eDispatch_step=3;
  161. eConfirm_step=4;
  162. eSearch_step=5; //查询数据库
  163. eWait_step=6; //等待车辆离开
  164. eRelease_step=7; //释放车位
  165. eComplete=8; //完成
  166. eBackConfirm_step=9;
  167. eBack_compare_step=10;
  168. eBackMeasure_step=11;
  169. eBackAlloc_step=12;
  170. eBackWait_step=13;
  171. eBackDispatch_step=14;
  172. eBackSearch_step=15;
  173. eBackComplete=16;
  174. }
  175. //步骤状态,每个步骤有四中可能状态 ,等待中-执行中-完成或者错误 四个状态
  176. enum Step_statu
  177. {
  178. eWaiting=0; //完成/空闲
  179. eWorking=1;
  180. eError=2;
  181. eFinished=3;
  182. }