From d2ae509bbde63eca59b6a02b9647bac7546bcda9 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Tue, 20 Oct 2026 10:42:15 +0000 Subject: automatic import of ros-humble-easynav-mpc-controller --- easynav-mpc-controller.spec | 5 +++++ eigen-matrix-init-fix.patch | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 eigen-matrix-init-fix.patch diff --git a/easynav-mpc-controller.spec b/easynav-mpc-controller.spec index b19a83e..ad37314 100644 --- a/easynav-mpc-controller.spec +++ b/easynav-mpc-controller.spec @@ -26,6 +26,10 @@ Source0: https://github.com/EasyNavigation/easynav_plugins/archive/%{commit}. # 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 +# Eigen < 3.4 不支持 Matrix2d 的 brace-enclosed initializer list 语法 +# {{a,b},{c,d}},openEuler 24.03 自带 Eigen 3.3 编译报错。改用逗号初始化器 +# (Matrix2d() << ...).finished() 替代,兼容 Eigen 3.3+ +Patch1: eigen-matrix-init-fix.patch # debug 子包无意义(/opt 前缀,strip/debugedit 路径非常规),统一关闭 %global debug_package %{nil} @@ -141,3 +145,4 @@ make install DESTDIR=%{buildroot} - NLopt 2.11.0 vendored as Source1 + Patch0 for offline COPR build - Single-package policy with virtual devel/doc/runtime Provides - Fix: 注释中 cmake 宏泄漏导致构建失败,改用直接 cmake 调用(对齐 mhamcl 兄弟包) +- Fix: Eigen Matrix2d brace-init 不兼容 Eigen 3.3,Patch1 改用逗号初始化器 diff --git a/eigen-matrix-init-fix.patch b/eigen-matrix-init-fix.patch new file mode 100644 index 0000000..20f9696 --- /dev/null +++ b/eigen-matrix-init-fix.patch @@ -0,0 +1,15 @@ +--- a/controllers/easynav_mpc_controller/include/easynav_mpc_controller/MPCOptimizer.hpp ++++ b/controllers/easynav_mpc_controller/include/easynav_mpc_controller/MPCOptimizer.hpp +@@ -72,9 +72,9 @@ + private: + int N_ {5}; ///< Horizont Step to optimize. + double dt_ {0.1}; ///< Differential time to integrate. +- Eigen::Matrix2d Q_ {{4.0, 0.0}, {0.0, 4.0}}; ///< Tracking Cost Matrix +- Eigen::Matrix2d R_ {{0.1, 0.0}, {0.0, 0.1}}; ///< Effort Cost Matrix +- Eigen::Matrix2d Rd_ {{0.1, 0.0}, {0.0, 0.1}}; ///< Smooth Cost Matrix ++ Eigen::Matrix2d Q_ = (Eigen::Matrix2d() << 4.0, 0.0, 0.0, 4.0).finished(); ///< Tracking Cost Matrix ++ Eigen::Matrix2d R_ = (Eigen::Matrix2d() << 0.1, 0.0, 0.0, 0.1).finished(); ///< Effort Cost Matrix ++ Eigen::Matrix2d Rd_ = (Eigen::Matrix2d() << 0.1, 0.0, 0.0, 0.1).finished(); ///< Smooth Cost Matrix + double qtheta_ {3.0}; ///< Angular cost value. + + }; -- cgit v1.2.3