Fix docker build sourcing packages

This commit is contained in:
2023-02-21 17:05:58 +02:00
parent 21cd4cc9ab
commit 59d20e121d
2 changed files with 23 additions and 31 deletions

View File

@@ -39,38 +39,34 @@ RUN apt-get update && \
apt-get install -yq python3-pip && \ apt-get install -yq python3-pip && \
pip install --upgrade --upgrade-strategy eager splipy pip install --upgrade --upgrade-strategy eager splipy
### Import and install dependencies, then build these dependencies (not ign_moveit2_examples yet) # Build interfaces and generic controller first
COPY ./drawing_robot_ros2.repos ${WS_SRC_DIR}/ign_moveit2_examples/drawing_robot_ros2.repos COPY ./src/robot_interfaces ${WS_SRC_DIR}/robot_interfaces
RUN vcs import --recursive --shallow ${WS_SRC_DIR} < ${WS_SRC_DIR}/ign_moveit2_examples/drawing_robot_ros2.repos && \ COPY ./src/robot_controller ${WS_SRC_DIR}/robot_controller
rosdep update && \ RUN source "/opt/ros/${ROS_DISTRO}/setup.bash" && \
apt-get update && \ colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=Release" --paths ${WS_SRC_DIR}/robot_interfaces ${WS_SRC_DIR}/robot_controller && \
rosdep install -y -r -i --rosdistro "${ROS_DISTRO}" --from-paths ${WS_SRC_DIR} && \
rm -rf /var/lib/apt/lists/* && \
source "/opt/ros/${ROS_DISTRO}/setup.bash" && \
colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=Release" && \
rm -rf ${WS_LOG_DIR} rm -rf ${WS_LOG_DIR}
### Copy over the rest of ign_moveit2_examples, then install dependencies and build # Build packages
COPY ./ ${WS_SRC_DIR}/ign_moveit2_examples/ COPY ./src/draw_svg ${WS_SRC_DIR}/draw_svg
RUN rosdep update && \ COPY ./src/drawing_controller ${WS_SRC_DIR}/drawing_controller
apt-get update && \ COPY ./src/axidraw_controller ${WS_SRC_DIR}/axidraw_controller
rosdep install -y -r -i --rosdistro "${ROS_DISTRO}" --from-paths ${WS_SRC_DIR} && \ RUN source "/opt/ros/${ROS_DISTRO}/setup.bash" && \
rm -rf /var/lib/apt/lists/* && \ source "${WS_INSTALL_DIR}/local_setup.bash" && \
source "/opt/ros/${ROS_DISTRO}/setup.bash" && \ colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=Release" --paths ${WS_SRC_DIR}/draw_svg ${WS_SRC_DIR}/drawing_controller ${WS_SRC_DIR}/axidraw_controller && \
colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=Release" && \
rm -rf ${WS_LOG_DIR} rm -rf ${WS_LOG_DIR}
### Copy code built on top of example ign_moveit2_examples # Build lite6 and xarm packages
# TODO clean build process COPY ./src/lite6_controller ${WS_SRC_DIR}/lite6_controller
COPY ./src/* ${WS_SRC_DIR}/ RUN source "/opt/ros/${ROS_DISTRO}/setup.bash" && \
RUN rosdep update && \ vcs import --recursive --shallow ${WS_SRC_DIR} < ${WS_SRC_DIR}/lite6_controller/lite6_controller.repos && \
apt-get update && \ mv ${WS_SRC_DIR}/xarm_ros2/xarm* ${WS_SRC_DIR} && \
rosdep install -y -r -i --rosdistro "${ROS_DISTRO}" --from-paths ${WS_SRC_DIR} && \ rosdep install -y -r -i --rosdistro "${ROS_DISTRO}" --from-paths ${WS_SRC_DIR}/xarm_* && \
rm -rf /var/lib/apt/lists/* && \ colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=Release" --paths ${WS_SRC_DIR}/xarm_* ${WS_SRC_DIR}/lite6_controller && \
source "/opt/ros/${ROS_DISTRO}/setup.bash" && \
colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=Release" && \
rm -rf ${WS_LOG_DIR} rm -rf ${WS_LOG_DIR}
# Copy example svg images
COPY ./svg svg
### Add workspace to the ROS entrypoint ### Add workspace to the ROS entrypoint
### Source ROS workspace inside `~/.bashrc` to enable autocompletion ### Source ROS workspace inside `~/.bashrc` to enable autocompletion
RUN sed -i '$i source "${WS_INSTALL_DIR}/local_setup.bash" --' /ros_entrypoint.sh && \ RUN sed -i '$i source "${WS_INSTALL_DIR}/local_setup.bash" --' /ros_entrypoint.sh && \

View File

@@ -1,9 +1,5 @@
repositories: repositories:
ros2_controllers:
type: git
url: https://github.com/AndrejOrsula/ros2_controllers.git
version: jtc_effort
xarm_ros2: xarm_ros2:
type: git type: git
url: https://github.com/xArm-Developer/xarm_ros2 url: https://github.com/xArm-Developer/xarm_ros2
version: galactic version: humble