blob: e2c2ac7e4d390424e727eb334d2af12a14fbd047 (
plain)
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
# ROS 2 包:easynav_vff_controller(ament_cmake 形态)
# 来源:EasyNavigation/easynav_plugins 仓库 humble 分支(多包仓库,本包位于
# controllers/easynav_vff_controller/ 子目录)
# 严格遵循 /app/.claude/skills/build-rpm/spec-rules-ros.md 生成
# ros_distro 取自 session.json(禁止硬编码);RosPkgName 为 package.xml <name>
# 经下划线→连字符归一化(easynav_vff_controller → easynav-vff-controller)
%define ros_distro humble
%define RosPkgName easynav-vff-controller
Name: ros-%{ros_distro}-%{RosPkgName}
Version: 0.5.0
Release: 1%{?dist}
Summary: Easy Navigation: VFF Controller package.
License: Apache-2.0
URL: https://github.com/EasyNavigation/easynav_plugins
# 源码取自 humble 分支 HEAD(branch 快照,无 0.5.0 tag)。target_version=0.5.0-1
# 已由 manifest/gate 给定,Version 取 0.5.0(剥离发布号 -1);记录实际 commit 以保可追溯。
# commit 为 ros_fetch checkout 后实测的 HEAD(git rev-parse),非占位值。
#
# 归档解压根目录(spec-rules §2 实测纪律,禁止猜测):
# 本地 `python3 -c "import tarfile; print(tarfile.open('<f>').getnames()[0])"`
# 实测 GitHub archive/<full-sha>.tar.gz 解压根目录为 easynav_plugins-<完整SHA>
# (<repo>-<commit> 格式)。故 %%autosetup -n 用 easynav_plugins-%%{commit}。
# 注:同仓兄弟 spec easynav-serest-controller 误用 -n %%{commit}(纯 SHA),
# SRPM 阶段不跑 %%prep 故未暴露,COPR 构建时 %%prep 会因 `cd: <sha>: No such file`
# 失败;本包据实测纠正。解压目录名与 Name/RosPkgName 解耦(§2)。
%global commit 2580d29baefe77305c6e9336dca743aa5ce51c2c
Source0: https://github.com/EasyNavigation/easynav_plugins/archive/%{commit}.tar.gz
# debug 子包无意义(/opt 前缀,strip/debugedit 路径非常规),统一关闭
%global debug_package %{nil}
# /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')
# ROS 包不做自动依赖扫描(.so 全在 /opt/ros 下,由 ament 间接依赖模型替代)
%global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$
%global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: make
# ament_cmake 形态构建工具依赖(spec-rules §6);ros-workspace 提供 /opt/ros setup.sh
BuildRequires: ros-%{ros_distro}-ament-cmake
BuildRequires: ros-%{ros_distro}-ros-workspace
# package.xml <depend> → ros-humble-<dep>;每条均经源码 include 核实为实际引用
# (VffController.hpp / VffController.cpp),并经 CMakeLists find_package 确认:
# easynav-common / easynav-core / easynav-sensors:easynav_*/*.hpp 实际 include
# geometry-msgs:VffController.hpp include geometry_msgs/msg/twist_stamped.hpp
# nav-msgs:VffController.cpp include nav_msgs/msg/{odometry,goals}.hpp
# pluginlib:VffController.cpp include pluginlib/class_list_macros.hpp(插件注册)
# rclcpp / rclcpp-lifecycle:CMakeLists 显式 find_package REQUIRED
# tf2:VffController.cpp include tf2/LinearMath/{Quaternion,Matrix3x3}.hpp
# visualization-msgs:VffController.hpp include visualization_msgs/msg/{marker,marker_array}.hpp
# 注:本包 package.xml 未声明 easynav-system / tf2-ros / tf2-geometry-msgs /
# sensor-msgs / pcl-conversions / eigen(与同仓 mpc/serest controller 不同),
# 据本包自身 package.xml 纪律不写入,不盲抄兄弟 spec(spec-rules §6 反幻觉铁律)。
# test_depend(ament_cmake_gtest / ament_lint_auto / ament_lint_common /
# easynav_controller)按 §5 规定不写 BuildRequires,BUILD_TESTING=OFF 关闭。
BuildRequires: ros-%{ros_distro}-easynav-common
BuildRequires: ros-%{ros_distro}-easynav-core
BuildRequires: ros-%{ros_distro}-easynav-sensors
BuildRequires: ros-%{ros_distro}-geometry-msgs
BuildRequires: ros-%{ros_distro}-nav-msgs
BuildRequires: ros-%{ros_distro}-pluginlib
BuildRequires: ros-%{ros_distro}-rclcpp
BuildRequires: ros-%{ros_distro}-rclcpp-lifecycle
BuildRequires: ros-%{ros_distro}-tf2
BuildRequires: ros-%{ros_distro}-visualization-msgs
# 系统依赖:CMakeLists find_package(PCL REQUIRED COMPONENTS common io),
# VffController.hpp include pcl/{point_cloud,point_types}.h。Debian 名
# libpcl-all-dev 禁用(§6 Debian 名禁令),openEuler 实证为 pcl-devel
# (同仓 mpc spec 已 dnf 实证 pcl-devel-1.12.1 提供 cmake(PCL))。
BuildRequires: pcl-devel
# 运行时 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
Requires: ros-%{ros_distro}-easynav-common
Requires: ros-%{ros_distro}-easynav-core
Requires: ros-%{ros_distro}-easynav-sensors
Requires: ros-%{ros_distro}-geometry-msgs
Requires: ros-%{ros_distro}-nav-msgs
Requires: ros-%{ros_distro}-pluginlib
Requires: ros-%{ros_distro}-rclcpp
Requires: ros-%{ros_distro}-rclcpp-lifecycle
Requires: ros-%{ros_distro}-tf2
Requires: ros-%{ros_distro}-visualization-msgs
# 控制器 .so 动态链接 libpcl_common/libpcl_io(在 /usr/lib64),/opt/ros 下 .so 被豁免
# 不扫 requires,故显式声明运行期 pcl
Requires: pcl
# 单包策略:严禁拆实体子包(spec-rules §7),用虚拟别名兼容依赖方
Provides: %{name}-devel = %{version}-%{release}
Provides: %{name}-doc = %{version}-%{release}
Provides: %{name}-runtime = %{version}-%{release}
%description
Easy Navigation: VFF Controller package.
A VFF (Vector Field Histogram) style local obstacle avoidance controller for
the Easy Navigation stack. Generates cmd_vel commands from proximity/cost data
and a target path reference using histogram-based steering selection. Built as
an ament_cmake shared library (vff_controller) registered as a pluginlib plugin
(easynav_vff_controller/VffController, type easynav::VffController, base
easynav::ControllerMethodBase) via easynav_core.
%prep
# 解压根目录 = easynav_plugins-<完整SHA>(本地 tar 实测,spec-rules §2)
%autosetup -n easynav_plugins-%{commit}
%build
# 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}
# 多包仓库:仅构建目标包子目录 controllers/easynav_vff_controller
# ament_cmake 形态显式 out-of-source(spec-rules §5),避免 openEuler %%cmake 宏位置参数坑
cd controllers/easynav_vff_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_vff_controller/.obj
make install DESTDIR=%{buildroot}
%files
# %%files 整树拥有(spec-rules §7):对「装了没打包」类错误免疫
/opt/ros/%{ros_distro}
%changelog
* Tue Oct 20 2026 AI Importer <ai-importer@opencode> - 0.5.0-1
- Initial ROS spec for easynav-vff-controller (humble)
- Source: easynav_plugins humble branch snapshot (commit 2580d29)
- ament_cmake shared library, pluginlib plugin via easynav_core
- Single-package policy with virtual devel/doc/runtime Provides
|