Remote-Controlled Rover Instructions

rav_hero


Follow these steps to control your Raspberry-Pi robotic vehicle using a PS4 controller.

**IMPORTANT: Make sure you have followed the directions on the Autonomous Instructions page before proceeding!

Prerequisites

Supplies
*This tutorial assumes you have already installed the Raspian OS onto your SD card. If not, follow the instructions here to install manually. If you don't think you can install the OS manually, there are SD cards which come pre-installed with NOOBS.
*Make sure you have setup SSH from your computer to the Raspberry-Pi before starting these steps. Follow instructions here if you need guidance.


Step 1:

Install requirements

• Plug your Raspberry-Pi into your powerbank.

• SSH into your Raspberry-Pi so that you are in the terminal.

• Type cd ~ and then press enter.

• Now type: sudo apt-get install python-pygame and then press enter.

• After that type: sudo pip3 install ds4drv and then press enter.



Step 2:

Testing

• First, let's prop our robot on top of something so that when the wheels turn, the robot stays stationary and doesn't fly off your desk.

• Next, let's connect the battery.

• Now open a 2nd terminal window and SSH again into your Raspberry-Pi so that you have 2 windows connected to the Pi.

• In the newly opened window type: sudo ds4drv. Here is the ds4drv documentation if you encounter any trouble.

• When the software begins to search for a controller to pair with, on your PS4 controller: hold down the Share button and then the center PS4 Logo button simultaneously until your LED light begins to flicker. Here is an example.

• Once your PS4 controller has paired with the software, the LED should turn a solid color. In my case, the color was blue.

• Back to the original terminal window now, you should still be in your /Rovers directory.

• From your /Rovers directory type: sudo python3 autonomous_rover_001.py while your controller is connected.

• When the program asks if you would like to engage Autonomous-Mode, type F (make sure it's capital) and press enter.

Begin controlling the robotic vehicle with your PS4 controller:
= Forward
= Left
= Right
= Backward
*If you would like to change the buttons used to steer the robot, here is a list of their corresponding numbers in pygame.

• Hold down control + C for each terminal window to stop running the programs.

• When you're ready to turn off your Raspberry-Pi, type sudo shutdown -h now and then press enter. Wait at least 30 seconds before removing the power USB cable from the power bank.

rav_complete_top_view
<