From 93e9291e1924dab1e50755450fca51d5e6f6fed7 Mon Sep 17 00:00:00 2001 From: Matt Spencer Date: Fri, 31 Jul 2026 14:54:04 +0000 Subject: [PATCH] Fix upstream for rodep install in devcontainer --- .devcontainer/jazzy/Dockerfile.jazzy | 25 +++++----- patches/livox_ros_driver2.patch | 44 +++++++++++++++-- patches/unilidar_sdk2.patch | 47 ++++++++++++++++++- .../agv_pro_autocharge/package.xml | 3 -- 4 files changed, 96 insertions(+), 23 deletions(-) diff --git a/.devcontainer/jazzy/Dockerfile.jazzy b/.devcontainer/jazzy/Dockerfile.jazzy index d5734ee..26247a6 100644 --- a/.devcontainer/jazzy/Dockerfile.jazzy +++ b/.devcontainer/jazzy/Dockerfile.jazzy @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1.7-labs FROM osrf/ros:jazzy-desktop-full ARG USERNAME=USERNAME ARG USER_UID=1000 @@ -51,19 +52,17 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGE python3-vcstool \ && rm -rf /var/lib/apt/lists/* -# system deps from frozen rosdep manifest — no rosdep at build or startup -# NOTE: There should be a check in your CI that this file is up to date. -# Something like: -# ./scripts/freeze-rosdep.sh && git diff --exit-code rosdep-packages.txt -# COPY rosdep-packages.txt /tmp/rosdep-packages.txt -# The --mount=type=cache option caches the apt packages with buildkit -# The id-apt-cache-${TARGETARCH} option allows for separate caches for different architectures -# this enables parallel builds for different architectures without cache conflicts -# RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \ -# rm -f /etc/apt/apt.conf.d/docker-clean \ -# && apt-get update \ -# && xargs -r -a /tmp/rosdep-packages.txt apt-get install -y --no-install-recommends \ -# && rm -rf /var/lib/apt/lists/* +# Copy boilerplate project config into workspace so it can be parsed by rosdep. +# This will be obscured by the volume mount or the workspace in the devcontainer +# Don't include all sources, because the rosdep will re-process on any file change +COPY --parents src/**/package.xml src/**/COLCON_IGNORE src/ + +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \ + apt-get update \ + && rosdep update --rosdistro $ROS_DISTRO \ + && rosdep install --from-paths src --ignore-src -y \ + && rm -rf /var/lib/apt/lists/* + RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \ apt-get update \ diff --git a/patches/livox_ros_driver2.patch b/patches/livox_ros_driver2.patch index d35c2d5..6d5705a 100644 --- a/patches/livox_ros_driver2.patch +++ b/patches/livox_ros_driver2.patch @@ -34,13 +34,47 @@ index 0000000..163fb01 +launch_ROS2 \ No newline at end of file diff --git a/package.xml b/package.xml -new file mode 120000 -index 0000000..36804a4 +new file mode 100644 +index 0000000..0000000 --- /dev/null +++ b/package.xml -@@ -0,0 +1 @@ -+package_ROS2.xml -\ No newline at end of file +@@ -0,0 +1,36 @@ ++ ++ ++ ++ livox_ros_driver2 ++ 1.0.0 ++ The ROS device driver for Livox 3D LiDARs, for ROS2 ++ feng ++ MIT ++ ++ ament_cmake_auto ++ rosidl_default_generators ++ rosidl_interface_packages ++ ++ rclcpp ++ rclcpp_components ++ std_msgs ++ sensor_msgs ++ rcutils ++ pcl_conversions ++ rcl_interfaces ++ libpcl-all-dev ++ ++ rosbag2 ++ rosidl_default_runtime ++ ++ ament_lint_auto ++ ament_lint_common ++ ++ git ++ apr ++ livox_sdk2 ++ ++ ++ ament_cmake ++ ++ diff --git a/package_ROS2.xml b/package_ROS2.xml index 96f5762..c66785b 100644 --- a/package_ROS2.xml diff --git a/patches/unilidar_sdk2.patch b/patches/unilidar_sdk2.patch index e57c358..81d7f5f 100644 --- a/patches/unilidar_sdk2.patch +++ b/patches/unilidar_sdk2.patch @@ -37,10 +37,18 @@ index 041ef0d..dd57d47 100644 install(TARGETS diff --git a/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml b/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml -index 74539aa..b5febb2 100644 +index 74539aa..69bb645 100644 --- a/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml +++ b/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml -@@ -21,6 +21,7 @@ +@@ -15,14 +15,15 @@ + rclcpp + std_msgs + sensor_msgs +- ++ + pcl_conversions +- pcl ++ libpcl-all-dev geometry_msgs tf2_ros @@ -48,6 +56,10 @@ index 74539aa..b5febb2 100644 ament_cmake + +- ++ +\ No newline at end of file diff --git a/unitree_lidar_sdk/CMakeLists.txt b/unitree_lidar_sdk/CMakeLists.txt index 80af9c9..0d9a334 100644 --- a/unitree_lidar_sdk/CMakeLists.txt @@ -103,3 +115,34 @@ index 80af9c9..0d9a334 100644 \ No newline at end of file +ament_package() \ No newline at end of file +diff --git a/unitree_lidar_sdk/package.xml b/unitree_lidar_sdk/package.xml +index ef88d9a..68ab313 100644 +--- a/unitree_lidar_sdk/package.xml ++++ b/unitree_lidar_sdk/package.xml +@@ -1,15 +1,15 @@ + + + +- unitree_lidar_sdk +- 0.0.0 +- Unitree LiDAR SDK (prebuilt static library and headers) +- jo +- BSD-3-Clause ++ unitree_lidar_sdk ++ 0.0.0 ++ Unitree LiDAR SDK (prebuilt static library and headers) ++ jo ++ BSD-3-Clause + +- ament_cmake ++ ament_cmake + +- +- ament_cmake +- +- ++ ++ ament_cmake ++ ++ +\ No newline at end of file diff --git a/src/elephant_robotics/agv_pro_autocharge/package.xml b/src/elephant_robotics/agv_pro_autocharge/package.xml index bdcb24e..f406fab 100755 --- a/src/elephant_robotics/agv_pro_autocharge/package.xml +++ b/src/elephant_robotics/agv_pro_autocharge/package.xml @@ -7,9 +7,6 @@ Your Name MIT - - ament_python - rclpy geometry_msgs