The hector_gamepad_manager package receives sensor_msgs::Joy messages and dispatches them to plugins that react
to gamepad input.
For example, the DrivePlugin reacts to joystick movements and sends cmd_vel commands to the robot.
The system supports multiple configurations for different capabilities, such as driving, manipulation, or * flipper control*. A meta-configuration file maps gamepad buttons to these configurations.
When a mapped button is pressed, the manager switches to the corresponding configuration.
buttons:
  6: # Button Back
    package: "hector_gamepad_manager"
    config: "driving"
  7: # Button Start
    package: "hector_gamepad_manager"
    config: "manipulation"Each configuration file maps buttons/axes to plugin functions.
Functions can now include parameters via the args field. These parameters are stored in the shared blackboard
and are uniquely namespaced, so you can reuse the same function in different or even within the same config.
axes:
  0: # Left joystick left/right
    plugin: "hector_gamepad_manager_plugins::DrivePlugin"
    function: "steer"
  1: # Left joystick up/down
    plugin: "hector_gamepad_manager_plugins::DrivePlugin"
    function: "drive"
buttons:
  0: # Button A
    plugin: "hector_gamepad_manager_plugins::DrivePlugin"
    function: "fast"
  1: # Button B
    plugin: "hector_gamepad_manager_plugins::MoveitPlugin"
    function: "go_to_pose"
    args:
      group: "arm_group"
      pose: "folded"When a sensor_msgs::Joy message arrives, all plugins in the active configuration are invoked with the corresponding
button/axis values.
Plugins can then react to input and send commands to the robot.
The hector_gamepad_manager can be launched with the following command:
ros2 launch hector_gampepad_manager hector_gamepad_manager.launch.yamlPlugins can use the blackboard to exchange data with each other. The blackboard is a shared data structure that allows plugins to store and retrieve data. This is useful for sharing state or configuration between plugins without direct dependencies. For example, the DrivePlugin can store an inverted steering state in the blackboard, which can then be accessed by other plugins. For instance, the FlipperPlugin can check if the steering is inverted and switch the commands to the front and back flippers.
This package contains the following plugins for the hector_gamepad_manager package. The functionalities per plugin are described below.
This plugin is used to drive the robot using a gamepad.
- drive: Forward and backward movement of the robot. Default button: (Left joystick up/down)
- steer: Left and right steering of the robot. Default button: (Left joystick left/right)
- fast: Fast driving mode. Default button: (A)
- slow: Slow driving mode. Default button: (X)
This plugin is used to steer the robot flippers using a gamepad.
- front_flippers_up: Rotate front flippers upwards (counterclockwise). Default button: (RB)
- front_flippers_down: Rotate front flippers downwards (clockwise). Default button: (LT)
- back_flippers_up: Rotate back flippers upwards (clockwise). Default button: (LB)
- back_flippers_down: Rotate back flippers downwards (counterclockwise). Default button: (LT)
This plugin can be used to control the robots end-effector and gripper. Additionally, in the hold mode the robot can be driven while the end-effector remains at its current position in the world frame.
- move_left_right: Move the end-effector left and right. Or move the robot base while the hold button is pressed.
- move_up_down: Move the end-effector up and down. Or move the robot base while the hold button is pressed.
- move_forward: Move the end-effector forward.
- move_backward: Move the end-effector backward.
- rotate_pitch: Rotate the end-effector around the pitch axis.
- rotate_yaw: Rotate the end-effector around the yaw axis.
- rotate_roll_clockwise: Rotate the end-effector clockwise around the roll axis.
- rotate_roll_counterclockwise: Rotate the end-effector counterclockwise around the roll axis.
- open_gripper: Open the gripper.
- close_gripper: Close the gripper.
- hold_mode: Toggle the hold mode. In hold mode the robot can be driven while the end-effector remains at its current position in the world frame.
This plugin allows assigning buttons to directly manipulate variables stored in the shared blackboard. It supports toggling and holding boolean values as well as setting string values.
- toggle: Toggles a boolean variable in the blackboard.- args:- name: The name of the variable to toggle.
- initial: Optional, the initial value of the variable if it does not exist yet (default is- false).
- topic: Optional, if set the plugin will publish the new value to the specified topic whenever it changes ( transient_local, std_msgs/Bool).
 
- Example: togglewith name inverted_steering → toggles theinverted_steeringvariable betweentrueandfalse.
 
- hold: Sets a boolean variable in the blackboard to- truewhile the button is pressed, and resets it to- falsewhen released.- args:- name: The name of the variable to hold.
 
- Example: holdwith name safety_mode → setssafety_mode = truewhen held, and resets it tofalsewhen released.
 
- set: Sets a string variable in the blackboard to a specific value when the button is pressed.- args:- name: The name of the variable to set.
- to: The value to set the variable to. Example:
 Sets the- plugin: "hector_gamepad_manager_plugins::BlackboardPlugin" function: "set" args: name: "robot_mode" to: "manipulation" - robot_modevariable in the blackboard to- manipulationwhen the button is pressed.
 
Executes MoveIt! commands to position the robot in predefined SRDF poses.
- go_to_pose: Moves the robot to a predefined pose.- args:- group: The MoveIt! group to control (e.g., "arm_group").
- pose: The name of the pose to move to (e.g., "folded").
- inverted_pose: Optional, if set the robot will move to the inverted pose if- inverted_steeringfrom the blackboard is- true.