unity2moveit2/docker/Dockerfile
ayuan9957 fe15edcbd5 Initial commit: Unity-MoveIt2 integrated robotic arm simulation system
- Unity frontend with ROS-TCP-Connector for ROS2 communication
- Docker-based ROS2 Jazzy backend with MoveIt2 integration
- Support for 1-9 DOF manipulators
- UR5 robot configuration and URDF files
- Assembly task feasibility analysis tools
- Comprehensive documentation and deployment guides

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 12:08:34 +08:00

87 lines
2.4 KiB
Docker

# Unity-ROS2 System Docker Image
# Use official ROS2 Jazzy Desktop image as base
FROM osrf/ros:jazzy-desktop
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV ROS_DOMAIN_ID=0
ENV RMW_IMPLEMENTATION=rmw_fastrtps_cpp
ENV PYTHONUNBUFFERED=1
ENV ROS_DISTRO=jazzy
# Install additional system dependencies
RUN apt-get update && apt-get install -y \
curl \
wget \
git \
vim \
nano \
net-tools \
iputils-ping \
python3-pip \
python3-dev \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install ROS2 related packages
RUN apt-get update && apt-get install -y \
ros-jazzy-rosbridge-suite \
ros-jazzy-moveit \
ros-jazzy-moveit-planners \
ros-jazzy-moveit-plugins \
ros-jazzy-moveit-ros-planning-interface \
ros-jazzy-moveit-servo \
ros-jazzy-ros2-control \
ros-jazzy-ros2-controllers \
ros-jazzy-joint-state-publisher \
ros-jazzy-joint-state-publisher-gui \
ros-jazzy-robot-state-publisher \
ros-jazzy-xacro \
ros-jazzy-urdf \
ros-jazzy-tf2-tools \
ros-jazzy-rqt \
ros-jazzy-rqt-common-plugins \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
RUN pip3 install --no-cache-dir --break-system-packages \
numpy \
scipy \
matplotlib \
transforms3d \
roslibpy
# Create workspace and clone ROS-TCP-Endpoint
WORKDIR /ros2_ws
RUN mkdir -p /ros2_ws/src && \
cd /ros2_ws/src && \
git clone https://github.com/Unity-Technologies/ROS-TCP-Endpoint.git -b main-ros2
# Build ROS-TCP-Endpoint
RUN /bin/bash -c "source /opt/ros/jazzy/setup.bash && \
cd /ros2_ws && \
colcon build --packages-select ros_tcp_endpoint --symlink-install"
# Source ROS2 environment in bashrc for all sessions
RUN echo "source /opt/ros/jazzy/setup.bash" >> /root/.bashrc && \
echo "if [ -f /ros2_ws/install/setup.bash ]; then source /ros2_ws/install/setup.bash; fi" >> /root/.bashrc
# Create startup script
RUN echo '#!/bin/bash\n\
source /opt/ros/jazzy/setup.bash\n\
if [ -f /ros2_ws/install/setup.bash ]; then\n\
source /ros2_ws/install/setup.bash\n\
fi\n\
echo "ROS2 Jazzy environment ready"\n\
echo "ROS_DOMAIN_ID: $ROS_DOMAIN_ID"\n\
echo "RMW_IMPLEMENTATION: $RMW_IMPLEMENTATION"\n\
exec "$@"' > /entrypoint.sh && \
chmod +x /entrypoint.sh
# Expose ports (TCP communication ports)
EXPOSE 10000-10010
# Set entry point
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]