![]() |
Visual Servoing Platform version 3.7.0
|
Even with the detailed and tested Installation from source code tutorials, sometimes it is tough for people to get a system up and running with ViSP. That's why in this tutorial we explain how to get ready to use Docker images that contains ViSP source code with already build tests, examples and tutorials that you may just run to discover ViSP capabilities.
Our Docker images available on Docker Hub are around 1 GB in size (compressed size) and contain minimal things to discover and start to play with ViSP.
As mentioned here, to install Docker Engine on Ubuntu host using the repository, follow the instructions:
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
$ sudo apt-get update $ sudo apt-get install docker-ce docker-ce-cli containerd.io
In Docker Hub, we provide several ready-to-use Docker images that can be used on an Ubuntu or macOS host with ViSP already built. Instead, there is also the possibility to build docker images from a Dockerfile following instruction given in 4. Build docker image from Dockerfile section.
$ docker pull vispci/vispci:ubuntu-22.04
$ docker pull vispci/vispci:ubuntu-20.04
$ docker pull vispci/vispci:ubuntu-18.04
We suppose here that you cloned ViSP from github in your workspace.
Change directory to access the Dockerfile and build the corresponding docker image
$ cd $VISP_WS/visp/docker/ubuntu-24.04 $ docker build -t vispci/vispci:ubuntu-24.04 .
$ cd $VISP_WS/visp/docker/ubuntu-22.04 $ docker build -t vispci/vispci:ubuntu-22.04 .
$ cd $VISP_WS/visp/docker/ubuntu-20.04 $ docker build -t vispci/vispci:ubuntu-20.04 .
$ cd $VISP_WS/visp/docker/ubuntu-18.04 $ docker build -t vispci/vispci:ubuntu-18.04 .
$ xhost +local:docker non-network local connections being added to access control list
$ docker run --rm -it --network=host --privileged \
--env=DISPLAY \
--env=QT_X11_NO_MITSHM=1 \
--volume=/tmp/.X11-unix:/tmp/.X11-unix:rw \
--volume=/dev:/dev \
vispci/vispci:ubuntu-22.04
vispci@6c8d67579659:~$ pwd
/home/vispci
$ IP=$(/usr/sbin/ipconfig getifaddr en0) $ echo $IP $ 192.168.1.18
$ xhost + "$IP" 192.168.1.18 being added to access control list
$ docker run --rm -it --network=host --privileged \
--env=DISPLAY="${IP}:0" \
--env=QT_X11_NO_MITSHM=1 \
--volume=/tmp/.X11-unix:/tmp/.X11-unix:rw \
--volume=/dev:/dev \
vispci/vispci:ubuntu-22.04
vispci@6c8d67579659:~$ pwd
/home/vispci
$ docker run ... -it vispci/vispci:ubuntu-<version>
Within the container, ViSP workspace is installed in $HOME/visp-ws folder:
vispci@6c8d67579659:~$ ls $HOME/visp-ws visp visp-build visp-images
cd $HOME/visp-ws/visp; git pull
cd $HOME/visp-ws/visp-build; cmake ../visp; make -j$(nproc)
vispci@6c8d67579659:~$ cd $HOME/visp-ws/visp-build/tutorial/image vispci@6c8d67579659:~$ ./tutorial-viewer monkey.jpeg A click to quit...
If you are on an Ubuntu host, you are now ready to run binaries that require access to your camera.
vispci@6c8d67579659:~$ cd $HOME/visp-ws/visp-build/tutorial/grabber vispci@6c8d67579659:~$ ./tutorial-grabber-v4l2 Use device : 0 Recording : disabled Warning: cannot set input channel to 2 Image size : 640 480
or with this other tutorial
vispci@6c8d67579659:~$ ./tutorial-grabber-opencv Use device : 0 Recording : disabled
You are now ready to see the next Tutorial: How to create and build a project that uses ViSP and CMake on Unix or Windows that will show you how to use ViSP as a 3rd party to build your own project.