apollo_control

/apollo/control 数据通道(channel)是 Apollo 系统的控制模块输出的包含控制数据消息的通道。

本文档介绍 /apollo/control 通道里各数据字段的含义。

前提条件

您需要提前了解:

通道数据解释

/apollo/control 通道示例

参考快速上手播放 demo_3.5.record 的数据包后,您可以通过 Cyber Monitor 工具查看数据包里的全部的通道信息。 其中,/apollo/control 通道内的数据如下所示。

ChannelName: /apollo/control
MessageType: apollo.control.ControlCommand
FrameRatio: 0.00
RawMessage Size: 935 Bytes
header:
  timestamp_sec: 1630995862.907613993
  module_name: control
  sequence_num: 938853
  lidar_timestamp: 0
  camera_timestamp: 0
  radar_timestamp: 0
  status:
    error_code: OK
throttle: 0.000000000
brake: 25.184325970
steering_rate: 100.000000000
steering_target: 0.381460951
acceleration: -1.894496599
gear_location: GEAR_DRIVE
debug:
  simple_lon_debug:
    station_reference: 0.000000000
    station_error: -1.372341899
    station_error_limited: -1.372341899
    preview_station_error: -0.223878262
    speed_reference: 5.923837561
    speed_error: 0.080260603
    speed_controller_input_limited: -0.194207777
    preview_speed_reference: 5.563213862
    preview_speed_error: -0.280363096
    preview_acceleration_reference: -1.765116141
    acceleration_cmd_closeloop: -0.129380458
    acceleration_cmd: -1.894496599
    acceleration_lookup: -1.894496599
    speed_lookup: 5.844444275
    calibration_value: -25.184325970
    throttle_cmd: 0.000000000
    brake_cmd: 25.184325970
    is_full_stop: 0
    slope_offset_compensation: -0.093446109
    current_station: 1.372341899
    path_remain: 11.945658939
    calibration_value: -25.184325970
    throttle_cmd: 0.000000000
    brake_cmd: 25.184325970
    is_full_stop: 0
    slope_offset_compensation: -0.093446109
    current_station: 1.372341899
    path_remain: 11.945658939
    pid_saturation_status: 0
    speed_offset: -0.274468380
    current_speed: 5.843625767
    acceleration_reference: -1.837567688
    current_acceleration: -2.367836051
    acceleration_error: 0.530279714
    jerk_reference: 0.877854481
    current_jerk: 1.786865215
    jerk_error: -0.909019299
    current_matched_point:
      path_point: 
        x: 429162.562222532
        y: 4439466.979134232
    current_reference_point: 
      path_point: 
        x: 429163.736527939
        y: 4439467.689278578
    preview_reference_point: 
      path_point: 
        x: 429162.753783390
        y: 4439467.094987508
  simple_lat_debug: 
    lateral_error: -0.139416788
    ref_heading: -2.597674912
    heading: -2.580938342
    heading_error: 0.016736570
    heading_error_rate: -0.002273017
    lateral_error_rate: 0.097811383
    curvature: 0.000051148
    steer_angle: 0.381460951
    steer_angle_feedforward: 0.013720624
    ref_heading: -2.597674912
    heading: -2.580938342
    heading_error: 0.016736570
    heading_error_rate: -0.002273017
    lateral_error_rate: 0.097811383
    curvature: 0.000051148
    steer_angle: 0.381460951
    steer_angle_feedforward: 0.013720624
    steer_angle_lateral_contribution: 4.130272299
    steer_angle_lateral_rate_contribution: -0.135296978
    steer_angle_heading_contribution: -3.658121308
    steer_angle_heading_rate_contribution: 0.018424224
    steer_angle_feedback: 0.355278237
    steering_position: 0.553191483
    ref_speed: 5.844444275
    steer_angle_limited: 0.368998861
    lateral_acceleration: -0.039633154
    lateral_jerk: 0.032834790
    ref_heading_rate: 0.000280984
    heading_rate: -0.001992033
    ref_heading_acceleration: 0.000000000
    heading_acceleration: -0.158649619
    heading_error_acceleration: -0.158649619
    ref_heading_jerk: 0.003782214
    heading_jerk: -13.901040426
    heading_error_jerk: -13.904822641
    lateral_error_feedback: -0.115611802
    heading_error_feedback: 0.016670042
    current_target_point:
      path_point: 
        x: 429161.347010046
        y: 4439466.244213126
    steer_angle_feedback_augment: 0.000000000
    steer_mrac_enable_status: 0
  input_debug: 
    localization_header: 
      timestamp_sec: 1630995862.905360460
      module_name: perception_localization_100hz
    canbus_header: 
      timestamp_sec: 1630995862.897118568
      module_name: canbus
      sequence_num: 953476
    trajectory_header: 
      timestamp_sec: 1630995862.817546129
      module_name: planning
      sequence_num: 2638
      lidar_timestamp: 0
      camera_timestamp: 0
      radar_timestamp: 0
    latest_replan_trajectory_header:
      timestamp_sec: 1630995857.010923147
      module_name: planning
      sequence_num: 2610
      lidar_timestamp: 0
      camera_timestamp: 0
      radar_timestamp: 0
