Skip to content

Commit

Permalink
RVIZ docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus-D-Forte committed Nov 18, 2023
1 parent d630e70 commit 09bc635
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This image is based on the ros2 images and contains RVIZ2 for debugging.
FROM duna-nomad-base

# Clone rviz2 humble, build and clean up.
RUN printf 'repositories:\n ros2/rviz:\n type: git\n url: https://github.com/ros2/rviz.git\n version: humble' > ${ROS_EXTRA_ROOT}/rviz2.repo && \
cd ${ROS_EXTRA_ROOT} && mkdir src && vcs import src < rviz2.repo && \
apt update && source ${ROS_BASE_INSTALL} && rosdep install -y --from-paths src --ignore-src && \
source ${ROS_BASE_INSTALL} && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release && \
echo "source ${ROS_EXTRA_ROOT}/install/setup.bash" >> /root/.bashrc && \
rm -rf ${ROS_EXTRA_ROOT}/src && \
rm -rf /var/lib/apt/lists/* && \
apt-get autoremove -y && apt-get clean

ENV DISPLAY=:0
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,17 @@ This repository contains the tools for generating a docker image for developing
## Commands
`docker build . -t duna-nomad-base` for Jetson
`docker build . -t duna-nomad-base -f Dockerfile.amd64` for x86
`docker build . -t duna-nomad-base-testing -f Dockerfile.testing`


## Running the test container.
The test container has rviz2 installed. To use it, we have to stream GUI apps to the host.
Reference: https://janert.me/guides/running-gui-applications-in-a-docker-container/

Allow connection to Xserver
1. (on host): `xhost +local:`

Run image with bind mounts.

2. (on host) `docker run --rm --net host -v /tmp/.X11-unix:/tmp/.X11-unix -it duna-nomad-base-testing`

0 comments on commit 09bc635

Please sign in to comment.