-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Addisu Z. Taddese <[email protected]>
- Loading branch information
0 parents
commit e75c9ac
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Choose from humble and iron | ||
ARG FROM_IMAGE=ros:humble | ||
|
||
FROM $FROM_IMAGE | ||
|
||
ARG OVERLAY_WS=/opt/ros/overlay_ws | ||
|
||
# Choose from fortress, garden, and harmonic. | ||
ARG GZ_VERSION=fortress | ||
|
||
|
||
RUN apt-get update \ | ||
&& apt-get install -y lsb-release wget gnupg \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV GZ_VERSION=${GZ_VERSION} | ||
# Install Gazeob Harmonic | ||
RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \ | ||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null \ | ||
&& apt-get update \ | ||
&& apt-get install -y "gz-${GZ_VERSION}" \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# Install the matching ros_gz version, eg. `ros-humble-ros-gzharmonic`. | ||
# For Fortress, a suffix is not necessary, so it would just be `ros-humble-ros-gz` | ||
RUN apt-get update \ | ||
&& apt-get install -y "ros-${ROS_DISTRO}-ros-gz${GZ_VERSION#fortress}" \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Build turtlebot4 and ros_gz from source | ||
WORKDIR $OVERLAY_WS/src | ||
RUN git clone https://github.com/turtlebot/turtlebot4_simulator -b ${ROS_DISTRO} | ||
|
||
WORKDIR $OVERLAY_WS | ||
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \ | ||
apt-get update && rosdep install -y \ | ||
--from-paths src \ | ||
--ignore-src \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# build overlay source | ||
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \ | ||
colcon build --symlink-install | ||
|
||
# source entrypoint setup | ||
ENV OVERLAY_WS $OVERLAY_WS | ||
RUN sed --in-place --expression \ | ||
'$isource "$OVERLAY_WS/install/setup.bash"' \ | ||
/ros_entrypoint.sh | ||
|
||
ENTRYPOINT ["/ros_entrypoint.sh"] | ||
|
||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# turtlebot4 Docker | ||
|
||
```bash | ||
docker run \ | ||
--interactive \ | ||
--privileged \ | ||
--tty \ | ||
--env DISPLAY \ | ||
--name "test" \ | ||
--volume /tmp:/tmp:rslave \ | ||
--rm \ | ||
tb4 \ | ||
bash | ||
``` |