controller_manager:
  ros__parameters:
    update_rate: 100  # Hz
    use_sim_time: true

    # 关节状态广播器 - 必须配置，用于发布关节状态
    bot1_joint_state_broadcaster:
      type: joint_state_broadcaster/JointStateBroadcaster
      use_sim_time: true

    # 关节位置控制器
    bot1_position_controller:
      type: position_controllers/JointGroupPositionController

# 腿部和手臂关节位置控制器配置
bot1_position_controller:
  ros__parameters:
    joints:
      - left_leg1_joint
      - left_wheel1_joint
      - left_leg2_joint
      - left_wheel2_joint
      - right_leg1_joint
      - right_wheel1_joint
      - right_leg2_joint
      - right_wheel2_joint
      - pitch_body_joint
      - left_shoulder_joint
      - left_arm1_joint
      - left_arm2_joint
      - right_shoulder_joint
      - right_arm1_joint
      - right_arm2_joint
    command_interfaces:
      - position
    state_interfaces:
      - position
      - velocity
    # 位置控制器PID参数
    gains:
      left_leg1_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      left_wheel1_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      left_leg2_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      left_wheel2_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      right_leg1_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      right_wheel1_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      right_leg2_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      right_wheel2_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      pitch_body_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      left_shoulder_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      left_arm1_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      left_arm2_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      right_shoulder_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      right_arm1_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
      right_arm2_joint: {p: 10000, i: 0.0, d: 1000, i_clamp: 0.01}
    # 位置控制允许的误差范围
    allowable_position_error: 0.1  # 弧度
