In this example we illustrate how to use a joystick for robot control. For this example the robot and the joystick are connected to a single computer.
- We'll be using the joy ROS package. This package should be installed by default in your system. The wiki for this package includes really excellent tutorials: http://wiki.ros.org/joy/Tutorials You should work through the first of these tutorials to understand how the joystick interface work: Configuring and Using a Linux-Supported Joystick with ROS
- We'll also be using the nre_joy ROS package which is an adaptation of the send joy tutorial Writing a Teleoperation Node for a Linux-Supported Joystick. You should read the README file in the github repository: https://github.com/bsb808/nre_joy/
- Install this package according to the README instructions.
Demonstration: Joystick control of P3AT from single PC
For the purposes of this example, we assume that everything is done from a single computer
- Connect the computer to the Pioneer using a USB-to-serial adapter (/dev/ttyUSB0)
- Connect the computer to a Logitech F310 gampad via USB.
First you will need to connect to the robot. See the directions on P3AT checkout which culminates in opening a terminal window and executing...
Next launch the joystick. Open a new terminal window and execute...
Now you should be able to drive the P3AT using the left joystick on the F310.
The node/topic graph (rqt_graph) looks like this...