controller_manager:
  ros__parameters:
    update_rate: 50  # Hz — matches ESP32 auto-report rate

    joint_state_broadcaster:
      type: joint_state_broadcaster/JointStateBroadcaster

    mecanum_drive_controller:
      type: mecanum_drive_controller/MecanumDriveController

# ─────────────────────────────────────────────────────────────────────────────
# Mecanum drive controller
# ─────────────────────────────────────────────────────────────────────────────
# Wheel link names match their physical corners:
#   front-left  (FL) -> left_front_wheel_joint
#   front-right (FR) -> right_front_wheel_joint
#   rear-left   (RL) -> left_rear_wheel_joint
#   rear-right  (RR) -> right_rear_wheel_joint
#
# The same mapping is used by the hardware interface (front_left_joint /
# front_right_joint / rear_left_joint / rear_right_joint params in the URDF
# <ros2_control> block).
mecanum_drive_controller:
  ros__parameters:
    front_left_wheel_command_joint_name:  front_left_wheel_joint
    front_right_wheel_command_joint_name: front_right_wheel_joint
    rear_left_wheel_command_joint_name:   rear_left_wheel_joint
    rear_right_wheel_command_joint_name:  rear_right_wheel_joint

    odom_frame_id:  odom
    base_frame_id:  base_footprint
    enable_odom_tf: true

    kinematics:
      # wheel_radius: height of wheel centre above ground from URDF joint origin
      # (base_footprint→base_link = 0.020 m + wheel joint z-offset ≈ 0.052 m = 0.072 m)
      wheels_radius: 0.072
      # sum_of_robot_center_projection_on_X_Y_axis = lx + ly
      # lx ≈ 0.172 m (half wheelbase from URDF joint x-origins)
      # ly ≈ 0.180 m (half track from URDF joint y-origins)
      sum_of_robot_center_projection_on_X_Y_axis: 0.352
