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.
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.
If you are using Windows 10/11 or Mac OS, install Docker Desktop: https://www.docker.com/get-started/
If you are using a Linux distribution, I think you know how to install docker. But anyway, here is an example installation instruction for Ubuntu: https://docs.docker.com/engine/install/ubuntu/
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
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:
%USERPROFILE%\YouBotProjects
~/YouBotProjects
And then:
For Windows and Mac OS users:
Run Docker Desktop and find the tonykolomeytsev/youbot
image, press Run
button.
In the dialog that appears, specify the Container name
. In the Volumes
section, in the Host path
field, specify the path to the folder where projects for youbot will be stored. In the Container path
field write /root/workspace
.
To make sure your container is running, go to the Containers tab.
For Linux users:
Start the docker container:
docker run --name youbot -itd -v <youbot_projects_path>:/root/workspace tonykolomeytsev/youbot:devcontainer
WIth option --name
specify the container name. With option -v
specify the path to the folder where projects for youbot will be stored and /root/workspace
for container path.
Options -i
, -t
, is for... you wil read in docker run --help
. Option -d
to not go inside the container.
To make sure your container is running, run in terminal:
docker ps
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
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.
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.
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.
Docker containers require a lot of RAM :(
The project is in progress and is being developed just for fun. Additional features will be added in the future.