-
Download and start Raspberry Pi Imager from here.
-
Choose OS: "SCL or GUI (Raspbian 64/32 bits)"
-
Select USB Driver.
-
Go to Settings (Advanced Option).
-
Press the Save Button.
-
Press the Write Button.
-
Insert the USB Driver into Raspberry Pi to start installing Ubuntu.
Follow the PiRacer Assembly Manual.
Follow the PiRacer-py guide.
-
Run the following commands to add the Raspberry Pi repository and update the system:
sudo -s echo "deb http://archive.raspberrypi.org/debian/ buster main" >> /etc/apt/sources.list apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7FA3303E apt update exit
-
Install the required libraries and tools:
sudo apt update sudo apt install \ gcc \ v4l-utils \ i2c-tools \ raspi-config \ python3-dev \ python3-setuptools \ python3-venv \ libopencv-dev \ piracer-py
-
If you choose Ubuntu, mount the boot partition:
mount /dev/mmcblk0p1 /boot/
-
Enable I2C and Camera using the 'raspi-config' tool:
- i2c: Interface Options > I2C
- Camera: Interface Options > Camera
Afterwards, reboot the Raspberry Pi:
sudo reboot
-
Install the piracer-py package:
cd ~ mkdir piracer_test/ cd piracer_test/ python3 -m venv venv source venv/bin/activate pip install piracer-py
After following these steps, you can try the example code provided in the link.
- basic_example.py: Operating throttle and steering.
- rc_example.py: Check the Controller (Check Connect, Throttle, Steering works correctly)
![](https://private-user-images.githubusercontent.com/55338823/255834128-f459b2e5-dbe7-48ee-a0ef-824d6a074ca3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNDE4NTksIm5iZiI6MTczOTE0MTU1OSwicGF0aCI6Ii81NTMzODgyMy8yNTU4MzQxMjgtZjQ1OWIyZTUtZGJlNy00OGVlLWEwZWYtODI0ZDZhMDc0Y2EzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDIyNTIzOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkzOTljZjcyY2Q5OWRiN2I3ZGU1ZjMzY2RjYzAzNDYzM2QyODkxNmQyYzcyODQ5MWUyMWFiMDA3MDVkMGJmZTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pqw8CCkkYYXmo-Q2M9LPgHk17rCQYg38JmhP9rvP4Co)
- camera_grab_example.py: Check the Camera.
-
basic_example.py
- Test pi-racer operating well
- Moving Forward - Backward - left -right - sleep
-
camera_grab_example.py
- Test pi-racer camera working well
- After working this file, if you get some image and it operates correctly
-
rc_example.py
- Control the pi-racer using controller
-
shutdown.py
- Stop movement of pi-racer