How to upgrade to Donkey Car 3.0 from Tawn’s repo

I have always been a fan of Tawn’s repo since I started Donkey Car. Recently Tawn joined the admin team and it looks like he has been committing primarily to the official repo. If you didn’t change anything in the source, you should just directly clone the latest version and follow the official guide to install donkey car on both your PC and Pi. If you are like me, changed some source and don’t want to merge them, read on.

Update the donkey car project source

First, change the working directory to your local donkey directory, e.g.

Set autorope as upstream and sync

Fetch the change

Merge the change

Now if you have made any changes, it might look like this. You need to fix the conflicts first.

Fire up VSCode and the conflict will be shown to you right away. After you fix the conflict, leave it for now and don’t commit the change yet.

Upgrade the d2 directory

Looks like Tawn has also changed the convention from using ~/d2 to ~/mycar as the path of the car app in 3.0. It’s up to you whether you want to stay with ~/d2 or follow the convention. To save trouble for compatibility later, I will switch to ~/mycar. As I also did some changes on the ~/d2 directory, I track the change by using git. If you haven’t done that, do it now.

Normally we won’t share this git repo and so just leave it as a local. No need to push it unless you want to.

Next, use the following line to create a car app

Copy the changes from mycar to d2. You may want to skip myconfig but I will just use review changes later on vscode

Fire up vscode again. Merge your change if necessary to the new code. Note that you may need to look for mycar keyword in the newly generated files if you want to stay using ~/d2 as the car app directory.

Recreate python environment

Since there are version changes in tensorflow and other library (presumably), we want to recreate the python environment. If you are using ubuntu, you can just follow the instructions below (copied from official doc).

If you are using other OS, follow the official doc.

If you have a GPU installed, use tensorflow-gpu

Test the installation on PC

There is a hidden camera class called ImageListCamera, which is excellent for testing the donkey source code on PC without a real camera. We will use that to test our local PC install.

Open under ~/mycar, add this line

For the ImageListCamera to work, you also need to provide a path to a tub of images you previously collected like this in

Should be all good now, test it by runing

Fire up http://localhost:8887/drive and you should be seeing this screen

Test Training

I ran into this error.

It seems to be a tensorflow issue and doing the following could fix it

Put this into your bash profile so it won’t appear again.

That’s it. If you encounter other error when upgrading to 3.0, let me know by commenting below.

Love Self-driving technology and machine learning. Community leader in DIYRobocar Hong Kong.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store