Add Dockerfile and run script for Webots integration; update package dependencies

This commit is contained in:
Даниил Грабарь
2026-05-18 17:53:02 +03:00
parent 8d27c01b92
commit 06c50616b4
8 changed files with 93 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
FROM evilfisru/ros:jazzy-base-noble
ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
ENV WEBOTS_HOME=/usr/local/webots
ENV LIBGL_ALWAYS_SOFTWARE=1
ENV GALLIUM_DRIVER=llvmpipe
# X11 utilities and Mesa software renderer
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
libx11-6 \
x11-utils \
libglu1-mesa \
libgl1-mesa-dri \
mesa-utils \
libegl-mesa0 \
&& rm -rf /var/lib/apt/lists/*
# Install Webots R2025a (compatible with ros-jazzy-webots-ros2)
RUN wget -q https://github.com/cyberbotics/webots/releases/download/R2025a/webots_2025a_amd64.deb \
-O /tmp/webots.deb && \
apt-get update && \
apt-get install -y /tmp/webots.deb && \
rm /tmp/webots.deb && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-jazzy-rmw-cyclonedds-cpp \
# ros-jazzy-webots-ros2-control \
python3-pil \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /ros2_ws
COPY src/ src/
RUN apt-get update && \
rosdep install --from-paths src -i -r -y && \
rm -rf /var/lib/apt/lists/*
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
colcon build --mixin release
RUN echo ". /ros2_ws/install/setup.bash" >> /root/.bashrc
CMD ["bash"]
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
# Run the Webots container with X11 forwarding.
# Usage:
# ./run.sh — interactive shell
# ./run.sh ros2 launch iiwa_bringup webots_spawn.launch.py ...
IMAGE="${WEBOTS_IMAGE:-evilfisru/lwc:jazzy-webots}"
# Allow local Docker processes to connect to the X server
xhost +local:docker > /dev/null
docker run -it --rm \
--name ros-webots \
--network host \
-e DISPLAY="${DISPLAY}" \
-e QT_X11_NO_MITSHM=1 \
-e LIBGL_ALWAYS_SOFTWARE=1 \
-e GALLIUM_DRIVER=llvmpipe \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
"${IMAGE}" \
"$@"