diff --git a/Dockerfile_Ubuntu2004 b/Dockerfile_Ubuntu2004 new file mode 100644 index 000000000..187230bf4 --- /dev/null +++ b/Dockerfile_Ubuntu2004 @@ -0,0 +1,90 @@ +# base image Ubuntu 20.04 +FROM ubuntu:focal + +ENV DEBIAN_FRONTEND=noninteractive + +ARG CODE_DIR=/usr/local/src + +#basic environment +RUN apt update && apt install -y \ + ca-certificates \ + build-essential \ + git \ + cmake \ + cmake-curses-gui \ + libace-dev \ + libassimp-dev \ + libglew-dev \ + libglfw3-dev \ + libglm-dev \ + libeigen3-dev + +# Suggested dependencies for YARP +RUN apt update && apt install -y \ + qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev \ + qml-module-qtquick2 qml-module-qtquick-window2 \ + qml-module-qtmultimedia qml-module-qtquick-dialogs \ + qml-module-qtquick-controls qml-module-qt-labs-folderlistmodel \ + qml-module-qt-labs-settings \ + libqcustomplot-dev \ + libgraphviz-dev \ + libjpeg-dev \ + libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-libav + +# Add Metavision SDK 3.0 in sources.list +RUN echo "deb [arch=amd64 trusted=yes] https://apt.prophesee.ai/dists/public/b4b3528d/ubuntu focal sdk" >> /etc/apt/sources.list &&\ + apt update + +RUN apt install -y \ + libcanberra-gtk-module \ + mesa-utils \ + ffmpeg \ + libboost-program-options-dev \ + libopencv-dev \ + metavision-sdk + +# YCM +ARG YCM_VERSION=v0.15.2 +RUN cd $CODE_DIR && \ + git clone --depth 1 --branch $YCM_VERSION https://github.com/robotology/ycm.git && \ + cd ycm && \ + mkdir build && cd build && \ + cmake .. && \ + make -j `nproc` install + +# YARP +ARG YARP_VERSION=v3.8.0 +RUN cd $CODE_DIR && \ + git clone --depth 1 --branch $YARP_VERSION https://github.com/robotology/yarp.git &&\ + cd yarp &&\ + mkdir build && cd build &&\ + cmake .. &&\ + make -j `nproc` install + +EXPOSE 10000/tcp 10000/udp +RUN yarp check + + +# event-driven +ARG ED_VERSION=master +RUN cd $CODE_DIR &&\ + git clone --depth 1 --branch $ED_VERSION https://github.com/robotology/event-driven.git &&\ + cd event-driven &&\ + mkdir build && cd build &&\ + cmake .. &&\ + make -j `nproc` install + +# Add User ID and Group ID +ARG UNAME=event-driven +ARG UID=1000 +ARG GID=1000 +RUN groupadd -g $GID -o $UNAME +RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME + +# Change user and working directory +USER $UNAME +WORKDIR /home/${UNAME} \ No newline at end of file diff --git a/Dockerfile_Ubuntu2204 b/Dockerfile_Ubuntu2204 new file mode 100644 index 000000000..a85eb951a --- /dev/null +++ b/Dockerfile_Ubuntu2204 @@ -0,0 +1,90 @@ +# base image Ubuntu 22.04 +FROM ubuntu:jammy + +ENV DEBIAN_FRONTEND=noninteractive + +ARG CODE_DIR=/usr/local/src + +#basic environment +RUN apt update && apt install -y \ + ca-certificates \ + build-essential \ + git \ + cmake \ + cmake-curses-gui \ + libace-dev \ + libassimp-dev \ + libglew-dev \ + libglfw3-dev \ + libglm-dev \ + libeigen3-dev + +# Suggested dependencies for YARP +RUN apt update && apt install -y \ + qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev \ + qml-module-qtquick2 qml-module-qtquick-window2 \ + qml-module-qtmultimedia qml-module-qtquick-dialogs \ + qml-module-qtquick-controls qml-module-qt-labs-folderlistmodel \ + qml-module-qt-labs-settings \ + libqcustomplot-dev \ + libgraphviz-dev \ + libjpeg-dev \ + libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-libav + +# Add Metavision SDK 4.6 in sources.list +RUN echo "deb [arch=amd64 trusted=yes] https://apt.prophesee.ai/dists/public/baiTh5si/ubuntu jammy sdk" >> /etc/apt/sources.list &&\ + apt update + +RUN apt install -y \ + libcanberra-gtk-module \ + mesa-utils \ + ffmpeg \ + libboost-program-options-dev \ + libopencv-dev \ + metavision-sdk + +# YCM +ARG YCM_VERSION=v0.15.2 +RUN cd $CODE_DIR && \ + git clone --depth 1 --branch $YCM_VERSION https://github.com/robotology/ycm.git && \ + cd ycm && \ + mkdir build && cd build && \ + cmake .. && \ + make -j `nproc` install + +# YARP +ARG YARP_VERSION=v3.8.0 +RUN cd $CODE_DIR && \ + git clone --depth 1 --branch $YARP_VERSION https://github.com/robotology/yarp.git &&\ + cd yarp &&\ + mkdir build && cd build &&\ + cmake .. &&\ + make -j `nproc` install + +EXPOSE 10000/tcp 10000/udp +RUN yarp check + + +# event-driven +ARG ED_VERSION=master +RUN cd $CODE_DIR &&\ + git clone --depth 1 --branch $ED_VERSION https://github.com/robotology/event-driven.git &&\ + cd event-driven &&\ + mkdir build && cd build &&\ + cmake .. &&\ + make -j `nproc` install + +# Add User ID and Group ID +ARG UNAME=event-driven +ARG UID=1000 +ARG GID=1000 +RUN groupadd -g $GID -o $UNAME +RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME + +# Change user and working directory +USER $UNAME +WORKDIR /home/${UNAME} \ No newline at end of file diff --git a/documentation/docker.md b/documentation/docker.md new file mode 100644 index 000000000..109ede552 --- /dev/null +++ b/documentation/docker.md @@ -0,0 +1,52 @@ +## Setup docker environment +### Check udev rules in your host environment +``` +ls /etc/udev/rules.d -alh + +# If you don't have `88-cyusb.rule` and `99-evkv2.rules` in this folder, +# Add them with following commands +# Otherwise, you can skip these commands +sudo wget -P /etc/udev/rules.d https://raw.githubusercontent.com/prophesee-ai/openeb/main/hal_psee_plugins/resources/rules/88-cyusb.rules +sudo wget -P /etc/udev/rules.d https://raw.githubusercontent.com/prophesee-ai/openeb/main/hal_psee_plugins/resources/rules/99-evkv2.rules + +# Reload udev rules in your host environment +sudo udevadm control --reload-rules +sudo udevadm trigger +``` + +### Check hardware configuration +Firmware +- To use later version of Metavision SDK than V3.1.2, the Firmware of EVK3 and EVK4 is required to be at least in version 3.9 + - Check this [Release Notes](https://docs.prophesee.ai/stable/release_notes.html#v3-1-2-change-logs-16-12-2022) + +How to upgrade EVK firmware +- [EVK3](https://support.prophesee.ai/portal/en/kb/articles/evk3-upgrade-procedure) +- [EVK4](https://support.prophesee.ai/portal/en/kb/articles/evk4-upgrade-procedure) + +Ubuntu version +- To use Ubuntu 22.04, Metavision SDK should be at least in version 4.0 + - This means firmware should be at least in version 3.9 +- The earlier version of Metavision SDK than 4.0 does not support Ubuntu 22.04. + - Should use Ubuntu 20.04 + +### Build docker image +Environment: Ubuntu 20.04 + Metavision SDK 3.0 + EVK firmware (< 3.9) +``` +docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -f Dockerfile_Ubuntu2004 -t event-driven:ubuntu20.04 . +``` +Environment: Ubuntu 22.04 + Metavision SDK 4.6 + EVK firmware (>= 3.9) +``` +docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -f Dockerfile_Ubuntu2204 -t event-driven:ubuntu22.04 . +``` +- Input current User ID and Group ID into Docker environment + +### Run and enter docker container +``` +docker run -it --privileged --network host -v /tmp/.X11-unix/:/tmp/.X11-unix -v /dev/bus/usb:/dev/bus/usb -e DISPLAY=unix$DISPLAY --name event-driven event-driven:ubuntu20.04 +``` +- To use Ubuntu 22.04, change the last part of command to `event-driven:ubuntu22.04`. + +### Open X Server for docker environment +``` +xhost local:docker +```