Raspberry Pi 3 for the Second Time (8)
Install the donkey car software!
I finished building the hardware. I just needed to install the donkey car software on the micro SD card and slot that into Raspberry Pi.
But first, I had to install the Raspbian OS.
Two years ago, I installed Raspbian on Raspberry Pi. So, I had known what to do.
I went to the Raspberry Pi website and downloaded Raspbian Buster — the latest version.
And this was the wrong thing to do.
The donkey car doesn’t support Raspbian Buster. It supports the previous version, Raspbian Stretch. By the time I was working on the vehicle, Raspbian Buster had been only released less than a month ago.
So, I downloaded Raspbian Stretch and followed the instruction to copy the OS onto the micro SD card, which requires an SD card adapter.
Also, you’ll need an SD card reader (built-in or external).
What’s wrong with my SD card?
I found an SD card reader from a box full of junk cables at home, which is why I can’t throw away things. Even though they may not spark joys, a junk could be useful one day.
I connected the SD card reader to my Linux PC, but it did not recognize the SD card for some reason.
I searched for a solution on the internet for a while, but I couldn’t find a way to read the SD card or even format it.
I tried it on my Mac mini as well but in vain. I started suspecting something wrong with the SD card reader but that SD card reader was the only one I could find at home.
Should I go out and buy a new SD card reader? But how would I know that would fix the problem?
I suddenly remembered that my wife’s PC had Windows 10 and a built-in SD card reader. I borrowed it from her and inserted the SD card. I could access it!
I formatted the card, thanked my wife with a big smile, and went back to my Linux PC. Yes, I was able to copy Raspbian Stretch to it!
So, that was not a problem of the SD card reader. Then, what was? I have no idea why it worked until this date.
Boot up the Raspbian
I pushed the SD card into the Raspberry Pi’s SD card reader. It’s underneath and a bit hard to handle.
I connected the battery cable to Tamiya Mini Splitter connecting to the DC-DC voltage converter and ESC.
The Raspbian OS started booting up.
I had a small monitor that supports HDMI so I could see the boot sequence. Once the OS boots up well, you can remotely access it. So, a local monitor is not a must. But a monitor would be much more convenient as you can watch the boot sequence.
For that matter, I had a USB keyboard and mouse connected to Raspberry Pi.
I covered similar stuff in Raspberry Pi 3 for the First Time in more details.
I updated and upgraded the OS.
sudo apt-get update
sudo apt-get upgrade
Then, I enabled a few interfaces using the command:
I enabled I12C.
I enabled the camera support.
I finished the OS set up without any problems.
Donkey car software installation
The donkey car software uses the behavior cloning to control the car. As such, we need to train the machine learning model, which requires a lot of computing resources. So, the training is done on a PC (i.e., Linux machine) ideally with some GPU.
For training, we need to collect data which consists of camera image frames, speed levels, and the steering angles. As such, we need to manually and remotely drive the car to collect data.
So, installing the donkey car software allows me to drive the car using a remote controller.
I installed all the dependencies and cloned the donkey software.
git clone https://github.com/autorope/donkeycar
pip install -e .[pi]
I will not put all other details here as you can follow the actual instructions to set up the donkey car application on Raspbian, and the training environment on a host PC.
All in all, I was ready to drive the car.
The journey completes in part 9 of this series — watch me succeed … or not.
- Setup Raspbian, Robocarstore: https://docs.robocarstore.com/guide/robot_sbc/setup_raspberry_pi/
- Raspbian stretch: https://www.raspberrypi.org/blog/raspbian-stretch/
- Robocar store build instructions: https://docs.robocarstore.com
- Donkey car build instructions: http://docs.donkeycar.com