A ROS node that converts
sensor_msgs/Joymessages intogeometry_msgs/Twistcommands — designed for ROV / ground robot teleoperation via joystick.
The node subscribes to /joy and re-maps joystick axes and buttons to a Twist message, which is published on /cmd_vel. A deadman switch (button 0) must be released for movement commands to pass through.
| Input | Twist field |
Description |
|---|---|---|
axes[2] |
linear.x |
Thrust (forward/back) |
axes[0] |
linear.y |
Lateral |
axes[1] |
linear.z |
Heave (up/down) |
axes[3] |
angular.z |
Yaw |
buttons[3] |
angular.y = +0.5 |
Roll positive |
buttons[4] |
angular.y = −0.5 |
Roll negative |
buttons[0] |
deadman (active LOW) | Block all output when pressed |
| Topic | Type | Direction |
|---|---|---|
/joy |
sensor_msgs/Joy |
Subscribed |
/cmd_vel |
geometry_msgs/Twist |
Published |
# Clone into your catkin workspace
cd ~/catkin_ws/src
git clone https://github.com/JuliusPinsker/joy_twist.git
# Build
cd ~/catkin_ws
catkin_make
source devel/setup.bashLaunch both the joystick driver and the joy_twist node together:
roslaunch joy_twist joy_twist.launchOr run the node directly:
rosrun joy_twist joy_twist_nodeMake sure your joystick device is accessible (default:
/dev/input/js0). You can set the device path via thejoy_nodeparameterdevif needed.
MIT — see LICENSE.