Skip to content
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

Container Support #119

Open
wants to merge 9 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
53 changes: 53 additions & 0 deletions CONTAINER_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Foreward

The work herein is primarily that of Rebecq et al, in the Acknowlegements section below. This fork simply impelements a dockerized version such that ESIM can be used on platforms without ROS Melodic.

## Suggested Installation

After cloning this repository, simply build the dockerfile as follows.

```bash
# where $(pwd) is /the/path/to/rpg_esim
podman build -t esim:melodic -f melodic.Dockerfile
```

Alternatively, build with docker (untested)

```bash
podman build -t esim:melodic -f melodic.Dockerfile
```

## Run

Then, simply run the container, source the setup file, and launch the renderer. Please refer to specific instructions to run a given simulator in [the original rpg_esim wiki](https://github.com/uzh-rpg/rpg_esim/wiki).

```bash
# On the host
# Running as root via rootless podman mitigates security risks that come with root access to xhost.
# Use with caution if you are not running rootless podman!
podman run --rm -ti -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/localtime:/etc/localtime:ro esim
```

```bash
# In the container
. /home/user/sim_ws/devel/setup.bash
roscd esim_ros
# Based on the suggested test renderer
roslaunch esim_ros esim.launch config:=cfg/example.conf
```

An alternative, 3D, rendering option is below.

### OpenGL Renderer

```bash
roscd esim_ros
roslaunch esim_ros esim.launch config:=cfg/opengl.conf
```

## TODO
- [x] Add a graphical run script for visualization compatibility as discussed in numerous forum posts like [this one](https://unix.stackexchange.com/questions/330366/how-can-i-run-a-graphical-application-in-a-container-under-wayland)

## Acknowledgements

Thank you to the [Robotics and Perception Group](https://rpg.ifi.uzh.ch/) for all of their hard work and open source implementations.
45 changes: 45 additions & 0 deletions http-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
repositories:
catkin_simple:
type: git
url: https://github.com/catkin/catkin_simple.git
version: master
ze_oss:
type: git
url: https://github.com/uzh-rpg/ze_oss.git
version: master
gflags_catkin:
type: git
url: https://github.com/ethz-asl/gflags_catkin.git
version: master
glog_catkin:
type: git
url: https://github.com/ethz-asl/glog_catkin.git
version: master
eigen_catkin:
type: git
url: https://github.com/ethz-asl/eigen_catkin.git
version: master
eigen_checks:
type: git
url: https://github.com/ethz-asl/eigen_checks.git
version: master
minkindr:
type: git
url: https://github.com/ethz-asl/minkindr.git
version: master
minkindr_ros:
type: git
url: https://github.com/ethz-asl/minkindr_ros.git
version: master
yaml_cpp_catkin:
type: git
url: https://github.com/ethz-asl/yaml_cpp_catkin.git
version: master
rpg_dvs_ros:
type: git
url: https://github.com/uzh-rpg/rpg_dvs_ros.git
version: master
assimp_catkin:
type: git
url: https://github.com/uzh-rpg/assimp_catkin.git
version: master
62 changes: 62 additions & 0 deletions melodic.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
FROM ros:melodic-ros-base

ARG DEBIAN_FRONTEND=noninteractive
ARG PROJ_PATH=/home/user/sim_ws
ARG ESIM_PATH=$PROJ_PATH/src/rpg_esim

# Installing some essential system packages
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 4B63CF8FDE49746E98FA01DDAD19BAB3CBF125EA
RUN apt-get update
RUN apt-get install -y \
python3-vcstool \
python3-catkin-tools \
python3-pip \
libproj-dev \
libglm-dev \
libopencv-dev \
ros-melodic-image-transport \
ros-melodic-cv-bridge \
autoconf \
libyaml-cpp-dev \
ros-melodic-eigen-conversions \
libtool \
ros-melodic-tf-conversions \
ros-melodic-tf \
ros-melodic-pcl-ros \
libglfw3-dev \
libassimp-dev \
ros-melodic-rviz

RUN apt-get clean autoclean &&\
rm -rf /var/lib/apt/lists/*

RUN python3 -m pip install -U pip

WORKDIR $PROJ_PATH
RUN catkin init
RUN catkin config --extend /opt/ros/melodic --cmake-args -DCMAKE_BUILD_TYPE=Release

RUN mkdir -p $ESIM_PATH
COPY ./ $ESIM_PATH
WORKDIR $PROJ_PATH/src
RUN vcs-import < $ESIM_PATH/dependencies.yaml

WORKDIR $PROJ_PATH/src/ze_oss
RUN touch \
imp_3rdparty_cuda_toolkit/CATKIN_IGNORE \
imp_app_pangolin_example/CATKIN_IGNORE \
imp_benchmark_aligned_allocator/CATKIN_IGNORE \
imp_bridge_pangolin/CATKIN_IGNORE \
imp_cu_core/CATKIN_IGNORE \
imp_cu_correspondence/CATKIN_IGNORE \
imp_cu_imgproc/CATKIN_IGNORE \
imp_ros_rof_denoising/CATKIN_IGNORE \
imp_tools_cmd/CATKIN_IGNORE \
ze_data_provider/CATKIN_IGNORE \
ze_geometry/CATKIN_IGNORE \
ze_imu/CATKIN_IGNORE \
ze_trajectory_analysis/CATKIN_IGNORE

WORKDIR $PROJ_PATH
RUN catkin build esim_ros
#ENTRYPOINT [". /home/user/sim_ws/devel/setup.bash"]