- Recognize the joystick:
ls /dev/input- Genereally
js0on local machine, and onjs2virtual machine
- Genereally
- Prerequisite:
sudo apt-get install ros-kinetic-joy - Test the joystick:
sudo jstest /dev/input/js0
- Run the node:
rosrun joy joy_node [device]- default to be device js0 if unspecified
- E.g.:
rosrun joy joy_node _dev:=/dev/input/js2
- To get the joystick state data published over ROS.
- axes[6]
- Example code: joy_move.cpp
- Turtlesim: joy_turtle.launch
- Run:
roslaunch joy_control joy_turtle.launch - Note: cmd_vel is remapped to a private namespace, /turtle1/cmd_vel
- Run:
- RoboRTS base: joy.launch
- Run:
roslaunch joy_control joy.launch
- Run:
- Note:
- Change the [device] in the launch file if necessary (e.g.: to js2)