syntax = "proto2";
package velodyne;

message velodyneManagerParams
{
  repeated velodyneLidarParams velodyne_lidars = 1;
  repeated Region region = 2;
  optional string fence_data_path = 3 [default = ""];
  optional string fence_log_path = 4 [default = ""];
  optional string left_model_path = 5 [default = ""];
  optional string right_model_path = 6 [default = ""];
  required bool distribution_mode = 7 [default = false];//是否分布式模式，分布式模式下，各程序仅启动与自身区域相关模块
}

message velodyneLidarParams
{
  required string ip = 1[default = ""];
  required int32 port = 2[default = 2368];
  required string model = 3[default = "VLP16"];
  required string calibrationFile = 4[default = ""];
  required int32 lidar_id = 5[default = 0];
  optional float max_range = 6[default = 10.0];
  optional float min_range = 7[default = 0.15];
  optional int32 min_angle = 8[default = 0];
  optional int32 max_angle = 9[default = 360];
  optional int32 rpm = 10[default = 600];
  optional CalibParameter calib = 11;
  optional int32 difop = 12[default = 7788];
}

message CalibParameter
{
  optional float r = 1 [default = 0];
  optional float p = 2 [default = 0];
  optional float y = 3 [default = 0];
  optional float cx = 4 [default = 0];
  optional float cy = 5 [default = 0];
  optional float cz = 6 [default = 0];
}

message lidarExtrinsic
{
  required int32 lidar_id = 1;
  optional CalibParameter calib = 2;
}

message outOfRangeInfo {
  required float border_minx = 1; // 最小边界x，左超界提示
  required float border_maxx = 2; // 最大边界x，右超界提示
  required float plc_border_miny = 3;// plc后夹持y方向极限值
  required float plc_border_maxy = 4;// plc后夹持y方向极限值
  required float car_min_width = 5; // 最小车宽
  required float car_max_width = 6; // 最大车宽
  required float car_min_wheelbase = 7; // 最小轴距
  required float car_max_wheelbase = 8; // 最大轴距
  required float turnplate_angle_limit_min_clockwise = 9; // 转盘逆时针角度极限
  required float turnplate_angle_limit_max_clockwise = 10; // 转盘顺时针角度极限
}

message PlcOffset {
  required float plc_offsetx = 1; // plc偏移x
  required float plc_offsety = 2; // plc偏移y
  required float plc_offset_degree = 3; // plc偏移角度
  required float plc_offset_wheel_base = 4; // plc偏移角度
}

message ZXPoint {
  optional float x = 1   [default = 0];
  optional float y = 2   [default = 0];
  optional float z = 3   [default = 0];
  optional float w = 4   [default = 0];
}
message CutBox {
  repeated ZXPoint cut_points = 1;
}

message Region
{
  // 入口id
  required int32 region_id = 1;
  // 裁减区域
  required float minx = 2;
  required float maxx = 3;
  required float miny = 4;
  required float maxy = 5;
  required float minz = 6;
  required float maxz = 7;
  required CutBox cut_box = 8;
  // 转盘旋转中心
  required float turnplate_cx = 9;
  required float turnplate_cy = 10;
  // 区域雷达
  repeated lidarExtrinsic lidar_exts = 11;   // 雷达配置
  // plc正向校准
  required PlcOffset plc_forward_offset = 12;
  // plc反向校准
  required PlcOffset plc_reverse_offset = 13;
  // 车辆范围限制
  required outOfRangeInfo car_range_info = 14;
  // 终端范围限制
  required outOfRangeInfo terminal_range_info = 15;
}