signal: 
  turn_signal: TURN_NONE
latency_stats: 
  total_time_ms: 1.684992000
  controller_time_ms: +[2 items]
  total_time_exceeded: 0
pad_msg: 
  header: 
    timestamp_sec: 1630995853.923423290
    module_name: HMI
    sequence_num: 20
  action: START
engage_advice:

整个数据通道内的数据可以分为五部分:CyberRT 框架定义的元数据、通道对应的消息格式(Message)所定义的消息数据、纵向控制算法 debug 数据信息、横向控制算法 debug 数据信息、控制算法输入数据信息。

CyberRT 框架定义的元数据

该部分包括 ChannelName、MessageType、FrameRatio、RawMessage Size 数据字段,详情参见 数据通道。

ChannelName: /apollo/control
MessageType: apollo.control.ControlCommand
FrameRatio: 0.00
RawMessage Size: 935 Bytes

其中,MessageType 定义了当前通道对应的消息格式(Message)为apollo.control.ControlCommand。

消息格式(Message)所定义的消息数据

该部分数据字段由 apollo.control.ControlCommand 消息格式(Message)定义。

header:
  timestamp_sec: 1630995862.907613993
  module_name: control
  sequence_num: 938853
  lidar_timestamp: 0
  camera_timestamp: 0
  radar_timestamp: 0
  status:
    error_code: OK
throttle: 0.000000000
brake: 25.184325970
steering_rate: 100.000000000
steering_target: 0.381460951
acceleration: -1.894496599
gear_location: GEAR_DRIVE

纵向控制算法 debug 数据信息

此部分数据由 apollo.control.SimpleLongitudinalDebug 消息格式(Message)定义。 apollo.control.SimpleLongitudinalDebug。

simple_lon_debug:
    station_reference: 0.000000000
    station_error: -1.372341899
    station_error_limited: -1.372341899
    preview_station_error: -0.223878262
    speed_reference: 5.923837561
    speed_error: 0.080260603
    speed_controller_input_limited: -0.194207777
    preview_speed_reference: 5.563213862
    preview_speed_error: -0.280363096
    preview_acceleration_reference: -1.765116141
    acceleration_cmd_closeloop: -0.129380458
    acceleration_cmd: -1.894496599
    acceleration_lookup: -1.894496599
    speed_lookup: 5.844444275
    calibration_value: -25.184325970
    throttle_cmd: 0.000000000
    brake_cmd: 25.184325970
    is_full_stop: 0
    slope_offset_compensation: -0.093446109
    current_station: 1.372341899
    path_remain: 11.945658939
    calibration_value: -25.184325970
    throttle_cmd: 0.000000000
    brake_cmd: 25.184325970
    is_full_stop: 0
    slope_offset_compensation: -0.093446109
    current_station: 1.372341899
    path_remain: 11.945658939
    pid_saturation_status: 0
    speed_offset: -0.274468380
    current_speed: 5.843625767
    acceleration_reference: -1.837567688
    current_acceleration: -2.367836051
    acceleration_error: 0.530279714
    jerk_reference: 0.877854481
    current_jerk: 1.786865215
    jerk_error: -0.909019299
    current_matched_point:
      path_point: 
        x: 429162.562222532
        y: 4439466.979134232
    current_reference_point: 
      path_point: 
        x: 429163.736527939
        y: 4439467.689278578
    preview_reference_point: 
      path_point: 
        x: 429162.753783390
        y: 4439467.094987508

