Build your own robot car with the Raspberry Pi!

Build your own robot car with the Raspberry Pi!

Now it’s time to compile the OpenBot app for your Android smartphone. If you are able to do that you have now understood the OpenBot process from chassis building to app development and you can get started. So I don’t want to lose many words here and we’ll start right away.

Android Studio – compile OpenBot app and transfer it to your smartphone

Open the Android Studio now and you should see the OpenBot app on the left side of the development project overview. Same as explained in the previous article. Now connect your smartphone via USB cable to your PC and check the smartphone display to see if the connection worked or if you need to confirm the connection. The Android Studio should now recognize your smartphone and display it in the upper right corner of the menu bar. You might get a message on your smartphone that debugging from the PC has to be allowed on your smartphone. The message looks like the following picture. You have to confirm this message with OK. To avoid this message appearing in the future activate the radio button “Always allow from this computer” so that you don’t have to press this confirmation again and again.

Android Smartphone Debugging zulassen

Android Smartphone Debugging zulassen

Your smartphone should now appear in the top right corner of the Android Studio menu bar. In my case it is “samsung SM-G950F” and in the following picture you can see how the menu bar should look like.

Android Studio initial build menue bar Samsung S8

Android Studio initial build menue bar Samsung S8

Does the menu bar in Android Studio look something like this with hopefully your smartphone. Everything will fit on your Android Studio and in the future your smartphone should be recognized automatically without your active doing it.

Note: If it didn’t work with the connection between Android Studio and your smartphone, disconnect the connection to your smartphone again and reconnect it. It helped me to press the button “Sync project with Gradle files” in the top right corner of the menu bar.

Compiling Android App

Next it should be possible to recompile the OpenBot Android app. To be sure that everything works, we will do a technical test run and compile the app once. Because we don’t change the existing neural network, we use the development status as we downloaded it from Git Hub. Normally you would replace the existing neural network in the file structure of the OpenBot app with your own newly created one and then recompile the app.

In the folder structure of the Andorid app, the neural networks are located here: <Your path>\android\app\src\main\assets\networks\…

The name of the neural network or the *.tflite file is “autopilot_float.tflite” and the neural network behind it with the name “AUTOPILOT_F” is already known from the OpenBot app on the smartphone. But how this is done and how we train our own good network I will describe in a probably last article of this series.

To recompile the app please click on the green play button right next to the drop down menu with the name of your own smartphone. From now on everything should run automatically and you should delete the old app on your smartphone and install the new one. You might have to confirm a dialog that you really want to replace the existing app on your smartphone but that should be it.

Android Studio compile app

Android Studio compile app

Now all puzzle pieces are finished, understood and you can fully participate in the OpenBot project.

Summary

If you’ve made it this far, then the fun really starts with learning how to create your own robust neural network that can safely control your robot car. You might have to practice driving a little bit more and record a lot of training data. Only with good training data you can train a good neural network that meets your requirements for navigation. In another and probably last article I will talk about my experiences and describe how I trained the neural network of the OpenBot.


Article Overview OpenBot robot cuto:

OpenBot – Your smartphone controls a robot car – Introduction
OpenBot – Your smartphone controls a robot car – needed parts part 1-2
OpenBot – Your smartphone controls a robot car – needed parts part 2-2
OpenBot – Your smartphone controls a robot car – constructing a chassis
OpenBot – Your smartphone controls a robot car – Wiring
OpenBot – Your smartphone controls a robot car – Flashing the Arduino firmware
OpenBot – Your smartphone controls a robot car – Android App and first test run
OpenBot – Your smartphone controls a robot car – Record training data
OpenBot – Your smartphone controls a robot car – Set up training environment
OpenBot – Your smartphone controls a robot car – train the neural network
OpenBot – Your smartphone controls a robot car – Setting up Android Studio and your Smartphone
OpenBot – Your smartphone controls a robot car – compile your own OpenBot Android app

Planned articles in this series:

OpenBot – Your smartphone controls a robot car – End-2-End run
(Visited 198 times, 1 visits today)