PiController

This project is a controller aimed at raspberry pi operated robots. I will use this solution for my Pi Car and an AI drone I am currently building, but honestly, this will not really change our PiController project too much as it will just call different functions at the end, I am only interested in transferring messages and the overall architecture for now.

I initially got this idea when I did my chat Smart project, then I used the bare socket library so that I could understand the concepts related to socketing. For this project instead, I used a library called ZeroMQ which makes things 100 times easier for me.

This is the initial and most basic architecture I will use for the project. I actually made a multi-server client that can connect to multiple servers but I won’t really use it and only did it for practice. Looking at the architecture we can see that there are two main processes happening between our client and server: requests and replies. Ideally, our raspberry will be located on the car and will act as the server, we will then connect to it through the client on our pc. An example is sending the “forward” request and receiving a reply of “action completed” after the server has received and fulfilled our request.

PathMaker GUI

Another important aspect of this project is the GUI, as there are several modes that can be used on the controller. the first one being “PathMaker” where you are able to code a list of commands just like a simple Python Turtle script and then the car will execute those lines in order. It was actually quite tricky making this interface and then transferring the list to the server when the run button is clicked.

The second mode is RTC (Real-time communication). I need this when controlling the car manually to speed up reaction time to both commands and errors. This is the part of the project I still need to do because I need to find a library to help me do this in Python.

The architecture of the project is as follows:

This way the server/client remain the same even on different robots while changing all the rest to suit our needs.

Although close to the end this is still work in progress as I need to add the real-time communication method for optimising remote control functions.

All of the code I wrote can be found in the Github repository here:

This is the directory where I am currently working, there will be a lot of files added and changed in the future, most will be just test files or random stuff related to the project, sorry for any confusion…

Leave a Reply

Your email address will not be published. Required fields are marked *