diff options
| author | CoprDistGit <infra@openeuler.org> | 2026-10-20 09:49:59 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2026-10-20 09:49:59 +0000 |
| commit | b67d7f4a7efff8d414b48cf9cce337ac9bfc3243 (patch) | |
| tree | b2d47b59c2bdf49e24584d8f15a205a23c415557 | |
| parent | 4a24eaa79d8040992cc6c0b01c97f415a1c9d4f8 (diff) | |
automatic import of ros-humble-easynav-mpc-controller
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | easynav-mpc-controller.spec | 125 | ||||
| -rw-r--r-- | nlopt-local-source.patch | 11 | ||||
| -rw-r--r-- | sources | 3 |
4 files changed, 88 insertions, 53 deletions
@@ -1 +1,3 @@ /easynav-mpc-controller-0.5.0-1.tar.gz +/2580d29baefe77305c6e9336dca743aa5ce51c2c.tar.gz +/nlopt-2.11.0.tar.gz diff --git a/easynav-mpc-controller.spec b/easynav-mpc-controller.spec index 6ff0ce3..b2b53c5 100644 --- a/easynav-mpc-controller.spec +++ b/easynav-mpc-controller.spec @@ -1,30 +1,47 @@ +# ROS 2 包:easynav_mpc_controller(ament_cmake 形态) +# 来源:EasyNavigation/easynav_plugins 仓库 humble 分支(多包仓库,本包位于 +# controllers/easynav_mpc_controller/ 子目录) +# 严格遵循 /app/.claude/skills/build-rpm/spec-rules-ros.md 生成 + +# ros_distro 取自 session.json,禁止硬编码;RosPkgName 为 package.xml <name> +# 经下划线→连字符归一化(easynav_mpc_controller → easynav-mpc-controller) %define ros_distro humble %define RosPkgName easynav-mpc-controller -%define src_version 0.5.0-1 -Name: ros-%{ros_distro}-%{RosPkgName} -Version: 0.5.0 -Release: 1%{?dist} -Summary: Easy Navigation: MPC Controller package. -License: Apache-2.0 -URL: https://github.com/EasyNavigation/easynav_plugins/tree/humble -Source0: %{RosPkgName}-%{src_version}.tar.gz +Name: ros-%{ros_distro}-%{RosPkgName} +Version: 0.5.0 +Release: 1%{?dist} +Summary: Easy Navigation: MPC Controller package. +License: Apache-2.0 +URL: https://github.com/EasyNavigation/easynav_plugins + +# 源码取自 humble 分支 HEAD(commit 快照,无 0.5.0 tag,记录 commit 以保可追溯) +# 归档解压根目录经实测为 easynav_plugins-<完整SHA>(GitHub commit 归档命名) +%global commit 2580d29baefe77305c6e9336dca743aa5ce51c2c +Source0: https://github.com/EasyNavigation/easynav_plugins/archive/%{commit}.tar.gz + +# NLopt:CMakeLists 在系统无 NLopt 时从 GitHub 下载内置静态库(MIT-only 子集), +# COPR 无网环境必失败(spec-rules §9 已知失败模式)。此处将上游归档作为 Source1 +# 本地化,并用 Patch0 把 ExternalProject 的 URL 重定向到本地文件,实现离线构建。 +# SHA256 与 CMakeLists 的 URL_HASH 一致(53e552d8...04cf0de),完整性可校验。 +Source1: https://github.com/stevengj/nlopt/archive/refs/tags/v2.11.0.tar.gz#/nlopt-2.11.0.tar.gz +Patch0: nlopt-local-source.patch -# ROS 包统一关闭 debug 子包(/opt 前缀,strip/debugedit 路径非常规) +# debug 子包无意义(/opt 前缀,strip/debugedit 路径非常规),统一关闭 %global debug_package %{nil} -# 摘掉 brp-python-bytecompile(/opt 下 python 字节码编译会写标准 sitelib 路径) +# /opt 下 python 字节码编译会写标准 sitelib 路径,摘掉 brp-python-bytecompile %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') -# /opt/ros 下 .so 不做自动依赖扫描(由 ament 间接依赖模型替代) +# ROS 包不做自动依赖扫描(.so 全在 /opt/ros 下,由 ament 间接依赖模型替代) %global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$ %global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$ -# ── BuildRequires ── -# 构建工具 BuildRequires: cmake +BuildRequires: gcc-c++ BuildRequires: make -# ROS 构建工具(buildtool_depend) +# ament_cmake 形态构建工具依赖(spec-rules §6) BuildRequires: ros-%{ros_distro}-ament-cmake -# ROS 依赖(package.xml <depend>,经 ros-projects.list 验证 SIG 源已有) +BuildRequires: ros-%{ros_distro}-ros-workspace +# package.xml <depend> → ros-humble-<dep>(均经 ros-projects.list 实证为 SIG 维护包) BuildRequires: ros-%{ros_distro}-easynav-common BuildRequires: ros-%{ros_distro}-easynav-core BuildRequires: ros-%{ros_distro}-easynav-sensors @@ -37,16 +54,19 @@ BuildRequires: ros-%{ros_distro}-rclcpp BuildRequires: ros-%{ros_distro}-sensor-msgs BuildRequires: ros-%{ros_distro}-tf2 BuildRequires: ros-%{ros_distro}-tf2-ros -# 系统依赖(package.xml <depend>,经 pkg.remap 映射 eigen → eigen3-devel) +# CMake 直接 find_package 的系统依赖(package.xml 仅声明 eigen,pcl 经 pcl_conversions 传递, +# 但 CMakeLists 显式 find_package(PCL REQUIRED) 需 -devel 在 buildroot): +# eigen → eigen3-devel(data/ros/global_config/pkg.remap 映射) +# PCL → pcl-devel(dnf 实证:pcl-devel-1.12.1 提供 cmake(PCL)) BuildRequires: eigen3-devel -# CMakeLists.txt find_package(PCL REQUIRED COMPONENTS common io) BuildRequires: pcl-devel -# ── Requires(运行时,/opt/ros 被 __requires_exclude_from 豁免,autodeps 扫不到,必须手写)── -# 强制三件套:ros-workspace 提供 setup.sh 环境就绪,ament-cmake 提供 ament 运行期钩子 +# 运行时 Requires(spec-rules §6 三件套 + <depend> 运行期依赖): +# ros-workspace 提供 /opt/ros/<distro>/setup.sh 与环境 hooks(所有 ROS 包强制) +# ament-cmake ament 运行期钩子(ament_cmake 形态强制) +# /opt/ros 被 __requires_exclude_from 豁免、autodeps 扫不到,故运行期依赖手写 Requires: ros-%{ros_distro}-ros-workspace Requires: ros-%{ros_distro}-ament-cmake -# package.xml <depend> 的运行时映射 Requires: ros-%{ros_distro}-easynav-common Requires: ros-%{ros_distro}-easynav-core Requires: ros-%{ros_distro}-easynav-sensors @@ -59,10 +79,11 @@ Requires: ros-%{ros_distro}-rclcpp Requires: ros-%{ros_distro}-sensor-msgs Requires: ros-%{ros_distro}-tf2 Requires: ros-%{ros_distro}-tf2-ros -Requires: eigen3-devel -Requires: pcl-devel +# 控制器 .so 动态链接 libpcl_common/libpcl_io(在 /usr/lib64),/opt/ros 下 .so 被豁免 +# 不扫 requires,故显式声明运行期 pcl +Requires: pcl -# 单包策略:严禁拆实体子包(主包 %files 整树拥有时路径必然重叠) +# 单包策略:严禁拆实体子包(spec-rules §7),用虚拟别名兼容依赖方 Provides: %{name}-devel = %{version}-%{release} Provides: %{name}-doc = %{version}-%{release} Provides: %{name}-runtime = %{version}-%{release} @@ -70,48 +91,48 @@ Provides: %{name}-runtime = %{version}-%{release} %description Easy Navigation: MPC Controller package. +Model Predictive Control (MPC) controller plugin for the Easy Navigation +stack. Built as an ament_cmake shared library registered as a pluginlib +plugin via easynav_core, with a bundled static NLopt optimizer (MIT-only +subset) when no system NLopt is available. + %prep -%autosetup -n %{RosPkgName}-%{src_version} +# 解压根目录 = easynav_plugins-<完整SHA>(实测 GitHub commit 归档命名) +%autosetup -n easynav_plugins-%{commit} -p1 +# 把 NLopt 源码归档放到包目录,供 Patch0 重定向后的 ExternalProject 本地引用 +cp %{SOURCE1} controllers/easynav_mpc_controller/ %build -# 源码在 monorepo 子目录中 -cd controllers/easynav_mpc_controller - -# ROS 基座环境(chroot 已配置 ROS SIG repo;无 ROS 依赖的包 buildroot 里 -# 可能没有 setup.sh,必须用 [ -f ] 守卫——直接 source 不存在的文件在 -# 严格 sh 下会中止整个 %build 脚本,|| true 挡不住) +# ROS 基座环境(spec-rules §4):setup.sh 用 [ -f ] 守卫,避免无 ROS 依赖 chroot 中止脚本 [ -f /opt/ros/%{ros_distro}/setup.sh ] && source /opt/ros/%{ros_distro}/setup.sh || true export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages${PYTHONPATH:+:$PYTHONPATH} export PKG_CONFIG_PATH=/opt/ros/%{ros_distro}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} -# 显式 out-of-source 构建(避免 openEuler %cmake 宏位置参数坑,spec-rules §5) -# BUILD_TESTING=OFF 关闭测试(package.xml <test_depend> 不写 BuildRequires,spec-rules §5) -# NLopt 未安装时 CMakeLists.txt 自动下载构建为私有静态库(ExternalProject),无需 BuildRequires -mkdir -p .obj && cd .obj -cmake \ - -DCMAKE_INSTALL_PREFIX="/opt/ros/%{ros_distro}" \ - -DAMENT_PREFIX_PATH="/opt/ros/%{ros_distro}" \ - -DCMAKE_PREFIX_PATH="/opt/ros/%{ros_distro}" \ - -UINCLUDE_INSTALL_DIR -ULIB_INSTALL_DIR -USYSCONF_INSTALL_DIR -USHARE_INSTALL_PREFIX -ULIB_SUFFIX \ - -DSETUPTOOLS_DEB_LAYOUT=OFF \ - -DBUILD_TESTING=OFF -DTESTING=OFF -DCMAKE_SUPPRESS_REGENERATION=ON \ - .. -make %{?_smp_mflags} +# 多包仓库:仅构建目标包子目录 controllers/easynav_mpc_controller +# ament_cmake 形态显式 out-of-source(spec-rules §5),避免 openEuler %cmake 宏位置参数坑 +cd controllers/easynav_mpc_controller +mkdir -p .obj +cd .obj +%cmake3 .. \ + -DCMAKE_INSTALL_PREFIX="/opt/ros/%{ros_distro}" \ + -DAMENT_PREFIX_PATH="/opt/ros/%{ros_distro}" \ + -DCMAKE_PREFIX_PATH="/opt/ros/%{ros_distro}" \ + -UINCLUDE_INSTALL_DIR -ULIB_INSTALL_DIR -USYSCONF_INSTALL_DIR -USHARE_INSTALL_PREFIX -ULIB_SUFFIX \ + -DSETUPTOOLS_DEB_LAYOUT=OFF \ + -DBUILD_TESTING=OFF +%make_build %install cd controllers/easynav_mpc_controller/.obj - -# ROS 基座环境 -[ -f /opt/ros/%{ros_distro}/setup.sh ] && source /opt/ros/%{ros_distro}/setup.sh || true -export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages${PYTHONPATH:+:$PYTHONPATH} -export PKG_CONFIG_PATH=/opt/ros/%{ros_distro}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} - make install DESTDIR=%{buildroot} %files -# 整树拥有:对「装了没打包」类错误免疫(spec-rules §7) +# %files 整树拥有(spec-rules §7):对「装了没打包」类错误免疫 /opt/ros/%{ros_distro} %changelog -* Sat Oct 10 2026 AI Importer <ai-importer@opencode.local> - 0.5.0-1 -- 初始 ROS humble spec,引入 easynav-mpc-controller +* Tue Oct 20 2026 AI Importer <ai-importer@opencode> - 0.5.0-1 +- Initial ROS spec for easynav-mpc-controller (humble) +- Source: easynav_plugins humble branch snapshot (commit 2580d29) +- NLopt 2.11.0 vendored as Source1 + Patch0 for offline COPR build +- Single-package policy with virtual devel/doc/runtime Provides diff --git a/nlopt-local-source.patch b/nlopt-local-source.patch new file mode 100644 index 0000000..200d01d --- /dev/null +++ b/nlopt-local-source.patch @@ -0,0 +1,11 @@ +--- a/controllers/easynav_mpc_controller/CMakeLists.txt 2026-10-20 09:29:05.457780465 +0000 ++++ b/controllers/easynav_mpc_controller/CMakeLists.txt 2026-10-20 09:29:26.748844852 +0000 +@@ -45,7 +45,7 @@ + set(nlopt_download_options DOWNLOAD_EXTRACT_TIMESTAMP TRUE) + endif() + externalproject_add(nlopt_bundled +- URL https://github.com/stevengj/nlopt/archive/refs/tags/v${nlopt_version}.tar.gz ++ URL file://${CMAKE_CURRENT_SOURCE_DIR}/nlopt-${nlopt_version}.tar.gz + URL_HASH SHA256=53e552d83e9294d67db37f0f4a23f15933a9ef698485301a18b98b40004cf0de + ${nlopt_download_options} + CMAKE_ARGS @@ -1 +1,2 @@ -79246da822661946aec1e0ef170a05e7 easynav-mpc-controller-0.5.0-1.tar.gz +8200389c8e5163f1c5567835922624c9 2580d29baefe77305c6e9336dca743aa5ce51c2c.tar.gz +fea2e0e632b2fb11cb8355e8c8129bb8 nlopt-2.11.0.tar.gz |
