-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathDockerfile
More file actions
97 lines (81 loc) · 3.45 KB
/
Copy pathDockerfile
File metadata and controls
97 lines (81 loc) · 3.45 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
94
95
96
97
# If you would like to use lightweight image, you can use the following base image:
# FROM ros:humble-ros-base
FROM osrf/ros:humble-desktop-full
ENV DEBIAN_FRONTEND=noninteractive \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
ROS_DISTRO=humble
ARG BUILD_FRANKA_ROS=false
ARG USER_UID=1001
ARG USER_GID=1001
ARG USERNAME=user
RUN apt-get update && \
apt-get install -y --no-install-recommends \
bash-completion \
curl \
gdb \
git \
nano \
openssh-client \
python3-colcon-argcomplete \
python3-colcon-common-extensions \
sudo \
libeigen3-dev \
libboost-all-dev \
vim && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN groupadd --gid $USER_GID $USERNAME && \
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME && \
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> /home/$USERNAME/.bashrc && \
echo "source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash" >> /home/$USERNAME/.bashrc
USER $USERNAME
WORKDIR /ros2_ws
COPY . /ros2_ws/src/Cartesian-Impedance-Controller
RUN sudo chown -R $USERNAME:$USERNAME /ros2_ws
RUN sudo apt update
RUN rosdep update && \
rosdep install --from-paths src/Cartesian-Impedance-Controller --ignore-src --rosdistro=$ROS_DISTRO -y
RUN if [ "$BUILD_FRANKA_ROS" = "true" ]; then \
echo "Installing franka_ros2 dependencies and cloning repository..."; \
sudo apt-get install -y --no-install-recommends \
ros-humble-franka-description \
ros-humble-ros-gz \
ros-humble-sdformat-urdf \
ros-humble-joint-state-publisher-gui \
ros-humble-ros2controlcli \
ros-humble-controller-interface \
ros-humble-hardware-interface-testing \
ros-humble-ament-cmake-clang-format \
ros-humble-ament-cmake-clang-tidy \
ros-humble-controller-manager \
ros-humble-ros2-control-test-assets \
libignition-gazebo6-dev \
libignition-plugin-dev \
ros-humble-hardware-interface \
ros-humble-control-msgs \
ros-humble-backward-ros \
ros-humble-generate-parameter-library \
ros-humble-realtime-tools \
ros-humble-joint-state-publisher \
ros-humble-joint-state-broadcaster \
ros-humble-moveit-ros-move-group \
ros-humble-moveit-kinematics \
ros-humble-moveit-planners-ompl \
ros-humble-moveit-ros-visualization \
ros-humble-joint-trajectory-controller \
ros-humble-moveit-simple-controller-manager \
ros-humble-rviz2 \
ros-humble-xacro && \
sudo apt-get clean && \
git clone https://github.com/frankaemika/franka_ros2.git /ros2_ws/src/franka_ros2 && \
vcs import /ros2_ws/src < /ros2_ws/src/franka_ros2/franka.repos --recursive --skip-existing && \
rosdep install --from-paths src/franka_ros2 --ignore-src --rosdistro=$ROS_DISTRO -y; \
else \
echo "Skipping franka_ros2 integration - building only the Cartesian Impedance Controller."; \
fi
RUN /bin/bash src/Cartesian-Impedance-Controller/scripts/install_dependencies.sh
RUN echo 'export CMAKE_PREFIX_PATH=/usr/local:$CMAKE_PREFIX_PATH' >> /home/$USERNAME/.bashrc
RUN /bin/bash -c "source /opt/ros/$ROS_DISTRO/setup.bash && colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release"
CMD ["/bin/bash"]