Skip to content

ADD scripts for UR version 3.7.0.40195 #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions universal-robot-simulator/3.7.0.40195/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
FROM jacknlliu/ubuntu-init:14.04

LABEL maintainer="Jack Liu <jacknlliu@gmail.com>"

# setup environment
ENV DEBIAN_FRONTEND noninteractive

# setup locale
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8

# install system packages
RUN apt-get update -y \
&& apt-get install -y -q --no-install-recommends apt-transport-https aptitude

# install essential tools
RUN aptitude install -y -q -R bash-completion wget vim git tmux terminator xauth openssh-server runit sudo software-properties-common python-software-properties debconf-utils policykit-1 xterm \
\
lib32stdc++6 lib32gcc1 libjava3d-java libcurl3:i386\
# setup ssh
&& mkdir -p /var/run/sshd && echo "X11UseLocalhost no" >> /etc/ssh/sshd_config \
\
# install URSim prerequisite
&& dpkg --add-architecture i386 && aptitude update -y \
&& aptitude install -y -q -R openjdk-8-jre openjdk-8-jdk libxmlrpc-c++8:i386 \
&& echo "JAVA_HOME=\"/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java\"" >> /etc/environment

#RUN apt-get update && apt-get -y upgrade && apt-get -y install software-properties-common && add-apt-repository ppa:webupd8team/java -y && apt-get update
#RUN (echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections) && apt-get install -y oracle-java8-installer oracle-java8-set-default
#ENV JAVA_HOME /usr/lib/jvm/java-8-oracle


#ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
#ENV PATH $JAVA_HOME/bin:$PATH

# set default java environment variable
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
RUN add-apt-repository ppa:openjdk-r/ppa -y && \
apt-get update && \
apt-get install -y --no-install-recommends openjdk-8-jdk && \
rm -rf /var/lib/apt/lists/*

# install intel graphics driver
RUN aptitude install -y -q -R libgl1-mesa-glx libgl1-mesa-dri \
\
# install amd graphics open source driver
&& aptitude install -y -q -R mesa-vdpau-drivers xserver-xorg-video-ati mesa-utils module-init-tools

# we should fix AMD graphics driver with image driver extension not found in ubuntu 14.04.2, refrence: https://wiki.ubuntu.com/Kernel/LTSEnablementStack#Ubuntu_14.04_LTS_-_Trusty_Tahr
# && aptitude install -y -q -R linux-generic-lts-xenial xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial

# set user ros and sudo
RUN adduser --gecos "URSim User" --home /home/ursim --disabled-password ursim \
&& usermod -a -G dialout ursim \
&& echo "ursim ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/99_aptget \
&& mkdir -p /opt/ursim

# install ursim
COPY scripts/install_ursim.sh /opt/ursim/
RUN chmod -R a+rx /opt/ursim && sync && /opt/ursim/install_ursim.sh "/opt/ursim/" "ursim" && rm -f /opt/ursim/install_ursim.sh && chmod -R a+rwx /opt/ursim

COPY scripts/my_init /sbin/my_init
COPY scripts/setuser /sbin/setuser
RUN chmod +x /sbin/my_init && chmod +x /sbin/setuser

# aptitude clean
RUN apt-get autoclean \
&& apt-get clean all \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* /var/tmp/*

ENV PATH /opt/ursim/ursimpkg:$PATH
ENV URSIM_ROOT /opt/ursim/ursimpkg

# redefine env for my_init
RUN mkdir -p /etc/container_environment \
&& echo "JAVA_HOME=\"/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java\"" >> /etc/container_environment/JAVA_HOME \
&& echo "PATH=\"/opt/ursim/ursimpkg:$PATH\"" >> /etc/container_environment/PATH \
&& echo "URSIM_ROOT=\"/opt/ursim/ursimpkg\"" >> /etc/container_environment/URSIM_ROOT

USER root
WORKDIR /opt/ursim/ursimpkg
# /sbin/my_init should be launched by root user
##ENTRYPOINT ["/sbin/my_init", "--quiet", "--", "setuser", "ursim"]
CMD ["bash"]
18 changes: 18 additions & 0 deletions universal-robot-simulator/3.7.0.40195/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Universal Robot Simulator

**NOTE:** This image just for research. All rights of the offline simulator applications belong to [Universal Robots A/S](https://www.universal-robots.com).


## Usage
```
docker run -it --security-opt label=disable \
--device /dev/dri --env="DISPLAY" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
-p 30001-30004:30001-30004 \
--name="ursim" mhofma/ursim:3.4.1-59 start-ursim.sh UR5
```

## Build
docker build . -t mhofma/ursim:3.4.1-59
docker run -it --rm --security-opt label=disable -e DISPLAY=192.168.20.125:0.0 --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --privileged -p 29999-30004:29999-30004 -p 502:502 --name="ursim" mhofma/ursim:3.4.1-59 start-ursim.sh UR10

29 changes: 29 additions & 0 deletions universal-robot-simulator/3.7.0.40195/scripts/install_ursim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#! /bin/bash
set -e \
&& export UR_DOWNLOAD_SITE="https://s3-eu-west-1.amazonaws.com/ur-support-site/44059/URSim_Linux-3.7.0.40195.tar.gz" \
&& export URSIMVERSION="3.7.0.40195" \
&& export INSTALL_DIR=$1 \
&& export URSIM_USER=$2 \
&& echo "INSTALL_DIR: $INSTALL_DIR \n URSIM_USER: $URSIM_USER" \
\
&& echo "install ursim" > /dev/null \
&& cd $INSTALL_DIR && wget -q -O ursim.tar.gz ${UR_DOWNLOAD_SITE} && tar -xvzf ursim.tar.gz && mv ursim-${URSIMVERSION} ursimpkg && cd ursimpkg \
\
&& echo "delete 56 lines for not installing java7" > /dev/null \
&& sed -i '56c \\t echo \"just ignore install java7\" ' ./install.sh \
&& echo "delete 49-50 lines for no xterm exit" > /dev/null \
&& sed -i '49,50c \\t echo \"just ignore xterm warning\" ' ./install.sh \
&& sed -i 's/pkexec bash -c/bash -c/g' ./install.sh \
&& sed -i 's/apt-get -y install/apt-get -y install -q --no-install-recommends/g' ./install.sh \
&& sed -i '85,$d' ./install.sh \
&& sed -i 's/libcurl3/libcurl3:i386/g' ./install.sh \
&& sed -i 's/fonts-ipafont//g' ./install.sh \
&& sed -i 's/fonts-baekmuk//g' ./install.sh \
&& sed -i 's/fonts-nanum//g' ./install.sh \
&& sed -i 's/fonts-arphic-uming//g' ./install.sh \
&& sed -i 's/fonts-arphic-ukai//g' ./install.sh \
&& echo "echo \" installation done! \"" >> ./install.sh \
&& ./install.sh \
&& cd .. && rm -f ./ursim.tar.gz \
&& chown -R $URSIM_USER:$URSIM_USER ursimpkg \
&& chmod a+rx ursimpkg/URControl
Loading