-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.spot-ros2
More file actions
93 lines (77 loc) · 2.9 KB
/
Copy pathDockerfile.spot-ros2
File metadata and controls
93 lines (77 loc) · 2.9 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Use official Ubuntu 22.04 base image
FROM ubuntu:22.04
# Set noninteractive mode for APT
ENV DEBIAN_FRONTEND=noninteractive
# Env setup
ENV SHELL=/bin/bash
SHELL ["/bin/bash", "-c"]
# Install system dependencies
RUN apt-get update && apt-get install -y \
locales \
curl \
git \
&& locale-gen en_US.UTF-8 \
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
# Install Node.js 22.x
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y nodejs
# Add ROS 2 apt repository
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" \
| tee /etc/apt/sources.list.d/ros2.list > /dev/null \
&& apt-get update
# Install dependencies
RUN apt-get update -q && \
apt-get install -yq --no-install-recommends \
wget \
software-properties-common \
python3-pip \
python-is-python3 \
python3-argcomplete \
python3-colcon-common-extensions \
python3-colcon-mixin \
python3-rosdep \
libpython3-dev \
python3-tk \
python3-typing-extensions \
python3-pytest-cov \
python3-protobuf \
python3-vcstool \
ros-humble-ament-cmake-auto \
ros-humble-desktop \
ros-dev-tools \
ros-humble-object-recognition-msgs \
# RTAB-Map packages
ros-humble-rtabmap-ros \
ros-humble-octomap-server \
# Controller packages
ros-humble-ros2-control \
ros-humble-ros2-controllers \
ros-humble-controller-manager \
ros-humble-controller-interface \
ros-humble-hardware-interface \
ros-humble-forward-command-controller \
# System utilities for USB devices
udev usbutils \
&& rm -rf /var/lib/apt/lists/*
# Set up workspace
WORKDIR /home/spot-teleop/spot-ros2_ws
# Initialize rosdep
RUN rosdep init && rosdep update
# Copy source code
COPY spot-ros2_ws/src /home/spot-teleop/spot-ros2_ws/src
# Execute installation script
RUN cd /home/spot-teleop/spot-ros2_ws/src/spot_ros2 && chmod +x install_spot_ros2.sh && ./install_spot_ros2.sh
# Install dependencies (skip unavailable packages)
RUN rosdep install --from-paths src --ignore-src -y -r --rosdistro=humble --skip-keys="ros-humble-warehouse-ros-mongo" || true
# Set environment variables for ROS Domain ID and other configs
ENV HOME=/home/spot-teleop
ENV USER=root
# Create bashrc with ROS setup
RUN echo 'source /opt/ros/humble/setup.bash' >> /root/.bashrc && \
echo 'source /home/spot-teleop/spot-ros2_ws/install/setup.bash' >> /root/.bashrc
# Install Python packages
RUN python3 -m pip install bosdyn-client==5.0.1.2 bosdyn-mission==5.0.1.2 bosdyn-choreography-client==5.0.1.2 bosdyn-orbit==5.0.1.2 mediapipe==0.10.21 ultralytics
# Set default command
CMD ["/bin/bash"]