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

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

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

    # 轮子速度控制器（已从差速控制器改为速度控制器）
    bot0_wheel_velocity_controller:
      type: velocity_controllers/JointGroupVelocityController

# 腿部和手臂关节位置控制器配置
bot0_position_controller:
  ros__parameters:
    joints:
      - left_hip_pitch_joint
      - left_leg_pitch_joint
      - right_hip_pitch_joint
      - right_leg_pitch_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_hip_pitch_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
      left_leg_pitch_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
      right_hip_pitch_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
      right_leg_pitch_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
      left_shoulder_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
      left_arm1_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
      left_arm2_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
      right_shoulder_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
      right_arm1_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
      right_arm2_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
    # 位置控制允许的误差范围
    allowable_position_error: 0.1  # 弧度

# 轮子速度控制器配置（替代原来的差速控制器）
bot0_wheel_velocity_controller:
  ros__parameters:
    joints:
      - left_wheel1_joint
      - left_wheel2_joint
      - right_wheel1_joint
      - right_wheel2_joint
    command_interfaces:
      - velocity
    state_interfaces:
      - position
      - velocity
    # 速度控制器PID参数
    gains:
      left_wheel1_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
      left_wheel2_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
      right_wheel1_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
      right_wheel2_joint: {p: 1, i: 0.0, d: 0.1, i_clamp: 0.01}
    # 速度控制允许的误差范围
    allowable_velocity_error: 0.2  # rad/s
