当前位置:   article > 正文

日记20190408 感知层数据格式_apollo perception_obstacle proto

apollo perception_obstacle proto
apollo/modules/perception/proto/perception_obstacle.proto文件定义了障碍物格式

根据apollo的代码,感知层要发出去的数据包括:

  1. message PerceptionObstacles {
  2. repeated PerceptionObstacle perception_obstacle = 1; // An array of obstacles 障碍物
  3. optional common.Header header = 2; // Header 协议头?
  4. optional common.ErrorCode error_code = 3 [default = OK]; //错误代码
  5. optional LaneMarkers lane_marker = 4;//车道线
  6. optional CIPVInfo cipv_info = 5; // Closest In Path Vehicle (CIPV) 最近的车辆
  7. }

其中 PerceptionObstacle的定义为:

  1. message PerceptionObstacle {
  2. optional int32 id = 1; // obstacle ID.
  3. // obstacle position in the world coordinate system.
  4. optional common.Point3D position = 2; //障碍物的3D位置
  5. optional double theta = 3; // heading in the world coordinate system. //航向 方位
  6. optional common.Point3D velocity = 4; // obstacle velocity.//速度
  7. // Size of obstacle bounding box. 障碍物盒子
  8. optional double length = 5; // obstacle length.//长
  9. optional double width = 6; // obstacle width.//宽
  10. optional double height = 7; // obstacle height.//高
  11. repeated common.Point3D polygon_point = 8; // obstacle corner points. 障碍角点
  12. // duration of an obstacle since detection in s.//观测到的障碍物的持续时间
  13. optional double tracking_time = 9;
  14. enum Type {//类型 是否移动、人、自行车、乘用车
  15. UNKNOWN = 0;
  16. UNKNOWN_MOVABLE = 1;
  17. UNKNOWN_UNMOVABLE = 2;
  18. PEDESTRIAN = 3; // Pedestrian, usually determined by moving behavior.
  19. BICYCLE = 4; // bike, motor bike
  20. VEHICLE = 5; // Passenger car or truck.
  21. };
  22. optional Type type = 10; // obstacle type
  23. optional double timestamp = 11; // GPS time in seconds.
  24. // Just for offline debugging, will not fill this field onboard.
  25. // Format: [x0, y0, z0, x1, y1, z1...]
  26. repeated double point_cloud = 12 [packed = true];
  27. optional double confidence = 13 [deprecated = true];
  28. enum ConfidenceType {//信任类型?激光雷达与摄像头,或者与毫米波雷达融合?
  29. CONFIDENCE_UNKNOWN = 0;
  30. CONFIDENCE_CNN = 1;
  31. CONFIDENCE_RADAR = 2;
  32. };
  33. optional ConfidenceType confidence_type = 14 [deprecated = true];
  34. // trajectory of object.
  35. repeated common.Point3D drops = 15 [deprecated = true];
  36. // The following fields are new added in Apollo 4.0
  37. optional common.Point3D acceleration = 16; // obstacle acceleration
  38. // a stable obstacle point in the world coordinate system
  39. // position defined above is the obstacle bounding box ground center
  40. optional common.Point3D anchor_point = 17;
  41. optional BBox2D bbox2d = 18;//2D坐标点 四个点的坐标 见message BBox2D
  42. enum SubType {
  43. ST_UNKNOWN = 0;
  44. ST_UNKNOWN_MOVABLE = 1;
  45. ST_UNKNOWN_UNMOVABLE = 2;
  46. ST_CAR = 3;
  47. ST_VAN = 4;
  48. ST_TRUCK = 5;
  49. ST_BUS = 6;
  50. ST_CYCLIST = 7;
  51. ST_MOTORCYCLIST = 8;
  52. ST_TRICYCLIST = 9;
  53. ST_PEDESTRIAN = 10;
  54. ST_TRAFFICCONE = 11;
  55. };
  56. optional SubType sub_type = 19; // obstacle sub_type 障碍子类型
  57. repeated SensorMeasurement measurements = 20; // sensor measurements ???
  58. // orthogonal distance between obstacle lowest point and ground plane
  59. optional double height_above_ground = 21 [default = nan];//障碍物最低点与地平面之间的正交距离
  60. // position covariance which is a row-majored 3x3 matrix
  61. repeated double position_covariance = 22 [packed = true];//位置协方差
  62. // velocity covariance which is a row-majored 3x3 matrix
  63. repeated double velocity_covariance = 23 [packed = true];//速度协方差
  64. // acceleration covariance which is a row-majored 3x3 matrix
  65. repeated double acceleration_covariance = 24 [packed = true];//加速度协方差
  66. // lights of vehicles
  67. optional LightStatus light_status = 25;//灯光状态 左右转向、大灯等 见message LightStatus说明
  68. }

 错误码,主要关注预测的错误码:

  1. syntax = "proto2";
  2. package apollo.common;
  3. // Error codes enum for API's categorized by modules.
  4. enum ErrorCode {
  5. // No error, returns on success.
  6. OK = 0;
  7. // Control module error codes start from here.
  8. CONTROL_ERROR = 1000;
  9. CONTROL_INIT_ERROR = 1001;
  10. CONTROL_COMPUTE_ERROR = 1002;
  11. // Canbus module error codes start from here.
  12. CANBUS_ERROR = 2000;
  13. CAN_CLIENT_ERROR_BASE = 2100;
  14. CAN_CLIENT_ERROR_OPEN_DEVICE_FAILED = 2101;
  15. CAN_CLIENT_ERROR_FRAME_NUM = 2102;
  16. CAN_CLIENT_ERROR_SEND_FAILED = 2103;
  17. CAN_CLIENT_ERROR_RECV_FAILED = 2104;
  18. // Localization module error codes start from here.
  19. LOCALIZATION_ERROR = 3000;
  20. LOCALIZATION_ERROR_MSG = 3100;
  21. LOCALIZATION_ERROR_LIDAR = 3200;
  22. LOCALIZATION_ERROR_INTEG = 3300;
  23. LOCALIZATION_ERROR_GNSS = 3400;
  24. // Perception module error codes start from here.//感知层错误码
  25. PERCEPTION_ERROR = 4000;//
  26. PERCEPTION_ERROR_TF = 4001;//坐标转换错误码
  27. PERCEPTION_ERROR_PROCESS = 4002;//传感器预测过程
  28. PERCEPTION_FATAL = 4003;
  29. PERCEPTION_ERROR_NONE = 4004;
  30. PERCEPTION_ERROR_UNKNOWN = 4005;
  31. // Prediction module error codes start from here.
  32. PREDICTION_ERROR = 5000;
  33. // Planning module error codes start from here
  34. PLANNING_ERROR = 6000;
  35. PLANNING_ERROR_NOT_READY = 6001;
  36. // HDMap module error codes start from here
  37. HDMAP_DATA_ERROR = 7000;
  38. // Routing module error codes
  39. ROUTING_ERROR = 8000;
  40. ROUTING_ERROR_REQUEST = 8001;
  41. ROUTING_ERROR_RESPONSE = 8002;
  42. ROUTING_ERROR_NOT_READY = 8003;
  43. // Indicates an input has been exhausted.
  44. END_OF_INPUT = 9000;
  45. // HTTP request error codes.
  46. HTTP_LOGIC_ERROR = 10000;
  47. HTTP_RUNTIME_ERROR = 10001;
  48. // Relative Map error codes.
  49. RELATIVE_MAP_ERROR = 11000; // general relative map error code
  50. RELATIVE_MAP_NOT_READY = 11001;
  51. // Driver error codes.
  52. DRIVER_ERROR_GNSS = 12000;
  53. DRIVER_ERROR_VELODYNE = 13000;
  54. }
  55. message StatusPb {
  56. optional ErrorCode error_code = 1 [default = OK];
  57. optional string msg = 2;
  58. }

 header:

  1. message Header {
  2. // Message publishing time in seconds. It is recommended to obtain
  3. // timestamp_sec from ros::Time::now(), right before calling
  4. // SerializeToString() and publish().
  5. optional double timestamp_sec = 1;
  6. // Module name.
  7. optional string module_name = 2;
  8. // Sequence number for each message. Each module maintains its own counter for
  9. // sequence_num, always starting from 1 on boot.
  10. optional uint32 sequence_num = 3;
  11. // Lidar Sensor timestamp for nano-second.
  12. optional uint64 lidar_timestamp = 4;
  13. // Camera Sensor timestamp for nano-second.
  14. optional uint64 camera_timestamp = 5;
  15. // Radar Sensor timestamp for nano-second.
  16. optional uint64 radar_timestamp = 6;
  17. // data version
  18. optional uint32 version = 7 [default = 1];
  19. optional StatusPb status = 8;
  20. optional string frame_id = 9;
  21. }

路标线、临近车辆

  1. message LaneMarker {
  2. optional apollo.hdmap.LaneBoundaryType.Type lane_type = 1;
  3. optional double quality = 2; // range = [0,1]; 1 = the best quality
  4. optional int32 model_degree = 3;
  5. // equation X = c3 * Z^3 + c2 * Z^2 + c1 * Z + c0
  6. optional double c0_position = 4;
  7. optional double c1_heading_angle = 5;
  8. optional double c2_curvature = 6;
  9. optional double c3_curvature_derivative = 7;
  10. optional double view_range = 8;
  11. optional double longitude_start = 9;
  12. optional double longitude_end = 10;
  13. }
  14. message LaneMarkers {
  15. optional LaneMarker left_lane_marker = 1;
  16. optional LaneMarker right_lane_marker = 2;
  17. repeated LaneMarker next_left_lane_marker = 3;
  18. repeated LaneMarker next_right_lane_marker = 4;
  19. }
  20. message CIPVInfo {
  21. optional int32 cipv_id = 1;
  22. repeated int32 potential_cipv_id = 2;
  23. }

 

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号