Skip to content

A simple Docker container for building projects for KUKA youBot.

Notifications You must be signed in to change notification settings

tonykolomeytsev/youbot_devcontainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • For Windows: %USERPROFILE%\YouBotProjects
  • For Mac OS and Linux: ~/YouBotProjects

And then:

  • For Windows and Mac OS users:

    Run Docker Desktop and find the tonykolomeytsev/youbot image, press Run button.

    Screenshot

    Docker Desktop Images Tab

    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.

    Screenshot

    Docker Desktop Images Tab

    To make sure your container is running, go to the Containers tab.

    Screenshot

    Docker Desktop Images 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

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.

About

A simple Docker container for building projects for KUKA youBot.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published