diff --git a/README.md b/README.md index befca41..0cbc598 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,15 @@ # neato_ros2 ROS2 interface to Neato vacuum robots + +# Docker +```bash +docker build -f docker/Dockerfile . -t neato + +docker run -it --net=host --ipc=host --privileged \ +--env="DISPLAY" \ +--env="QT_X11_NO_MITSHM=1" \ +--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \ +--volume="${XAUTHORITY}:/root/.Xauthority" \ +neato bash -c "ros2 launch neato_bringup neato.launch.py" +``` \ No newline at end of file diff --git a/Dockerfile b/docker/Dockerfile similarity index 94% rename from Dockerfile rename to docker/Dockerfile index 18ed04d..aa7c0fb 100644 --- a/Dockerfile +++ b/docker/Dockerfile @@ -49,4 +49,6 @@ RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash \ && colcon build --symlink-install --event-handlers console_cohesion+\ && rm -rf /var/lib/apt/lists/*" - # Continue with https://roboticseabass.com/2023/07/09/updated-guide-docker-and-ros2/ \ No newline at end of file +# Set up entrypoint +COPY ./docker/entrypoint.sh / +ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100755 index 0000000..3118ebf --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,11 @@ +#! /bin/bash +# Entrypoint for ROS Docker containers + +# Source ROS 2 +source /opt/ros/${ROS_DISTRO}/setup.bash + +# Source the overlay workspace, if built +source /root/ros2_ws/install/setup.bash + +# Execute the command passed into this entrypoint +exec "$@" \ No newline at end of file