tonykolomeytsev / youbot_devcontainer

A simple Docker container for building projects for KUKA youBot.
0 stars 1 forks source link
docker kuka youbot

youBot devcontainer

A simple Docker container for building projects for KUKA youBot.

The Docker image tonykolomeytsev/youbot:devcontainer already has all the necessary dependencies for building projects for KUKA youBot, including the YouBotDriver library.

The image based on Ubuntu-20.04 and uses my own a bit modified fork of the youbot/youbot_driver sources. This image has no ROS support, but it is easy to implement.

What the heck is that?

You can now write scripts for the robot on any computer, with any OS. At the same time, you can enjoy hints, docs and IntelliSense.

The simplest way to use

1. Install Docker

2. Pull the youBot-ready Docker image

For each OS just run in terminal:

docker pull tonykolomeytsev/youbot:devcontainer

Btw on Windows 10/11 it is better to use PowerShell to run docker commands

3. Run Docker container and mount volumes

Most likely, you would like your projects to be stored locally on your computer and not disappear when docker is shut down. Therefore, you need to create a folder for youBot projects in a convenient place, for example:

And then:

4. Create your first project

Great, after all these manipulations, we have a working container with Ubuntu and installed dependencies for youBot inside.

To create a new project for youBot, which consists of template CMakeLists.txt and src/main.cpp, you need to go inside the container:

docker exec -it bash youbot

Inside the container, run the command youbot_new_project <project_name> to create a new project.

youbot_new_project laba_omr_3

Congratulations, your project is located inside the /root/workspace/omr_laba_3/ folder. All project files will also be in your ~/YouBotProjects folder.

For details run

cat /usr/local/bin/youbot_new_project

5. Open project in Visual Studio Code

Install Remote - Containers plugin in VSCode.

Then click on the green button at the bottom left in the VSCode.

Select Attach to Running Container... option.

And select the container you started earlier.

Wait for VSCode to load, then click File -> Open Folder... Select the folder with your project.

Specify the SDK for the project.

Install C++ Extension Pack and CMake Tools VSCode extensions inside the container and wait for installation.

Done.

6. Build the project and run

CMake is used to build the project. In the project tree, you should see CMakeLists.txt and main.cpp with basic initialization code.

Press F7 to build the project. Press Shift + F5 to run project without debugging. After a successful build, the ./bin folder will contain an executable file.

How to reuse

Once you're done with the project, just close VSCode and stop the container in docker (either via the terminal or via Docker Desktop).

Don't delete the container. When you want to return to it, just start it again and connect to it from VSCode. You only need to configure extensions in VSCode for each container once.

Limitations

Docker containers require a lot of RAM :(

Project status

The project is in progress and is being developed just for fun. Additional features will be added in the future.