joy_mapper package

The joy_mapper package contains the JoyMapperNode. This node maps the standard ROS Joy messages sent by a (virtual) joystick to actionable items (e.g. start/pause a demo) or robot movement commands.


class JoyMapperNode(node_name)

Interprets the Joystick commands.

The JoyMapperNode receives Joy messages from a phisical joystick or a virtual one, interprets the buttons presses and acts accordingly.

Joystick bindings:

Physical joystick

Virtual joystick


Directional controls

Arrow keys

Move the Duckiebot (if not in lane-following)

Start button

A key

Start lane-following

Back button

S key

Stop lane-following

Y button

E key

Toggle Emergency Stop


node_name (str) – a unique, descriptive name for the node that ROS will use


~speed_gain (float): Gain for the directional joystick keys (forward/reverse) ~steer_gain (int): Gain for the directional joystick keys (steering angle) ~bicycle_kinematics (bool): True for bicycle kinematics; False for holonomic

kinematics. Default is False

~simulated_vehicle_length (float): Used in bicycle kinematics model


joy (Joy): The command read from joystick emergency_stop (BoolStamped): The emergency stop status

~car_cmd (duckietown_msgs/Twist2DStamped): Wheels command for Duckiebot, based

on the directional buttons pressed

~joystick_override (duckietown_msgs/BoolStamped): Boolean that is used to control

whether lane-following or joystick control is on