message_base.proto 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. eHarware_statu_msg=0x21; //调度模块硬件状态消息
  12. eExecute_request_msg=0x22; //请求调度消息
  13. eExecute_response_msg=0x23; //调度结果反馈消息
  14. }
  15. //通讯单元
  16. enum Communicator
  17. {
  18. eEmpty=0x0000;
  19. eMain=0x0001; //主流程
  20. eTerminor=0x0100;
  21. //数据表
  22. eTable=0x0200;
  23. //测量单元
  24. eMeasurer=0x0300;
  25. //调度机构
  26. eProcess=0x0400;
  27. //...
  28. }
  29. ////base message 用于解析未知类型的消息
  30. message Base_msg
  31. {
  32. required Message_type msg_type=1;
  33. optional int32 timeout_ms=2;
  34. required Communicator sender=3; //发送者
  35. required Communicator receiver=4; //接收者
  36. }
  37. //错误等级,用来做故障处理
  38. enum Error_level
  39. {
  40. NORMAL = 0; // 正常,没有错误,默认值0
  41. NEGLIGIBLE_ERROR = 1; // 轻微故障;可忽略的故障,NEGLIGIBLE_ERROR
  42. MINOR_ERROR = 2; // 一般故障,MINOR_ERROR
  43. MAJOR_ERROR = 3; // 严重故障,MAJOR_ERROR
  44. CRITICAL_ERROR = 4; // 致命故障,CRITICAL_ERROR
  45. }
  46. message Error_manager
  47. {
  48. required int32 error_code = 1;
  49. optional Error_level error_level = 2;
  50. optional string error_description = 3;
  51. }
  52. //测量结果结构体
  53. message Locate_information
  54. {
  55. optional float locate_x = 1; //整车的中心点x值; 四轮的中心
  56. optional float locate_y = 2; //整车的中心点y值; 四轮的中心
  57. optional float locate_angle = 3; //整车的旋转角; 四轮的旋转角
  58. optional float locate_length = 4; //整车的长度; 用于规避碰撞
  59. optional float locate_width = 5; //整车的宽度; 用于规避碰撞
  60. optional float locate_height = 6; //整车的高度; 用于规避碰撞
  61. optional float locate_wheel_base = 7; //整车的轮距; 前后轮的距离; 用于机器人或agv的抓车
  62. optional float locate_wheel_width = 8; //整车的轮距; 左右轮的距离; 用于机器人或agv的抓车
  63. optional bool locate_correct = 9; //整车的校准标记位
  64. }