Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
04adcbc
add sbc docker
GyuH13 Oct 21, 2025
41aa268
Merge branch 'main' of https://github.com/ROBOTIS-GIT/turtlebot3 into…
GyuH13 Oct 21, 2025
70feb3d
docker: add Dockerfile.sbc and update docker-compose.yml for turtlebot3
GyuH13 Oct 21, 2025
1f225cc
docker: remove old Dockerfile and docker-compose.yml, update Dockerfi…
GyuH13 Oct 21, 2025
ef4bd76
docker: additional packages
GyuH13 Oct 21, 2025
b397010
docker: add nano package to Dockerfile.sbc
GyuH13 Oct 21, 2025
e0efe4f
docker: reorganize package installation in Dockerfile.pc for clarity
GyuH13 Oct 21, 2025
d6375b2
add docker file
GyuH13 Oct 22, 2025
b5eec21
Add dockerfile and compose.yml
GyuH13 Oct 22, 2025
585ab3f
docker: remove outdated Dockerfiles and update image reference in doc…
GyuH13 Oct 22, 2025
d150e90
docker: comment out build section in multiple docker-compose files fo…
GyuH13 Oct 22, 2025
5131d08
fix volumn mapping error
GyuH13 Oct 23, 2025
9dd5b5a
Add container management scripts for Turtlebot3
GyuH13 Oct 23, 2025
62c205c
docker: remove redundant comment from udev rule setup in container sc…
GyuH13 Oct 23, 2025
cc66146
docker: comment out udev rule setup in container scripts to avoid con…
GyuH13 Oct 23, 2025
49c96c4
docker: comment out environment variable exports in Dockerfiles for c…
GyuH13 Oct 24, 2025
35576be
Bump
GyuH13 Oct 24, 2025
6f718a8
docker: Update Dockerfiles to include additional dependencies for ROS…
Woojin-Crive Nov 1, 2025
314b6a4
gitignore: Update .gitignore to include .DS_Store file exclusion
Woojin-Crive Nov 1, 2025
f0c3465
fix EOF
GyuH13 Nov 6, 2025
e0d05e1
add udev rule in container.sh pc version
GyuH13 Nov 12, 2025
5fd48d2
support docker-compose environment
GyuH13 Nov 12, 2025
c1cae49
unified pc and sbc
GyuH13 Nov 13, 2025
a37b7e3
change volumn mount path
GyuH13 Nov 13, 2025
e8d5765
add nav2-route install command
GyuH13 Nov 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ build-*/
*.txt.user
*.gch
/.project
.DS_Store
35 changes: 0 additions & 35 deletions Dockerfile

This file was deleted.

49 changes: 49 additions & 0 deletions docker/humble/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Use the base ROS2 humble image
FROM ros:humble-ros-base

# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV COLCON_WS=/root/turtlebot3_ws

