diff --git a/docker/.dockerignore b/docker/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..94143827ed065ca0d7d5be1b765d255c5c32cd9a --- /dev/null +++ b/docker/.dockerignore @@ -0,0 +1 @@ +Dockerfile diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..52a1979077056ba66dd6428bd48c1e5916a73777 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,87 @@ +FROM ros:noetic-ros-core + +RUN sed -i 's/^deb/deb [trusted=yes]/' /etc/apt/sources.list.d/ros1-latest.list + +# update and install dependencies +RUN apt-get update && apt-get upgrade -y && apt-get install -y \ + python3-osrf-pycommon \ + python3-catkin-tools \ + build-essential \ + protobuf-compiler \ + libprotobuf-dev \ + python3-rosdep \ + tree + +# update rosdep dependencies manually to speed up process +RUN apt-get install -y \ + ros-noetic-gazebo-msgs \ + libsdformat9-dev \ + ros-noetic-gazebo-ros \ + ros-noetic-xacro \ + ros-noetic-tf2 \ + ros-noetic-moveit-ros-planning-interface \ + ros-noetic-franka-gripper \ + ros-noetic-controller-manager \ + ros-noetic-effort-controllers \ + ros-noetic-gazebo-plugins \ + ros-noetic-gazebo-ros-control \ + ros-noetic-joint-state-controller \ + ros-noetic-joint-state-publisher \ + ros-noetic-joint-trajectory-controller \ + ros-noetic-robot-state-publisher \ + ros-noetic-tf \ + ros-noetic-moveit-simple-controller-manager \ + ros-noetic-moveit-core \ + ros-noetic-moveit-ros-perception \ + ros-noetic-moveit-visual-tools \ + ros-noetic-controller-interface \ + ros-noetic-hardware-interface \ + ros-noetic-moveit-ros-move-group \ + ros-noetic-moveit-fake-controller-manager \ + ros-noetic-moveit-kinematics \ + ros-noetic-moveit-planners-ompl \ + ros-noetic-moveit-ros-visualization \ + ros-noetic-joint-state-publisher-gui \ + ros-noetic-libfranka \ + ros-noetic-franka-ros + +RUN apt-get install -y \ + libnng1 libnng-dev + + +RUN apt-get update && apt-get install git-all -y + +ENV HOME /home/user +RUN useradd --create-home --home-dir $HOME user && chmod -R u+rwx $HOME && chown -R user:user $HOME +RUN rosdep init + +USER user + +RUN mkdir -p ${HOME}/work_dir +COPY --chown=user:user . ${HOME}/work_dir/ + +RUN rosdep update + +# temporary switch to root to be able to install the ROS package dependencies of the workspace +USER root +RUN rosdep install --from-paths ${HOME}/work_dir/ -i -y -r +USER user + +RUN ls -al /home/user +WORKDIR ${HOME}/work_dir + +RUN git clone --recurse-submodules -b ccnc-demo https://git-st.inf.tu-dresden.de/ceti/ros/ccf/ccf_workspace.git +RUN pwd && ls + + +RUN echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc +RUN /bin/bash -c "source /opt/ros/noetic/setup.bash && \ + cd ~/work_dir/ccf_workspace/ && \ + catkin build" +RUN echo "source ~/work_dir/ccf_workspace/devel/setup.bash" >> ~/.bashrc + +EXPOSE 6576/tcp + +RUN ls -l + +ENTRYPOINT ["./launch.sh"] diff --git a/docker/launch.sh b/docker/launch.sh new file mode 100755 index 0000000000000000000000000000000000000000..fb5574383351582cab90a7f92c73494518714091 --- /dev/null +++ b/docker/launch.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo Running Main Controller with parameters: "$@" +source ~/work_dir/ccf_workspace/devel/setup.bash + +if [ $1 -eq 1 ] +then +roslaunch ccf_immersive_sorting main_controller_virtual_preview_ceti-table-$1_real_robot.launch mqtt_server:=tcp://$2 connection_address:=tcp://$3 robot_ip:=$4 +else +roslaunch robot-cell_ceti-table-$1.launch mqtt_server:=tcp://$2 robot_ip:=$4 +fi diff --git a/docker/manual.md b/docker/manual.md new file mode 100644 index 0000000000000000000000000000000000000000..7ff874abcb8e6da12d8900826a4e72307fa7a2db --- /dev/null +++ b/docker/manual.md @@ -0,0 +1,15 @@ +# Docker Manual + +## Building an running the demo locally + +* Building the container: ```docker build .``` +* Running the conainer: ```docker run -it --ulimit rtprio=99 --cap-add=sys_nice --network host <containerName> <robotId> <mqttAddress> <nngAddress> <robotIP>``` +* Example: ```docker run -it --ulimit rtprio=99 --cap-add=sys_nice --network host 70fef7e9a389 1 127.0.0.1:2000 *:6576 172.31.1.13``` + +## Running the demo from the registry + +* ```docker run -it --ulimit rtprio=99 --cap-add=sys_nice --network host git-st.inf.tu-dresden.de:4567/ceti/ros/ccf/ccf_workspace:ccnc <robotId> <mqttAddress> <nngAddress> <robotIP>``` + +## Material + +* Docker realtime options: https://docs.docker.com/config/containers/resource_constraints/#configure-the-docker-daemon