横向控制算法 debug 数据信息

此部分数据由 apollo.control.SimpleLateralDebug 消息格式(Message)定义。 apollo.control.SimpleLateralDebug。

simple_lat_debug: 
    lateral_error: -0.139416788
    ref_heading: -2.597674912
    heading: -2.580938342
    heading_error: 0.016736570
    heading_error_rate: -0.002273017
    lateral_error_rate: 0.097811383
    curvature: 0.000051148
    steer_angle: 0.381460951
    steer_angle_feedforward: 0.013720624
    ref_heading: -2.597674912
    heading: -2.580938342
    heading_error: 0.016736570
    heading_error_rate: -0.002273017
    lateral_error_rate: 0.097811383
    curvature: 0.000051148
    steer_angle: 0.381460951
    steer_angle_feedforward: 0.013720624
    steer_angle_lateral_contribution: 4.130272299
    steer_angle_lateral_rate_contribution: -0.135296978
    steer_angle_heading_contribution: -3.658121308
    steer_angle_heading_rate_contribution: 0.018424224
    steer_angle_feedback: 0.355278237
    steering_position: 0.553191483
    ref_speed: 5.844444275
    steer_angle_limited: 0.368998861
    lateral_acceleration: -0.039633154
    lateral_jerk: 0.032834790
    ref_heading_rate: 0.000280984
    heading_rate: -0.001992033
    ref_heading_acceleration: 0.000000000
    heading_acceleration: -0.158649619
    heading_error_acceleration: -0.158649619
    ref_heading_jerk: 0.003782214
    heading_jerk: -13.901040426
    heading_error_jerk: -13.904822641
    lateral_error_feedback: -0.115611802
    heading_error_feedback: 0.016670042
    current_target_point:
      path_point: 
        x: 429161.347010046
        y: 4439466.244213126
    steer_angle_feedback_augment: 0.000000000
    steer_mrac_enable_status: 0

控制算法输入数据信息

此部分数据由 apollo.control.input_debug 消息格式(Message)和apollo.control.pad_msg 消息格式(Message)定义分别如下:

signal: 
  turn_signal: TURN_NONE
latency_stats: 
  total_time_ms: 1.684992000
  controller_time_ms: +[2 items]
  total_time_exceeded: 0
pad_msg: 
  header: 
    timestamp_sec: 1630995853.923423290
    module_name: HMI
    sequence_num: 20
  action: START
engage_advice:

下一小节,将逐一详细介绍 apollo.control.ControlCommand 这部分消息的数据字段含义,其它 debug 信息均是算法细节数据,这里将不再介绍。

apollo.control.ControlCommand 等消息格式(Message)定义的数据字段

apollo.control.ControlCommand 消息格式(Message)定义了如下几个重要数据字段:

数据名称 数据解释 Protobuf Message 定义
ControlCommand 控制指令列表,列表中每个数据描述了下发底层的详细控制指令信息 由 apollo.control.ControlCommand定义
header 头信息 由 apollo.common.Header 定义
error_code 错误码 由 apollo.common.ErrorCode 定义
throttle 油门控制指令 由 apollo.control.ControlCommand定义
brake 刹车控制指令 由 apollo.control.ControlCommand定义
steering_rate 方向盘转角变化率 由 apollo.control.ControlCommand定义
steering_target 方向盘转角控制指令 由 apollo.control.ControlCommand定义
acceleration 目标加速度控制指令 由 apollo.control.ControlCommand定义
gear_location 目标档位控制指令 由 apollo.control.ControlCommand定义

在 Cyber Monitor 工具中查看 /apollo/control 通道信息时,可以通过键盘的方向键 page down 进入下一页查看具体数据,通过键盘的方向键 page up 进入上一页查看具体数据。

文档意见反馈

如果您在使用文档时遇到任何问题,请到我们在【开发者社区】建立的 反馈意见收集问答页面,反馈相关的问题。我们会根据反馈意见对文档进行迭代优化。

CANBUS模块定位模块