This tutorial describes using both and onboard computer (shuttle PC on the P3AT) and an offboard computer (desktop) to control P3AT via joystick over wifi.
- You should have gone through the Pioneer P3AT checkout. We'll use the nre_p3at package, so it needs to be installed on your system. See Pioneer P3AT Checkout for how to setup the environment.
- It is a good idea to go through the Pioneer Joystick tutorial: Joystick Control: Wired Control of Pioneer P3AT
- You should be familiar with using SSH to access multiple Linux machines via the network. Some useful information is being collected on our Linux page.
- You should have gone through the ROS on Multiple Machines tutorial
In this tutorial our ROS network will be spread across two computers on the network. You will need to know the IP addresses for both computers. You should also verify that you can connect between the two computers as described in the ROS on Multiple Machines tutorial.
In the tutorial that follows we'll use this notation:
- BASE_IP = the IP address of the base station - the desktop or laptop computer running the ROS master and joystick driver.
- ROBOT_IP = the IP address of the computer on the robot running the Rosaria ROS node.
Make not of your own BASE_IP and ROBOT_IP addresses for substitution in the following instructions.
Base Station Setup
We'll designate a central PC as the base station, e.g., a desktop or laptop. Because this computer has a keyboard, monitor, etc., this is how the user will interact with and debug the system. You can find the IP address of your computer using the ifconfig command...
This tells us the IP address of the wireless network adapter (wlan0). So we know that for this example BASE_IP=192.168.11.100
Following the joystick tutorial (see preliminaries), you'll plug in a Logitech joystick into the base PC.
We will want to explicitly set the ROS master URI and then run the roscore and joystick driver on Poke.
Make sure to substitute BASE_IP for the IP address of your setup!
Alternatively you could set an environmental variable with the BASE_IP value of your machine.
Or, even better yet, we can have the system get the IP address automatically in a short bash script like this..
We can use rqt_graph to check and see what is running....
You should see that two nodes are running - the /joydriver and the /joymapping. The /joymapping publishes Twist messages on the /my_p3at/cmd_vel topic, but since nobody is listening, it doesn't show up on rqt_graph.
We might also use rqt_topic to see what is going on and make sure that the joystick is causing Twist commands to be published. It should look like this...
You might notice that the linear.x value in the Twist message is 1.0. This is because I was holding up the joystick.
Now lets talk to the robot.
Robot Station Setup
For this example we'll be using the computer "shuttle0" which is IP address 192.168.11.50 on the Coconut wireless. So, ROBOT_IP=192.168.11.50. Once you start the robot, and power on the shuttle PC you should be able to ping the shuttle from the base station like so...
Now we want to logon to the shuttle using ssh...
Now we need to run the P3AT driver on the shuttle PC, but we also want to make sure to tell ROS to look for the master on the base station.
Now you should see the RX and TX lights blinking on the Pioneer. Your rqt_graph should also now look like this...
The ROS master and the two joystick nodes are running on the Base PC and the my_p3at node is running on the Shuttle PC