Skip to content

Commit 21809f0

Browse files
committed
turtlebot3: build on ros:jazzy-ros-base so the demo runs natively on arm64
osrf/ros:jazzy-desktop is published for amd64 only. On Apple Silicon the whole demo ran under emulation: a 9.6 GB image, the lidar and Nav2 too slow to work. ros:jazzy-ros-base is multi-arch, Gazebo comes in with ros_gz, and the package lists are refreshed before rosdep.
1 parent 7a194cb commit 21809f0

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎demos/turtlebot3_integration/Dockerfile‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# TurtleBot3 + ros2_medkit Discovery Demo with Nav2 Navigation
2-
# Full desktop image with Gazebo GUI support
2+
#
3+
# ros:jazzy-ros-base is multi-arch. osrf/ros:jazzy-desktop is amd64 only, so on
4+
# Apple Silicon and other arm64 hosts it ran under emulation, which broke the
5+
# simulated lidar and Nav2. Gazebo (server and GUI) comes in with ros_gz.
36

4-
FROM osrf/ros:jazzy-desktop
7+
FROM ros:jazzy-ros-base
58

69
ENV DEBIAN_FRONTEND=noninteractive
710
ENV ROS_DISTRO=jazzy
@@ -11,6 +14,7 @@ ENV COLCON_WS=/root/demo_ws
1114

1215
# Install TurtleBot3, Nav2, and build dependencies
1316
RUN apt-get update && apt-get install -y \
17+
ros-jazzy-ros-gz \
1418
ros-jazzy-turtlebot3-gazebo \
1519
ros-jazzy-turtlebot3-msgs \
1620
ros-jazzy-turtlebot3-description \
@@ -78,9 +82,13 @@ RUN find /var/lib/ros2_medkit/scripts -name "*.bash" -exec chmod +x {} \;
7882

7983
# Build ros2_medkit and demo package
8084
WORKDIR ${COLCON_WS}
85+
# apt-get update first: the base image ships no package lists, and rosdep
86+
# installs what the workspace needs that the image does not carry.
8187
RUN bash -c "source /opt/ros/jazzy/setup.bash && \
88+
apt-get update && \
8289
rosdep update && \
8390
rosdep install --from-paths src --ignore-src -r -y && \
91+
rm -rf /var/lib/apt/lists/* && \
8492
MAKEFLAGS='-j 2' colcon build --executor sequential --symlink-install --cmake-args -DBUILD_TESTING=OFF"
8593

8694
# Setup environment

0 commit comments

Comments
 (0)