Controlling your robot from a remote computer

The next step in constructing your laser tag playing robot is to add the remote control. You'll first need to add the ability to control Raspberry Pi via a WLAN connection. As noted in Chapter 1, Adding Raspberry Pi to an RC Vehicle, the section, Accessing the RC Car remotely, showed you how to add a WLAN interface as an access point. To prepare for the next section, you will want to configure two Raspberry Pis with WLAN, one as an access point and other that you'll connect to the access point. You'll also connect a USB web camera to Raspberry Pi on the wheeled robot for control. Finally, when you have logged in to Raspberry Pi, this will function on the remote computer. Log in to the second Raspberry Pi on the wheeled robot by typing ssh –X [email protected], where the xxx.xxx.xxx.xxx is the IP address of Raspberry Pi on the wheeled robot.

You can now luvcview to see the output of the webcam and you can run the input.py program to control the wheeled robot. The output should look as follows:

Controlling your robot from a remote computer

You can now type in l, r, f, b and control your robot. This is all well and good, but the frame rate is a bit slow. If you make the resolution smaller, the system will run faster. To do this type luvcview –s 160x120 to adjust to the desired resolution. Now you can see and control your wheeled robot but you may want to add a game controller to your host computer to control your robot more intuitively.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.29.209