syntax = "proto2"; package message; //消息类型定义;每个在网络上传输的消息必须含有这个属性 enum Message_type { eBase_msg=0x00; eCommand_msg=0x01; //指令消息 eLocate_status_msg=0x11; //定位模块状态消息 eLocate_request_msg=0x12; //定位请求消息 eLocate_response_msg=0x13; //定位反馈消息 eDispatch_status_msg=0x21; //调度模块硬件状态消息 eDispatch_request_msg=0x22; //请求调度消息 eDispatch_response_msg=0x23; //调度结果反馈消息 eParkspace_allocation_status_msg=0x31; //车位分配模块状态消息,包括车位信息 eParkspace_allocation_request_msg=0x32; //请求分配车位消息 eParkspace_allocation_response_msg=0x33;//分配车位结果反馈消息 eParkspace_search_request_msg = 0x34; //查询车位请求消息 eParkspace_search_response_msg = 0x35; //查询车位反馈消息 eParkspace_release_request_msg = 0x36; //释放车位请求消息 eParkspace_release_response_msg = 0x37; //释放车位反馈消息 eParkspace_force_update_request_msg = 0x38; //手动修改车位消息 eParkspace_force_update_response_msg = 0x39;//手动修改车位反馈消息 eParkspace_confirm_alloc_request_msg = 0x3A;//确认分配车位请求消息 eParkspace_confirm_alloc_response_msg = 0x3B;//确认分配车位反馈消息 eStore_command_request_msg=0x41; //终端停车请求消息 eStore_command_response_msg=0x42; //停车请求反馈消息 ePickup_command_request_msg=0x43; //取车请求消息 ePickup_command_response_msg=0x44; //取车请求反馈消息 eStoring_process_statu_msg=0x90; //停车指令进度条消息 ePicking_process_statu_msg=0x91; //取车指令进度消息 eCentral_controller_statu_msg=0xa0; //中控系统状态消息 eEntrance_manual_operation_msg=0xb0; //针对出入口状态操作的手动消息 eProcess_manual_operation_msg=0xb1; //针对流程的手动消息 } //通讯单元 enum Communicator { eEmpty=0x0000; eMain=0x0001; //主流程 eTerminor=0x0100; //车位表 eParkspace=0x0200; //测量单元 eMeasurer=0x0300; //调度机构 eDispatch=0x0400; //... } ////base message 用于解析未知类型的消息 message Base_info { required Message_type msg_type=1; optional int32 timeout_ms=2; required Communicator sender=3; //发送者 required Communicator receiver=4; //接收者 } // 事件,停车或者取车 enum Process_type { eStoring=1; ePicking=2; } message Base_msg { required Base_info base_info=1; } //错误等级,用来做故障处理 enum Error_level { NORMAL = 0; // 正常,没有错误,默认值0 NEGLIGIBLE_ERROR = 1; // 轻微故障;可忽略的故障,NEGLIGIBLE_ERROR MINOR_ERROR = 2; // 一般故障,MINOR_ERROR MAJOR_ERROR = 3; // 严重故障,MAJOR_ERROR CRITICAL_ERROR = 4; // 致命故障,CRITICAL_ERROR } message Error_manager { required int32 error_code = 1; optional Error_level error_level = 2; optional string error_description = 3; } //测量结果结构体 message Locate_information { optional float locate_x = 1; //整车的中心点x值; 四轮的中心 optional float locate_y = 2; //整车的中心点y值; 四轮的中心 optional float locate_angle = 3; //整车的旋转角; 四轮的旋转角 optional float locate_length = 4; //整车的长度; 用于规避碰撞 optional float locate_width = 5; //整车的宽度; 用于规避碰撞 optional float locate_height = 6; //整车的高度; 用于规避碰撞 optional float locate_wheel_base = 7; //整车的轮距; 前后轮的距离; 用于机器人或agv的抓车 optional float locate_wheel_width = 8; //整车的轮距; 左右轮的距离; 用于机器人或agv的抓车 optional bool locate_correct = 9; //整车的校准标记位 } //车辆基本信息 message Car_info { optional float car_length=1; //车长 optional float car_width=2; //车宽 optional float car_height=3; //车高 optional string license=4; //车辆凭证号 } //车位状态枚举 enum Parkspace_status { eParkspace_empty = 0; //空闲,可分配 eParkspace_occupied = 1; //被占用,不可分配 eParkspace_reserved = 2; //被预约,预约车辆可分配 eParkspace_locked = 3; //临时锁定,不可分配 eParkspace_error = 4; //车位机械结构或硬件故障 } enum Direction { eForward = 1; eBackward = 2; } //单个车位基本信息与状态信息,车位信息以及车位上的车辆信息 message Parkspace_info { optional int32 parkspace_id=1; //车位编号 optional int32 index=2; //同层编号 optional Direction direction=3; //前后 optional int32 floor=4; //楼层 optional float length=5; //车位长 optional float width=6; //车位宽 optional float height=7; //车位高 optional Parkspace_status parkspace_status=8; //车位当前状态 optional Car_info car_info=9; //当前车位存入车辆的凭证号 optional string entry_time=10; //入场时间 optional string leave_time=11; //离场时间 } /* *流程中的步骤类型, 例如:停车流程包含5个步骤 , 分配车位-测量-检验结果-搬运-更新车位表 */ enum Step_type { eAlloc_step=0; eMeasure_step=1; eCompare_step=2; eDispatch_step=3; eConfirm_step=4; eSearch_step=5; //查询数据库 eWait_step=6; //等待车辆离开 eRelease_step=7; //释放车位 eComplete=8; //完成 eBackConfirm_step=9; eBack_compare_step=10; eBackMeasure_step=11; eBackAlloc_step=12; eBackWait_step=13; eBackDispatch_step=14; eBackSearch_step=15; eBackComplete=16; } //步骤状态,每个步骤有四中可能状态 ,等待中-执行中-完成或者错误 四个状态 enum Step_statu { eWaiting=0; //完成/空闲 eWorking=1; eError=2; eFinished=3; }