From 38a5125306fb20ebd742669fcd5acbd7355d2420 Mon Sep 17 00:00:00 2001 From: Yoshiaki WATANABE Date: Tue, 18 May 2021 20:42:31 +0900 Subject: [PATCH 1/2] modify Dockerfile & docker-compose.yml to use ROS melodic --- Dockerfile | 3 ++- docker-compose.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e389c86..5fd610d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ FROM ${BASE_IMAGE} # (or without GPU) works through docker. # I was unable to use the ROS_DISTRO variable here due to this issue: # https://github.com/docker/for-mac/issues/2155 -COPY --from=osrf/ros:kinetic-desktop-full / / +COPY --from=osrf/ros:melodic-desktop-full / / # Add ROS env vars to the bashrc ENV BASH_ENV="/root/launch.sh" @@ -26,6 +26,7 @@ RUN apt-get update && \ build-essential \ # Project-specific build dependencies python-pip \ + ros-${ROS_DISTRO}-moveit \ ros-${ROS_DISTRO}-serial \ ros-${ROS_DISTRO}-joint-state-publisher-gui && \ rm -rf /var/lib/apt/lists/* diff --git a/docker-compose.yml b/docker-compose.yml index 28da39c..4ee3dea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ x-app: &common build: context: . args: &common-args - ROS_DISTRO: "kinetic" + ROS_DISTRO: "melodic" PYMYCOBOT_VERSION: ">=2<3" BASE_IMAGE: nvidia/opengl:1.1-glvnd-runtime-ubuntu18.04 From a036806572003d8e78a64fe386416a60ae753510 Mon Sep 17 00:00:00 2001 From: Daisuke Sato Date: Sat, 22 May 2021 18:43:59 +0900 Subject: [PATCH 2/2] Use rosdep --- Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5fd610d..869be7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,10 @@ ENTRYPOINT ["/bin/bash", "-c"] ARG ROS_DISTRO RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> $BASH_ENV +# Copy myCobot ROS package +WORKDIR /catkin_ws/src +COPY . mycobot_ros + # Install build dependencies RUN apt-get update && \ apt-get install -y \ @@ -24,11 +28,9 @@ RUN apt-get update && \ python-rosinstall-generator \ python-wstool \ build-essential \ - # Project-specific build dependencies - python-pip \ - ros-${ROS_DISTRO}-moveit \ - ros-${ROS_DISTRO}-serial \ - ros-${ROS_DISTRO}-joint-state-publisher-gui && \ + python-pip && \ + # Project-specific build dependencies + rosdep install -r -y -i --from-paths . && \ rm -rf /var/lib/apt/lists/* # Install python dependencies @@ -36,8 +38,6 @@ ARG PYMYCOBOT_VERSION RUN pip install "pymycobot $PYMYCOBOT_VERSION" --user # Build the project -WORKDIR /catkin_ws/src -ADD . mycobot_ros WORKDIR /catkin_ws RUN catkin_make