@@ -53,17 +53,46 @@ programming mistakes is what we really need to worry about.
In the interest of time, the library is shipped as a Docker image.
To oversimplify, Docker is virtualisation software which allows
one to programatically set up a Linux virtual machine.
After installing Docker, navigate to this project's directory in your CLI.
Then:
TODO: add volume mounting (copy Marcus' approach with a user and /home/user/) and networking (put it to host)
A virtual machine is a emulation of a full computer, and it runs similarly to other
programs on the host machine (your computer and its OS).
By default, the virtual machine has no information about the host machine - it is as if
you had a different computer sitting on your desk. For our purposes, some sharing will be necessary.
This includes things like internet access and sharing of files and folders.
A docker image is specification of a virtual machine,
while a docker container is an instance of that machine (similar to classes and objects
in programming). You can have multiple containers running the same image.
A Dockerfile is a specific kind of file where a Docker image is defined.
The Dockerfile provided in this repository will create an image with all the software
needed to simulate and use the UR robot.
If you want to install additional software within your Docker, you will need to either update
the Dockerfile and re-build the image, or use a persistent container, otherwise
all of the installed software will be deleted when you close the container
(as it happens on university computers). More on that later.
Here are the steps to get to your container running:
1. install wsl with "wsl --install" in powershell administrator, more at https://learn.microsoft.com/en-us/windows/wsl/install
2. install docker on windows (with wsl option, should be default)
3. create the docker accout
4. open docker desktop, navigate to Settings (by user/account button) -> Resources -> Network -> click on enable host networking
4. open wsl (type wsl in powershell) and navigate to git folder (now in wsl) with cd /mnt/Users/YOURUSERNAME/PATH_TO_GIT_FOLDER
5. build the image with "docker build -t ur_simple_control ."
6. to run the image FIRST RUN "xhost +" EVERY TIME, THEN RUN "docker run --rm -it --net=host -e DISPLAY=$DISPLAY -v /tmp:/tmp ur_simple_control /bin/zsh"
7. verify installation by running an example with --visualize-manipulator and --real-time-plotting arguments
5. open wsl (type wsl in powershell) and navigate to git folder (now in wsl) with "cd /mnt/Users/YOURUSERNAME/PATH_TO_GIT_FOLDER"
6. build the image with "docker build -t ur_simple_control ."
7. to run the image FIRST RUN "xhost +" EVERY TIME, THEN RUN "docker run --rm -it --net=host -e DISPLAY=$DISPLAY -v /tmp:/tmp ur_simple_control /bin/zsh"
8. verify installation by running an example with --visualize-manipulator and --real-time-plotting arguments
9. if you want to make persistent changes to the code from the docker, you need to use the -v argument in docker run to share the folder
with the code between your native OS (host) and the docker container.
in particular, use -v [path_to_folder_on_host]:[path_to_that_folder_in_docker_container]:rw .
notice the :rw at the end. this allows for both the host and the container to modify the files (otherwise they will be read-only).
##### Installing additional software on the image
Install things as you would normally (using apt in the terminal etc).
To get this to be a part of the Docker image, just use
the RUN [...] command in the Dockerfile, where you replace [...] with the
command you used to install what you installed normally.
Don't forget to build the image to apply these changes!
I highly recommend adding software this way, because
it will allow you to share the exact same set-up between your colleagues,
which will help you avoid headaches in the future.
#### option 2) Native installation
1. Either create a disk partition for Ubuntu on your hard drive, or use an external hard drive. In the first case, you might need to shrink your existing partition. Searching for "how to create a disk partition [your_OS]" or "install ubuntu on [your_OS]" will get you all the information you need. Ideally, back up your data before any of this (you should be doing this in general as it's good practice).