Compile the interface

Hello, it’s me again. I have managed to change the aspect of the web UI, using Visual Studio Code and the uncompressed archive of the Leo OS.

To try my advances, I wanted to implement it to the Leo OS but I can’t find a way to compile it so I can flash to the Raspberry.

In short, how do I compile my custom OS ? Is it the way to change the UI and the commands of the robot to, for example, implement autonomous driving ?

Thanks in advance for your response .

Hi, sorry for a late reply.

To build LeoOS, you need to have the image-builder tool installed, which runs on a Ubuntu system (a dockerized version is in progress).

Clone the leo_os repository. Modify the stages to your needs, then type on the terminal:

sudo image-builder

This should start the build process which might require at least 20GB of free disk space and will take up to 3 hours (depending on your computer).

If you want to add some things on top of the full image, you can add an additional stage (e.g. stage5 directory) with the EXPORT_IMAGE file. Create empty SKIP_IMAGES files inside stage3 and stage4 to skip image exporting for these stages. Then, type:

sudo image-builder -c -f 5

This should continue the build process from stage5 using your previous work.

Is there a specific reason you want to generate the whole image with your modifications, instead of just booting the standard image and uploading the modified interface via, for example, SSH ?

In case you just want to upload a modified Web UI to the running system, then upload the whole directory containing the UI to your home directory on the robot (if you don’t know how, this tutorial might be helpful).
Then, you need to edit the configuration of the HTTP server (nginx) to host your custom UI instead of the default one:

sudo nano /etc/nginx/sites-enabled/leo_ui

Change the line containing the root directive:

root /opt/leo_ui    ->    root /home/pi/leo_ui

Save the file and restart nginx by typing:

sudo systemctl restart nginx

Thanks, that is what I wanted, trying it right away