apollo_prediction
/apollo/prediction 数据通道(channel)是 Apollo 系统的预测模块输出的包含障碍物预测轨迹等数据消息的通道。
本文档介绍 /apollo/prediction 通道里各数据字段的含义。
前提条件
您需要提前了解:
通道数据解释
/apollo/prediction 通道示例
参考快速上手播放 demo_3.5.record 的数据包后,您可以通过 Cyber Monitor 工具查看数据包里的全部的通道信息。
其中,/apollo/prediction 通道内的数据如下所示。
ChannelName: /apollo/prediction
MessageType: apollo.prediction.PredictionObstacles
FrameRatio: 0.00
RawMessage Size: 11000 Bytes (10.74 KB)
header:
timestamp_sec: 1545095750.512907267
module_name: prediction
sequence_num: 30952
lidar_timestamp: 1545095750368925952
camera_timestamp: 0
radar_timestamp: 0
prediction_obstacle: +[11 items]
perception_error_code: OK
start_timestamp: 1545095750.509475708
end_timestamp: 1545095750.512906075整个数据通道内的数据可以分为两部分:CyberRT 框架定义的元数据和通道对应的消息格式(Message)所定义的消息数据。
CyberRT 框架定义的元数据
该部分包括 ChannelName、MessageType、FrameRatio、RawMessage Size 数据字段,详情参见 数据通道。
ChannelName: /apollo/prediction
MessageType: apollo.prediction.PredictionObstacles
FrameRatio: 0.00
RawMessage Size: 11000 Bytes (10.74 KB)其中,MessageType 定义了当前通道对应的消息格式(Message)为apollo.prediction.PredictionObstacles。
消息格式(Message)所定义的消息数据
该部分数据字段由 apollo.prediction.PredictionObstacles 消息格式(Message)定义。
header:
timestamp_sec: 1545095750.512907267
module_name: prediction
sequence_num: 30952
lidar_timestamp: 1545095750368925952
camera_timestamp: 0
radar_timestamp: 0
prediction_obstacle: +[11 items]
perception_error_code: OK
start_timestamp: 1545095750.509475708
end_timestamp: 1545095750.512906075下一小节,将逐一详细介绍这部分消息的数据字段含义。
apollo.prediction.PredictionObstacles 等消息格式(Message)定义的数据字段
apollo.prediction.PredictionObstacles 消息格式(Message)
其定义了如下 3 个重要数据字段。
| 数据名称 | 数据解释 | Protobuf Message 定义 |
|---|---|---|
| prediction_obstacle | 被预测障碍物列表,列表中每个数据描述了被预测障碍物的相关信息 | 由 apollo.prediction.PredictionObstacle(注意没有"s") 定义 |
| header | 头信息 | 由 apollo.common.Header 定义 |
| error_code | 错误码 | 由 apollo.common.ErrorCode 定义 |
apollo.prediction.PredictionObstacle 消息格式(Message)
在 Cyber Monitor 工具中查看 apollo.prediction.PredictionObstacles 通道信息时,可以通过键盘的方向键【->】进入下一层查看 prediction_obstacle 字段的具体数据,该字段数据是由apollo.prediction.PredictionObstacle 消息格式(Message)定义的数据 列表。同时,可以通过键盘上的 N 和 M 键来遍历 prediction_obstacle 列表中的每一个具体数据。
prediction_obstacle 示例如下:
ChannelName: /apollo/prediction
MessageType: apollo.prediction.PredictionObstacles
FrameRatio: 0.00
prediction_obstacle: [0]
perception_obstacle:
id: 29740
position:
x: 587690.499966580
y: 4141324.160114305
z: -33.403820422
theta: 1.402177334
velocity:
x: -3.699909687
y: -16.755134583
z: 0.0
length: 4.298408031
width: 1.826847196
height: 1.456486583
polygon_point: +[9 items]
tracking_time: 6.000004292
type: VEHICLE
timestamp: 1545095758.668932199
acceleration:
x: -0.115613997
y: -3.869754314
z: 0.0
anchor_point:
x: 587690.849097158
y: 4141324.849514148
z: -32.728534736
bbox2d:
xmin: 0.0
ymin: 0.0
xmax: 0.0
ymax: 0.0
sub_type: ST_UNKNOWN
measurements: +[1 items]
height_above_ground: nan
position_covariance: +[9 items]
velocity_covariance: +[9 items]
acceleration_covariance: +[9 items]
light_status:
brake_visible: 0.0
brake_switch_on: 0.0
left_turn_visible: 0.0
left_turn_switch_on: 0.0
right_turn_visible: 0.0
right_turn_switch_on: 0.0
timestamp: 1545095758.668932199
predicted_period: 8.0
priority:
priority: NORMAL
trajectory: +[1 items]
is_static: 0apollo.prediction.PredictionObstacle 消息格式(Message)定义了如下的重要数据字段(感知消息 perception_obstacle 相关字段意义,详见感知数据通道文档)。
| 数据名称 | 数据解释 | 取值 | 单位 |
|---|---|---|---|
| timestamp | 时间戳 | - | - |
| predicted_period | 预测时域 | 8s | s |
| priority | 被预测障碍物的优先级 | caution/normal/ignore | - |
| trajectory | 预测轨迹信息。详情参见 pnc_point.proto文件。 | - | - |
| is_static | 被预测障碍物静止标志位 | 1/0 | - |
图中障碍物是prediction_obstacle列表中下标为3的障碍物数据(ID:29837)。

深入了解 PredictionObstacles 数据类型
深入了解 apollo.prediction.PredictionObstacles 等消息格式(Message)定义,参见 prediction_obstacle.proto文件。关于 protobuf 与消息格式(Message)的关系,参见 消息格式。
文档意见反馈
如果您在使用文档时遇到任何问题,请到我们在【开发者社区】建立的 反馈意见收集问答页面,反馈相关的问题。我们会根据反馈意见对文档进行迭代优化。