I.Objective
II.Parts and Devices
III.Hardware Installation
IV.Software Installation
Sample project
VI.How to play
Buy from US | Buy from UK | Besorgen DE | Acquistare IT | Acheter FR | Comprar ES | ここでご購入を! |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
****Video****
In this lesson, we will guide you through the installation and setup of the Raspberry Pi operating system, along with the necessary software and libraries to control your OSOYOO Mecanum Wheel Robot Car.
Note: here we take Raspberry Pi imager v1.8.5 as example to install OS, and other version may have some differences. (Device: Raspberry Pi 4B)
Step 1: Prepare a newly formatted micro SD memory card(TF card) with USB micro SD card reader, recommend sizes are 16G, 32G. (skip this step if your SD card has pre-installed Rasbian OS Image).
Step 2: Download the Raspberry Pi Imager from Raspberry Pi official website: https://www.raspberrypi.com/software/.
Step 3: Format your micro SD card: Run Raspberry Pi Imager and select “Erase” in Operating System field, and “your micro SD card” in Storage field.
Step 4: Run Raspberry Pi Imager, select your Raspberry pi 4 in device, then select “Use custom” in Operating System field then browse “Raspberry Pi OS” you have downloaded, then select “your SD card” in Storage field. (If you have burnt Raspberry Pi OS in your SD card, please skip step 2 to step 5).
Step 5: Click ‘EDIT SETTINGS’ to configure the username and password (we use ‘pi’ as the username and ‘raspberry’ as the password in this example) and configure wireless LAN, then click SERVICES to enable SSH, finally click “SAVE”.
Step 1: Know the IP address
1. Connect Raspberry Pi to your HDMI monitor or TV. Put a keyboard and mouse into Raspberry Pi USB ports. Insert SD card which has installed OS into the slot on your Raspberry Pi ( If you have already installed your Raspberry Pi robot car, please connect it to a screen to find out the IP address.).
2. If you move over the Lan icon, and get the notice as following:
3. Please click configure the WIFI localisation as following:
4. Find out the IP address of the RPi.
Method A: Connect your Pi to monitor and mouse, click LAN or WIFI icon to get the IP address as following photo
Method B: Open the Terminal on the screen,enter the following command in terminal window to get your IP address :
hostname -I
Step 2: Use an SSH client to control the Raspberry Pi remotely.
Note:
1) To learn more about how to use ssh tool to control Raspberry Pi remotely, Please visit the link: https://osoyoo.com/2017/06/20/raspberry-pi-3-basic-tutorial/#7
2) In our sample lessons, we use Windows PC as the remote console device and PuTTY as the ssh tool
1. Please insert SD card which have installed OS into Raspberry Pi board (Before inserting the SD card, power off the Raspberry Pi first), and then power on robot car.
2. Download PuTTY from: https://www.chiark.greenend.org.uk/~sgtatham/putty/ and install this exe. in your Windows PC
3. Open PuTTY and click Session on the left tree-alike structure (generally it’s collapsed upon PuTTY startup),enter the IP address you got into the textbox under Host Name pi (or IP address 192.168.68.227) and 22 under Port (by default it is 22) ,then click open.
4. Note that when you first log in to the Raspberry Pi with the IP address, you’ll be prompted with a security reminder. Just click Yes. When the PuTTY window prompts login as: type in the user name: pi, and password: raspberry (the default one, if you haven’t changed it).
Note: when you’re typing the password in, the window shows nothing just null, but you’re in fact is typing things in. So just focus on typing it right and press Enter. After you log in the RPi successfully, the window will display as follows:
Use ssh tool to control Raspberry Pi remotely on other OS PC, Please visit the link: https://osoyoo.com/2017/06/20/raspberry-pi-3-basic-tutorial/#7
Step 0: Please insert the SD card which has installed OS into Raspberry pi board and turn on your robot car firstly.
Step 1: Enable I2C
If you have not enable I2C, please run following command to enable I2C.
sudo raspi-config
Then select Interfacing Options->I2C->Yes->Ok->Finish
Step 2: If you don’t have rpi.gpio and adafruit-pca9685 library, use the following command to install the library.
sudo apt-get update sudo apt-get upgrade sudo apt-get install rpi.gpio![]()
Step 3: Install pca9685 and servokit library : 1) If you are using Bulleye OS, please run following commands:
sudo pip install adafruit-circuitpython-pca9685 sudo pip install adafruit-circuitpython-servokit![]()
![]()
2) If you are using Bookworm system in Raspberry Pi 5, please run following commands:
sudo pip install --break-system-packages adafruit-circuitpython-pca9685 sudo pip install --break-system-packages adafruit-circuitpython-servokit![]()
Step 4: Type following command to download the sample code.
wget https://osoyoo.com/driver/mecanum/mecanum.py![]()
Step 5: Put the robot car on the ground and run following command:
python mecanum.py
After the above python is running, your motors will move forward for 0.75 seconds and then move backward for 0.75 seconds, turn left for 0.75 seconds and turn right for 0.75 seconds then shift to right , then shift to left , then do some omni direction move and stop.
Trouble shoting:
If you are running Bookworm OS, when you run above picar-basic.py program, you might have an error message:
GPIO.setup(IN1, GPIO.OUT) ^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: Cannot determine SOC peripheral base address
Above message means your rpi.gpio library does not match Bookworm OS, you need to re-install the rpi.gpio library for Pi 5, please run following command:
sudo apt remove python3-rpi.gpio sudo pip install --break-system-packages rpi-lgpio
After re-install GPIO library, run command python mecanum.py again, the car will move accordingly.
By the end of this lesson, your Raspberry Pi will be fully configured, and you will be able to remotely control the robot car and execute movement commands ( python mecanum.py ).
The car will move in the following sequence: forward → backward → right parallel shift → left parallel shift → diagonal left-forward→back to original point→diagonal right-forward→back to original point →left turn → right turn → , and finally stop.
DownLoad Url osoyoo.com