# ROS 2 Humble 開發環境 Dockerfile
# 含 micro-ROS Agent、MoveIt2、Gazebo 支援
=========================================================
# Dockerfile: ROS 2 Humble + MoveIt2 + Gazebo + micro-ROS Agent (source build)
FROM osrf/ros:humble-desktop-full
ENV DEBIAN_FRONTEND=noninteractive
# === 安裝基礎工具與依賴 ===
RUN apt update && apt install -y \
build-essential \
cmake \
git \
curl \
wget \
lsb-release \
gnupg2 \
python3-pip \
python3-colcon-common-extensions \
libboost-system-dev \
libtinyxml2-dev \
libyaml-cpp-dev \
nano tmux net-tools iputils-ping \
ros-humble-rmw-fastrtps-cpp \
ros-humble-moveit \
ros-humble-moveit-setup-assistant \
ros-humble-gazebo-ros-pkgs \
ros-humble-ros2-control \
ros-humble-ros2-controllers && \
rm -rf /var/lib/apt/lists/*
# === 建立 micro-ROS Agent workspace ===
ENV UROS_WS=/root/uros_ws
RUN mkdir -p $UROS_WS/src
WORKDIR $UROS_WS
# === Clone micro-ROS Agent + msgs ===
RUN git clone -b humble https://github.com/micro-ROS/micro-ROS-Agent.git src/micro_ros_agent && \
git clone -b humble https://github.com/micro-ROS/micro_ros_msgs.git src/micro_ros_msgs
# === Build Agent ===
RUN /bin/bash -c "source /opt/ros/humble/setup.bash && colcon build"
# === Source setup 環境 ===
RUN echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc && \
echo 'source /root/uros_ws/install/setup.bash' >> ~/.bashrc
# === 工作目錄為 ROS2 開發空間 ===
WORKDIR /root/ros2_ws
RUN mkdir -p src
CMD ["bash"]
=========================================================
沒有留言:
張貼留言