# Install the required packages in a single layer and clean up afterwards
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ros-${ROS_DISTRO}-desktop \
python3-argcomplete \
python3-colcon-common-extensions \
libboost-system-dev \
build-essential \
libudev-dev \
udev \
git \
nano \
ros-${ROS_DISTRO}-cartographer \
ros-${ROS_DISTRO}-cartographer-ros \
ros-${ROS_DISTRO}-navigation2 \
ros-${ROS_DISTRO}-nav2-bringup \
ros-${ROS_DISTRO}-turtlebot3-msgs \
ros-${ROS_DISTRO}-dynamixel-sdk \
ros-${ROS_DISTRO}-xacro \
ros-${ROS_DISTRO}-hls-lfcd-lds-driver \
ros-${ROS_DISTRO}-ld08-driver \
ros-${ROS_DISTRO}-coin-d4-driver \
&& rm -rf /var/lib/apt/lists/*

WORKDIR ${COLCON_WS}

RUN mkdir -p ${COLCON_WS}/src && \
cd ${COLCON_WS}/src && \
git clone -b humble https://github.com/ROBOTIS-GIT/turtlebot3.git

RUN bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash && \
cd ${COLCON_WS} && \
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release"

RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc && \
echo "source ${COLCON_WS}/install/setup.bash" >> ~/.bashrc && \
echo "alias cb='colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release'" >> ~/.bashrc && \
echo "export ROS_DOMAIN_ID=30 # TURTLEBOT3" >> ~/.bashrc && \
echo "# export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \
echo "# export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc

CMD ["bash"]
116 changes: 116 additions & 0 deletions docker/humble/container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#!/bin/bash

# Get the directory where the script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CONTAINER_NAME="turtlebot3"

# Determine whether to use docker-compose or docker compose
if docker compose version &> /dev/null; then
COMPOSE_CMD="docker compose"
else
COMPOSE_CMD="docker-compose"
fi

# Function to display help
show_help() {
echo "Usage: $0 [command]"
echo ""
echo "Commands:"
echo " help Show this help message"
echo " start Start the container"
echo " enter Enter the running container"
echo " stop Stop the container"
echo ""
echo "Examples:"
echo " $0 start Start container"
echo " $0 enter Enter the running container"
echo " $0 stop Stop the container"
}

# Function to start the container
start_container() {
# Set up X11 forwarding only if DISPLAY is set
if [ -n "$DISPLAY" ]; then
echo "Setting up X11 forwarding..."
xhost +local:docker || true
else
echo "Warning: DISPLAY environment variable is not set. X11 forwarding will not be available."
fi

echo "Starting Turtlebot3 container..."

# Copy udev rule for TurtleBot3
sudo tee /etc/udev/rules.d/99-tb3.rules > /dev/null <<EOF
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", ENV{ID_MM_DEVICE_IGNORE}="1", MODE:="0666"
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666"
ATTRS{idVendor}=="fff1", ATTRS{idProduct}=="ff48", ENV{ID_MM_DEVICE_IGNORE}="1", MODE:="0666"
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ENV{ID_MM_DEVICE_IGNORE}="1", MODE:="0666", SYMLINK+="tb3_lidar"
EOF

# Reload udev rules
echo "Reloading udev rules..."
sudo udevadm control --reload-rules
sudo udevadm trigger

# Pull the latest images
$COMPOSE_CMD -f "${SCRIPT_DIR}/docker-compose.yml" pull

# Run docker-compose
$COMPOSE_CMD -f "${SCRIPT_DIR}/docker-compose.yml" up -d
}

# Function to enter the container
enter_container() {
# Set up X11 forwarding only if DISPLAY is set
if [ -n "$DISPLAY" ]; then
echo "Setting up X11 forwarding..."
xhost +local:docker || true
else
echo "Warning: DISPLAY environment variable is not set. X11 forwarding will not be available."
fi

if ! docker ps | grep -q "$CONTAINER_NAME"; then
echo "Error: Container is not running"
exit 1
fi
docker exec -it "$CONTAINER_NAME" bash
}

# Function to stop the container
stop_container() {
if ! docker ps | grep -q "$CONTAINER_NAME"; then
echo "Error: Container is not running"
exit 1
fi

echo "Warning: This will stop and remove the container. All unsaved data in the container will be lost."
read -p "Are you sure you want to continue? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
$COMPOSE_CMD -f "${SCRIPT_DIR}/docker-compose.yml" down
else
echo "Operation cancelled."
exit 0
fi
}

# Main command handling
case "$1" in
"help")
show_help
;;
"start")
start_container
;;
"enter")
enter_container
;;
"stop")
stop_container
;;
*)
echo "Error: Unknown command"
show_help
exit 1
;;
esac
30 changes: 30 additions & 0 deletions docker/humble/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
services:
turtlebot3:
container_name: turtlebot3
image: robotis/turtlebot3:humble-latest
# build:
# context: .
# dockerfile: Dockerfile.pc
tty: true
restart: unless-stopped
cap_add:
- SYS_NICE
ulimits:
rtprio: 99
rttime: -1
memlock: 8428281856
network_mode: host
ipc: host
pid: host
environment:
- DISPLAY=${DISPLAY}
- QT_X11_NO_MITSHM=1
volumes:
- /dev:/dev
- /dev/shm:/dev/shm
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- /tmp/.docker.xauth:/tmp/.docker.xauth:rw
- ./workspace:/workspace
- ../../:/root/turtlebot3_ws/src/turtlebot3
privileged: true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using privileged: true gives the container full root access to the host machine, which poses a significant security risk. It's highly recommended to avoid this. Instead, consider granting only the necessary capabilities via cap_add and mapping specific devices (e.g., /dev/ttyUSB0) using the devices key. This follows the principle of least privilege.

command: bash
50 changes: 50 additions & 0 deletions docker/jazzy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Use the base ROS2 jazzy image
FROM ros:jazzy-ros-base

# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV COLCON_WS=/root/turtlebot3_ws

# Install the required packages in a single layer and clean up afterwards
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ros-${ROS_DISTRO}-desktop \
python3-argcomplete \
python3-colcon-common-extensions \
libboost-system-dev \
build-essential \
libudev-dev \
udev \
git \
nano \
ros-${ROS_DISTRO}-cartographer \
ros-${ROS_DISTRO}-cartographer-ros \
ros-${ROS_DISTRO}-navigation2 \
ros-${ROS_DISTRO}-nav2-bringup \
ros-${ROS_DISTRO}-nav2-route \
ros-${ROS_DISTRO}-turtlebot3-msgs \
ros-${ROS_DISTRO}-dynamixel-sdk \
ros-${ROS_DISTRO}-xacro \
ros-${ROS_DISTRO}-hls-lfcd-lds-driver \
ros-${ROS_DISTRO}-ld08-driver \
ros-${ROS_DISTRO}-coin-d4-driver \
&& rm -rf /var/lib/apt/lists/*

WORKDIR ${COLCON_WS}

RUN mkdir -p ${COLCON_WS}/src && \
cd ${COLCON_WS}/src && \
git clone -b jazzy https://github.com/ROBOTIS-GIT/turtlebot3.git

RUN bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash && \
cd ${COLCON_WS} && \
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release"

RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc && \
echo "source ${COLCON_WS}/install/setup.bash" >> ~/.bashrc && \
echo "alias cb='colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release'" >> ~/.bashrc && \
echo "export ROS_DOMAIN_ID=30 # TURTLEBOT3" >> ~/.bashrc && \
echo "# export TURTLEBOT3_MODEL= # burger, waffle, waffle_pi" >> ~/.bashrc && \
echo "# export LDS_MODEL= # LDS-01, LDS-02, LDS-03" >> ~/.bashrc

CMD ["bash"]
Loading
Loading