-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
29 lines (22 loc) · 907 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Dockerfile for ROS 2 Humble + mvsim
FROM ros:humble
# Install necessary dependencies for mvsim
RUN apt-get update && apt-get install -y \
ros-humble-mvsim \
python3-colcon-common-extensions \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Create working directories
WORKDIR /ros2_ws/src
# Copy the launch.py and the Python script to the image
COPY launch_mvsim.launch.py /ros2_ws/src/
COPY robot_commander.py /ros2_ws/src/
# Return to the workspace root directory
WORKDIR /ros2_ws
# Build the workspace
RUN colcon build
# Source ROS 2 and setup the environment for the launch file
RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
RUN echo "source /ros2_ws/install/setup.bash" >> ~/.bashrc
# Default command to launch the ROS 2 simulation
CMD ["bash", "-c", "source /opt/ros/humble/setup.bash && source /ros2_ws/install/setup.bash && ros2 launch src/launch_mvsim.launch.py"]