Gamepad
The Gamepad node converts joystick input from the joy node into geometry_msgs/Twist messages on cmd_vel. It supports axis remapping, a turbo button, deadzone filtering, and runtime axis reassignment.
info
The joy node must run in a separate terminal:
ros2 run joy joy_node
Configuration​
gamepad:
enabled: true
axis_linear_x: 1
axis_linear_y: -1
axis_angular_z: 0
button_turbo: 5
linear_scale: 1.0
angular_scale: 1.0
deadzone: 0.05
turbo_multiplier: 2.0
publish_rate: 50
cmd_vel_topic: "cmd_vel"
Parameters​
| Parameter | Description |
|---|---|
axis_linear_x | Joystick axis index for forward/back. Use -1 to disable. |
axis_linear_y | Joystick axis index for left/right. Use -1 to disable. |
axis_angular_z | Joystick axis index for rotation. Use -1 to disable. |
button_turbo | Button index that activates the turbo multiplier |
linear_scale | Scale factor applied to linear axes |
angular_scale | Scale factor applied to the angular axis |
deadzone | The driver ignores axis values below this threshold |
turbo_multiplier | Speed multiplier when you hold the turbo button |
publish_rate | cmd_vel publish rate in Hz (default 50) |
cmd_vel_topic | Topic name to publish velocity commands on |
Topics​
Published​
| Topic | Type | Description | Rate |
|---|---|---|---|
/<cmd_vel_topic> | geometry_msgs/Twist | Velocity commands | publish_rate Hz |
Subscribed​
| Topic | Type | Description |
|---|---|---|
/joy | sensor_msgs/Joy | Raw joystick input from the joy node |
/gamepad_axis_remap | std_msgs/Int32MultiArray | Runtime axis remapping — publish [x_axis, y_axis, z_axis] indices |
tip
The /gamepad_axis_remap topic uses transient-local QoS, so late-joining subscribers receive the last published remap. Use -1 for any axis you want to leave unmapped (outputs 0).