Installation of Raspberry PiCar-A Program with OpenCV FPV Function

January 10, 2019 By Adeept 4,697

1. Download Program in Raspberry Pi

Setting up in a Raspberry Pi may take you a lot of time, and there are too many libraries needed, so we write a python program to do the most of works for you.

NOTE: If you want to know the exact details of the program, you can skip this chapter.

NOTE: This setup.py program is needed to download and install a lot of applications and libraries, and sometimes the server or internet may break down, which may lead to some problems that the setup.py could not fix. Then you must set up a raspberry pi yourself, by following the instructions of next chapter named Set Up a Raspberry Pi.

Download the program of the PiCar-B.

Input the code below to download:

git clone https://github.com/adeept/adeept_picar-a_opencv.git

Then setup：

sudo python3 adeept_picar-a_opencv/setup.py

It may take some time to finish.

Now you can skip the next chapter and Install Python3.7 in the PC directly.

2. Install Python3.7 in the PC

Install Python3.7

So far there are two versions of Python: 2.X and 3.X. The graphical UI of the terminal control is written in Python 3.7 and it supports multiple platforms. Here we’ll focus on the installation of Python 3.7 under Windows.

Install it after download is done. Python will configure the environment variables during the installation.

*Pay attention to the 32-bit or 64-bit of your system when downloading Python – choose the corresponding Python version based on your own system.

Install OpenCV:

Install numpy:

pip3 install numpy

NumPy is a general-purpose array-processing package designed to efficiently manipulate large multi-dimensional arrays of arbitrary records without sacrificing too much speed for small multi-dimensional arrays.

In our case, we download opencv_python-3.4.3-cp37-cp37m-win_amd64.whl for Python3.7 on x64 OS.

Download it and save it in C:\Users\Administrator\ so you don’t have to input the path when installing.

Now you can install OpenCV_python:

pip3 install opencv_python-3.4.3-cp37-cp37m-win_amd64.whl

And then you need to install zmq and pybase64(same reason in RPi):

pip3 install zmq pybase64

3. Run the Raspberry PiCar-A Program

Start

Switch on the car.

After a while, if the LEDs turn red, it means the car’s server is connected to a Wi-Fi waiting for the PC client to join.

Then implement operations in Windows.

Double click to run the file client.py in the folder client.

For initial running, you need to enter the IP address of the Raspberry Pi car IP Address, then click Connect, and the program will connect to the Raspberry Pi.

After connection, the program will save the IP address. For the next use, if the IP address of the Raspberry Pi has not changed, you may press Enter directly next time to connect.

After the connection is made successfully, the Video window shows up.

Safe Shutdown

You may notice there’s no such thing as a power button for the Raspberry Pi as for PC. Most people would directly unplug the power cable for the Raspberry Pi, which may cause damage to the Raspberry Pi and SD card, data loss, etc. To avoid such issues, you need a safe shutdown for the Raspberry Pi.

If you just use the Raspberry Pi independently, you may shut it down with the following command:

sudo shutdown –h now

When the green light stops blinking on the Raspberry Pi, you may unplug the power cable.

If you’re applying the Raspberry Pi smart car, you may tab the Exit button in the app of this product. When the green light stops blinking on the Raspberry Pi, switch to OFF for the Power switch on Shield and you can shut down the Raspberry Pi then.

4.Afterword

Thanks for purchasing our product and reading the manual! If you spot any errors or have any ideas or questions for the product and this guide, welcome to contact us! We will correct them if any as quickly as possible.

After completing all projects in the guide, you should have some knowledge of the Raspberry Pi and Robot, thus you can try to change the robot into other projects by adding more Adeept modules or changing the code for extended functions.