ros2-humble-nav2-route

maintainer AutoUpdateBot · 0 votes · base ros2-humble-navigation2 · scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged The flagged `eval` at line 247 is used to dynamically generate `package_*` functions for each subpackage in the split package array. The pattern `eval "$pkgfunc() { _pkg_copy $_subdir; }"` is a well-known and legitimate Arch Linux technique for split PKGBUILDs to avoid repeating boilerplate package functions. The `_subdir` variable is derived entirely from the `pkgname` array (which is statically defined in the PKGBUILD) via simple string manipulation (prefix stripping and sed transliteration), so there is no external or runtime-controlled input. The 'encoded payload' flag is a false positive — the heredoc Python script (`<<'PY'`) is a straightforward inline source patch to fix xtensor 0.27 API compatibility, not an obfuscated payload. The single source tarball is fetched from the official GitHub release URL for ros-navigation/navigation2 with a sha256sum. The prepare() step only performs header path remapping and a mechanical code substitution within the downloaded source tree. No external binaries are fetched, no data is exfiltrated, and no attacker-controlled hosts are involved. The package is a legitimate complex ROS2 split PKGBUILD. The only real concern is the dynamic eval, which is sloppy but not malicious given the fully static inputs.

Triggered rules

LOW AI review downgraded a static finding llm_review

The static rules flagged this HIGH, but an AI model (anthropic/claude-sonnet-4.6) reviewed the full PKGBUILD and judged it LOW (confidence 85%): The flagged `eval` at line 247 is used to dynamically generate `package_*` functions for each subpackage in the split package array. The pattern `eval "$pkgfunc() { _pkg_copy $_subdir; }"` is a well-known and legitimate Arch Linux technique for split PKGBUILDs to avoid repeating boilerplate package functions. The `_subdir` variable is derived entirely from the `pkgname` array (which is statically defined in the PKGBUILD) via simple string manipulation (prefix stripping and sed transliteration), so there is no external or runtime-controlled input. The 'encoded payload' flag is a false positive — the heredoc Python script (`<<'PY'`) is a straightforward inline source patch to fix xtensor 0.27 API compatibility, not an obfuscated payload. The single source tarball is fetched from the official GitHub release URL for ros-navigation/navigation2 with a sha256sum. The prepare() step only performs header path remapping and a mechanical code substitution within the downloaded source tree. No external binaries are fetched, no data is exfiltrated, and no attacker-controlled hosts are involved. The package is a legitimate complex ROS2 split PKGBUILD. The only real concern is the dynamic eval, which is sloppy but not malicious given the fully static inputs.

  • PKGBUILD:247 eval "$pkgfunc() { _pkg_copy $_subdir; }"
1 higher static finding superseded - not the current verdict (shown for transparency)
HIGH Encoded/compressed payload decoded and executed base64_decode_exec

A payload is decoded/decompressed (base64, hex, gzip/xz/zstd, rev, tr, openssl…) and executed — piped to a shell/interpreter, run via process substitution/eval, captured into a variable then eval'd, or decoded+exec'd in a scripting language — hiding the real command from review.

  • PKGBUILD:247 eval "$pkgfunc() { _pkg_copy $_subdir; }"

PKGBUILD

1 offending line(s) highlighted
1# Maintainer: Angelo Elias Dal Zotto <angelodalzotto97@gmail.com>
2# Navigation2 full batch - all ~36 subpackages for ROS2 Humble
3
4pkgbase=ros2-humble-navigation2
5pkgname=(
6 # Batch1 - Core (7)
7## ros2-humble-nav2-common ## already on AUR as a standalone package; commented out to avoid name conflict
8## ros2-humble-nav2-msgs ## already on AUR as a standalone package; commented out to avoid name conflict
9## ros2-humble-nav2-util ## already on AUR as a standalone package; commented out to avoid name conflict
10## ros2-humble-nav2-voxel-grid ## already on AUR as a standalone package; commented out to avoid name conflict
11## ros2-humble-nav2-costmap-2d ## already on AUR as a standalone package; commented out to avoid name conflict
12## ros2-humble-nav2-core ## already on AUR as a standalone package; commented out to avoid name conflict
13## ros2-humble-nav2-theta-star-planner ## already on AUR as a standalone package; commented out to avoid name conflict
14 # Batch2 - Mid-level (6)
15## ros2-humble-nav2-amcl ## already on AUR as a standalone package; commented out to avoid name conflict
16## ros2-humble-nav2-behavior-tree ## already on AUR as a standalone package; commented out to avoid name conflict
17## ros2-humble-nav2-bt-navigator ## already on AUR as a standalone package; commented out to avoid name conflict
18## ros2-humble-nav2-behaviors ## already on AUR as a standalone package; commented out to avoid name conflict
19## ros2-humble-nav2-collision-monitor ## already on AUR as a standalone package; commented out to avoid name conflict
20## ros2-humble-nav2-constrained-smoother ## already on AUR as a standalone package; commented out to avoid name conflict
21 # Batch3 - DWB nested packages (8)
22## ros2-humble-nav-2d-msgs ## already on AUR as a standalone package; commented out to avoid name conflict
23## ros2-humble-nav-2d-utils ## already on AUR as a standalone package; commented out to avoid name conflict
24## ros2-humble-dwb-msgs ## already on AUR as a standalone package; commented out to avoid name conflict
25## ros2-humble-costmap-queue ## already on AUR as a standalone package; commented out to avoid name conflict
26## ros2-humble-dwb-core ## already on AUR as a standalone package; commented out to avoid name conflict
27## ros2-humble-dwb-plugins ## already on AUR as a standalone package; commented out to avoid name conflict
28## ros2-humble-dwb-critics ## already on AUR as a standalone package; commented out to avoid name conflict
29## ros2-humble-nav2-dwb-controller ## already on AUR as a standalone package; commented out to avoid name conflict
30 # Batch4 - Controllers/planners (12)
31## ros2-humble-nav2-controller ## already on AUR as a standalone package; commented out to avoid name conflict
32## ros2-humble-nav2-lifecycle-manager ## already on AUR as a standalone package; commented out to avoid name conflict
33## ros2-humble-nav2-map-server ## already on AUR as a standalone package; commented out to avoid name conflict
34## ros2-humble-nav2-navfn-planner ## already on AUR as a standalone package; commented out to avoid name conflict
35## ros2-humble-nav2-planner ## already on AUR as a standalone package; commented out to avoid name conflict
36## ros2-humble-nav2-smoother ## already on AUR as a standalone package; commented out to avoid name conflict
37## ros2-humble-nav2-regulated-pure-pursuit-controller ## already on AUR as a standalone package; commented out to avoid name conflict
38## ros2-humble-nav2-rotation-shim-controller ## already on AUR as a standalone package; commented out to avoid name conflict
39 'ros2-humble-nav2-graceful-controller'
40## ros2-humble-nav2-rviz-plugins ## already on AUR as a standalone package; commented out to avoid name conflict
41 # Batch5 - Remaining (2)
42## ros2-humble-nav2-simple-commander ## already on AUR as a standalone package; commented out to avoid name conflict
43## ros2-humble-nav2-velocity-smoother ## already on AUR as a standalone package; commented out to avoid name conflict
44 # Batch6 - Previously skipped, now buildable (6)
45 'ros2-humble-nav2-route'
46## ros2-humble-nav2-waypoint-follower ## already on AUR as a standalone package; commented out to avoid name conflict
47## ros2-humble-nav2-smac-planner ## already on AUR as a standalone package; commented out to avoid name conflict
48 'ros2-humble-nav2-mppi-controller'
49## ros2-humble-nav2-bringup ## already on AUR as a standalone package; commented out to avoid name conflict
50 'ros2-humble-navigation2'
51 'ros2-humble-nav2-system-tests'
52)
53pkgver=1.1.20
54pkgrel=2
55pkgdesc="ROS 2 Navigation2 stack - full batch (all ~39 packages)"
56arch=('any')
57url="https://github.com/ros-navigation/navigation2"
58license=('Apache-2.0' 'BSD' 'MIT')
59depends=('ros2-humble')
60makedepends=(
61 'cmake' 'ros2-humble-bond_core' 'ros2-humble-smclib' 'boost'
62 'ros2-humble-angles' 'ros2-humble-behaviortree-cpp-v3' 'ceres-solver'
63 'ros2-humble-diagnostic-updater' 'graphicsmagick' 'ros2-humble-cv-bridge'
64 'nanoflann' 'ompl' 'xtensor' 'xsimd' 'xtl' 'nlohmann-json' 'benchmark'
65)
66source=("https://github.com/ros-navigation/navigation2/archive/refs/tags/${pkgver}.tar.gz")
67sha256sums=('c965b7a36ef48cd7f35f01c1f98883741693d195dae582232d6d0444d2eedab6')
68
69prepare() {
70 # xtensor 0.27 reorganized its headers into subdirectories; remap the
71 # legacy include paths used by nav2_mppi_controller.
72 local _mppi="$srcdir/navigation2-$pkgver/nav2_mppi_controller"
73 find "$_mppi" -type f \( -name '*.hpp' -o -name '*.cpp' \) -exec sed -i \
74 -e 's|<xtensor/xarray\.hpp>|<xtensor/containers/xarray.hpp>|g' \
75 -e 's|<xtensor/xfixed\.hpp>|<xtensor/containers/xfixed.hpp>|g' \
76 -e 's|<xtensor/xtensor\.hpp>|<xtensor/containers/xtensor.hpp>|g' \
77 -e 's|<xtensor/xmath\.hpp>|<xtensor/core/xmath.hpp>|g' \
78 -e 's|<xtensor/xnoalias\.hpp>|<xtensor/core/xnoalias.hpp>|g' \
79 -e 's|<xtensor/xrandom\.hpp>|<xtensor/generators/xrandom.hpp>|g' \
80 -e 's|<xtensor/xio\.hpp>|<xtensor/io/xio.hpp>|g' \
81 -e 's|<xtensor/xsort\.hpp>|<xtensor/misc/xsort.hpp>|g' \
82 -e 's|<xtensor/xnorm\.hpp>|<xtensor/reducers/xnorm.hpp>|g' \
83 -e 's|<xtensor/xmasked_view\.hpp>|<xtensor/views/xmasked_view.hpp>|g' \
84 -e 's|<xtensor/xview\.hpp>|<xtensor/views/xview.hpp>|g' \
85 {} +
86
87 # xtensor 0.27 xmasked_view assignment is incompatible (ambiguous operator=);
88 # rewrite the Ackermann constraint using xt::where (equivalent semantics).
89 python3 - "$_mppi/include/nav2_mppi_controller/motion_models.hpp" <<'PY'
90import sys
91p = sys.argv[1]
92s = open(p).read()
93old = (" auto view = xt::masked_view(wz, (xt::fabs(vx) / xt::fabs(wz)) < min_turning_r_);\n"
94 " view = xt::sign(wz) * xt::fabs(vx) / min_turning_r_;")
95new = (" wz = xt::where(\n"
96 " (xt::fabs(vx) / xt::fabs(wz)) < min_turning_r_,\n"
97 " xt::sign(wz) * xt::fabs(vx) / min_turning_r_, wz);")
98if old not in s:
99 sys.exit("ERROR: masked_view pattern not found in motion_models.hpp")
100open(p, "w").write(s.replace(old, new))
101print("Patched motion_models.hpp: masked_view -> xt::where")
102PY
103}
104
105build() {
106 local _src="$srcdir/navigation2-$pkgver"
107 local _staging="$srcdir/_staging"
108 rm -rf "$_staging"
109 mkdir -p "$_staging"
110
111 _build_install_isolated() {
112 msg2 "Building $1 ..."
113 local _subdir="$1"
114 local _extra_prefix="$2"
115 local _extra_cmake_args="$3"
116 cd "$_src/$_subdir"
117 # Use the installed ros2-humble environment
118 source "/opt/ros/humble/setup.bash"
119 # Clear stale CMake variables
120 unset rviz_common_DIR
121 # Build-time search paths: local staging prefixes first, then ros2-humble
122 # Set both AMENT_PREFIX_PATH (for ament) and CMAKE_PREFIX_PATH (for CMake)
123 if [ -n "$_extra_prefix" ]; then
124 export AMENT_PREFIX_PATH="${_extra_prefix}:/opt/ros/humble"
125 export CMAKE_PREFIX_PATH="${_extra_prefix}:/opt/ros/humble"
126 else
127 export AMENT_PREFIX_PATH="/opt/ros/humble"
128 export CMAKE_PREFIX_PATH="/opt/ros/humble"
129 fi
130 export CXXFLAGS="${CXXFLAGS} -Wall -Wextra -Wno-error -Wno-missing-include-dirs -Wno-unused-parameter -Wno-error=maybe-uninitialized -Wno-unused-but-set-variable -include cstdint -I/usr/include/opencv4"
131 export CFLAGS="${CFLAGS} -Wno-error -Wno-unused-but-set-variable"
132 export LDFLAGS="${LDFLAGS} -Wl,-rpath-link,/opt/ros/humble/lib"
133 local _pkg_staging="$_staging/$_subdir"
134 # Check if this is a Python-only package (no CMakeLists.txt but has setup.py)
135 if [ ! -f "CMakeLists.txt" ] && [ -f "setup.py" ]; then
136 msg2 " -> Python-only package, using setup.py"
137 source "/opt/ros/humble/setup.bash"
138 PYTHONPATH="/opt/ros/humble/lib/python3.11/site-packages:${PYTHONPATH}" \
139 python setup.py install --root="$_pkg_staging" --prefix=/opt/ros/humble --optimize=1
140 return
141 fi
142 local _bdir="build-$_subdir"
143 cmake -B "$_bdir" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/ros/humble -DBUILD_TESTING=OFF $_extra_cmake_args
144 cmake --build "$_bdir" -j2
145 DESTDIR="$_pkg_staging" cmake --install "$_bdir"
146 }
147
148 # Build a search prefix from an explicit list of staged package subdirs,
149 # so each sub-package's cmake sees only its actual nav2-internal deps.
150 _prefix() {
151 local _p="" _d
152 for _d in "$@"; do
153 _p="${_p:+$_p:}$_staging/$_d/opt/ros/humble"
154 done
155 printf '%s' "$_p"
156 }
157
158 # cv_bridge + opencv4 come from -I local packages in the chroot's /opt/ros/humble
159 local _cvbridge="/opt/ros/humble"
160
161 # --- Foundation: no nav2-internal deps ---
162 _build_install_isolated nav2_common ""
163 _build_install_isolated "nav2_dwb_controller/nav_2d_msgs" ""
164
165 # --- msgs / voxel_grid / util ---
166 _build_install_isolated nav2_msgs "$(_prefix nav2_common)"
167 _build_install_isolated nav2_voxel_grid "$(_prefix nav2_common)"
168 _build_install_isolated nav2_util "$(_prefix nav2_common nav2_msgs)"
169 _build_install_isolated "nav2_dwb_controller/nav_2d_utils" "$(_prefix nav2_common nav2_msgs nav2_util nav2_dwb_controller/nav_2d_msgs)"
170
171 # --- costmap_2d / core ---
172 _build_install_isolated nav2_costmap_2d "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid)"
173 _build_install_isolated nav2_core "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d)"
174
175 # --- localization / behavior / lifecycle / map ---
176 _build_install_isolated nav2_amcl "$(_prefix nav2_common nav2_msgs nav2_util)"
177 _build_install_isolated nav2_behavior_tree "$(_prefix nav2_common nav2_msgs nav2_util)"
178 _build_install_isolated nav2_lifecycle_manager "$(_prefix nav2_common nav2_msgs nav2_util)"
179 _build_install_isolated nav2_map_server "$(_prefix nav2_common nav2_msgs nav2_util)"
180 _build_install_isolated nav2_velocity_smoother "$(_prefix nav2_common nav2_msgs nav2_util)"
181 _build_install_isolated nav2_simple_commander ""
182
183 # --- planners / controllers (transitive closure via costmap_2d + core) ---
184 _build_install_isolated nav2_theta_star_planner "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
185 _build_install_isolated nav2_collision_monitor "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d)"
186 _build_install_isolated nav2_constrained_smoother "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
187 _build_install_isolated nav2_navfn_planner "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
188 _build_install_isolated nav2_planner "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
189 _build_install_isolated nav2_regulated_pure_pursuit_controller "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
190 _build_install_isolated nav2_route "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
191 _build_install_isolated nav2_smac_planner "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
192 _build_install_isolated nav2_mppi_controller "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)" "-DCMAKE_CXX_STANDARD=20"
193 _build_install_isolated nav2_waypoint_follower "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core):$_cvbridge"
194 _build_install_isolated nav2_controller "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils)"
195 _build_install_isolated nav2_smoother "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils)"
196 _build_install_isolated nav2_graceful_controller "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils)"
197
198 # --- depend on behavior_tree ---
199 _build_install_isolated nav2_bt_navigator "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_behavior_tree)"
200 _build_install_isolated nav2_behaviors "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_behavior_tree)"
201
202 # --- depend on lifecycle_manager ---
203 _build_install_isolated nav2_rviz_plugins "$(_prefix nav2_common nav2_msgs nav2_util nav2_lifecycle_manager)"
204
205 # --- depend on controller ---
206 _build_install_isolated nav2_rotation_shim_controller "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils nav2_controller)"
207
208 # --- DWB chain ---
209 _build_install_isolated "nav2_dwb_controller/dwb_msgs" "$(_prefix nav2_dwb_controller/nav_2d_msgs)"
210 _build_install_isolated "nav2_dwb_controller/costmap_queue" "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d)"
211 _build_install_isolated "nav2_dwb_controller/dwb_core" "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils nav2_dwb_controller/dwb_msgs)"
212 _build_install_isolated "nav2_dwb_controller/dwb_critics" "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils nav2_dwb_controller/dwb_msgs nav2_dwb_controller/dwb_core nav2_dwb_controller/costmap_queue)"
213 _build_install_isolated "nav2_dwb_controller/dwb_plugins" "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils nav2_dwb_controller/dwb_msgs nav2_dwb_controller/dwb_core)"
214 _build_install_isolated "nav2_dwb_controller/nav2_dwb_controller" "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils nav2_dwb_controller/dwb_msgs nav2_dwb_controller/dwb_core nav2_dwb_controller/costmap_queue nav2_dwb_controller/dwb_critics nav2_dwb_controller/dwb_plugins)"
215
216 # --- metapackage + bringup ---
217 _build_install_isolated navigation2 ""
218 _build_install_isolated nav2_bringup "$(_prefix navigation2 nav2_common)"
219
220 # --- system tests (needs gazebo_ros_pkgs via /opt/ros/humble from -I, and
221 # transitively nearly all nav2 packages via the packages it tests) ---
222 local _all_nav2="$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_theta_star_planner nav2_amcl nav2_behavior_tree nav2_bt_navigator nav2_behaviors nav2_collision_monitor nav2_constrained_smoother nav2_controller nav2_lifecycle_manager nav2_map_server nav2_navfn_planner nav2_planner nav2_smoother nav2_regulated_pure_pursuit_controller nav2_rotation_shim_controller nav2_graceful_controller nav2_rviz_plugins nav2_simple_commander nav2_velocity_smoother nav2_route nav2_smac_planner nav2_mppi_controller nav2_waypoint_follower nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils nav2_dwb_controller/dwb_msgs nav2_dwb_controller/costmap_queue nav2_dwb_controller/dwb_core nav2_dwb_controller/dwb_plugins nav2_dwb_controller/dwb_critics nav2_dwb_controller/nav2_dwb_controller navigation2 nav2_bringup)"
223 _build_install_isolated nav2_system_tests "${_all_nav2}:/opt/ros/humble"
224}
225
226_pkg_copy() {
227 local _subdir="$1"
228 local _staging_pkg="$srcdir/_staging/$_subdir"
229 mkdir -p "$pkgdir/opt/ros/humble"
230 if [ -d "$_staging_pkg/opt/ros/humble" ]; then
231 cp -r "$_staging_pkg/opt/ros/humble/." "$pkgdir/opt/ros/humble/"
232 fi
233}
234
235# Generate package functions automatically
236for pkg in "${pkgname[@]}"; do
237 pkgfunc="package_$pkg"
238 # Extract subdir name from pkgname (e.g., ros2-humble-nav2-common -> nav2_common)
239 _subdir="${pkg#ros2-humble-}"
240 _subdir="$(echo "$_subdir" | sed 's/-/_/g')"
241 # Special cases: nested source directories within nav2_dwb_controller
242 if [[ "$_subdir" == "nav_2d_utils" || "$_subdir" == "nav_2d_msgs" || "$_subdir" == "costmap_queue" || "$_subdir" == "dwb_core" || "$_subdir" == "dwb_critics" || "$_subdir" == "dwb_msgs" || "$_subdir" == "dwb_plugins" ]]; then
243 _subdir="nav2_dwb_controller/$_subdir"
244 elif [[ "$_subdir" == "nav2_dwb_controller" ]]; then
245 _subdir="nav2_dwb_controller/nav2_dwb_controller"
246 fi
247 eval "$pkgfunc() { _pkg_copy $_subdir; }"
248done
249

Changes since previous scan

--- PKGBUILD @ 2026-07-30 00:17
+++ PKGBUILD @ 2026-08-03 00:08
@@ -1,60 +1,249 @@
# Maintainer: Angelo Elias Dal Zotto <angelodalzotto97@gmail.com>
-
-_pkgroot=navigation2
-_pkgname=navigation2
-pkgname=ros2-humble-navigation2
-pkgver=1.1.7
+# Navigation2 full batch - all ~36 subpackages for ROS2 Humble
+
+pkgbase=ros2-humble-navigation2
+pkgname=(
+ # Batch1 - Core (7)
+## ros2-humble-nav2-common ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-msgs ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-util ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-voxel-grid ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-costmap-2d ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-core ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-theta-star-planner ## already on AUR as a standalone package; commented out to avoid name conflict
+ # Batch2 - Mid-level (6)
+## ros2-humble-nav2-amcl ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-behavior-tree ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-bt-navigator ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-behaviors ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-collision-monitor ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-constrained-smoother ## already on AUR as a standalone package; commented out to avoid name conflict
+ # Batch3 - DWB nested packages (8)
+## ros2-humble-nav-2d-msgs ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav-2d-utils ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-dwb-msgs ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-costmap-queue ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-dwb-core ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-dwb-plugins ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-dwb-critics ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-dwb-controller ## already on AUR as a standalone package; commented out to avoid name conflict
+ # Batch4 - Controllers/planners (12)
+## ros2-humble-nav2-controller ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-lifecycle-manager ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-map-server ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-navfn-planner ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-planner ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-smoother ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-regulated-pure-pursuit-controller ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-rotation-shim-controller ## already on AUR as a standalone package; commented out to avoid name conflict
+ 'ros2-humble-nav2-graceful-controller'
+## ros2-humble-nav2-rviz-plugins ## already on AUR as a standalone package; commented out to avoid name conflict
+ # Batch5 - Remaining (2)
+## ros2-humble-nav2-simple-commander ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-velocity-smoother ## already on AUR as a standalone package; commented out to avoid name conflict
+ # Batch6 - Previously skipped, now buildable (6)
+ 'ros2-humble-nav2-route'
+## ros2-humble-nav2-waypoint-follower ## already on AUR as a standalone package; commented out to avoid name conflict
+## ros2-humble-nav2-smac-planner ## already on AUR as a standalone package; commented out to avoid name conflict
+ 'ros2-humble-nav2-mppi-controller'
+## ros2-humble-nav2-bringup ## already on AUR as a standalone package; commented out to avoid name conflict
+ 'ros2-humble-navigation2'
+ 'ros2-humble-nav2-system-tests'
+)
+pkgver=1.1.20
pkgrel=2
-pkgdesc="ROS2 Navigation Stack"
-url="https://index.ros.org/p/navigation2/"
+pkgdesc="ROS 2 Navigation2 stack - full batch (all ~39 packages)"
arch=('any')
-depends=(
- 'ros2-humble'
- 'ros2-humble-nav2-amcl'
- 'ros2-humble-nav2-behavior-tree'
- 'ros2-humble-nav2-bt-navigator'
- 'ros2-humble-nav2-collision-monitor'
- 'ros2-humble-nav2-constrained-smoother'
- 'ros2-humble-nav2-controller'
- 'ros2-humble-nav2-core'
- 'ros2-humble-nav2-costmap-2d'
- 'ros2-humble-nav2-dwb-controller'
- 'ros2-humble-nav2-lifecycle-manager'
- 'ros2-humble-nav2-map-server'
- 'ros2-humble-nav2-msgs'
- 'ros2-humble-nav2-navfn-planner'
- 'ros2-humble-nav2-planner'
- 'ros2-humble-nav2-behaviors'
- 'ros2-humble-nav2-smoother'
- 'ros2-humble-nav2-regulated-pure-pursuit-controller'
- 'ros2-humble-nav2-rotation-shim-controller'
- 'ros2-humble-nav2-rviz-plugins'
- 'ros2-humble-nav2-simple-commander'
- 'ros2-humble-nav2-smac-planner'
- 'ros2-humble-nav2-smoother'
- 'ros2-humble-nav2-theta-star-planner'
- 'ros2-humble-nav2-util'
- 'ros2-humble-nav2-velocity-smoother'
- 'ros2-humble-nav2-voxel-grid'
- 'ros2-humble-nav2-waypoint-follower'
+url="https://github.com/ros-navigation/navigation2"
+license=('Apache-2.0' 'BSD' 'MIT')
+depends=('ros2-humble')
+makedepends=(
+ 'cmake' 'ros2-humble-bond_core' 'ros2-humble-smclib' 'boost'
+ 'ros2-humble-angles' 'ros2-humble-behaviortree-cpp-v3' 'ceres-solver'
+ 'ros2-humble-diagnostic-updater' 'graphicsmagick' 'ros2-humble-cv-bridge'
+ 'nanoflann' 'ompl' 'xtensor' 'xsimd' 'xtl' 'nlohmann-json' 'benchmark'
)
-makedepends=('cmake')
-source=("https://github.com/ros-planning/navigation2/archive/refs/tags/${pkgver}.tar.gz")
-sha256sums=('1d89dc1ad7c75d4d1645c882a5aee037ca965908344a158bb9669ad80a85196b')
-
+source=("https://github.com/ros-navigation/navigation2/archive/refs/tags/${pkgver}.tar.gz")
+sha256sums=('c965b7a36ef48cd7f35f01c1f98883741693d195dae582232d6d0444d2eedab6')
+
+prepare() {
+ # xtensor 0.27 reorganized its headers into subdirectories; remap the
+ # legacy include paths used by nav2_mppi_controller.
+ local _mppi="$srcdir/navigation2-$pkgver/nav2_mppi_controller"
+ find "$_mppi" -type f \( -name '*.hpp' -o -name '*.cpp' \) -exec sed -i \
+ -e 's|<xtensor/xarray\.hpp>|<xtensor/containers/xarray.hpp>|g' \
+ -e 's|<xtensor/xfixed\.hpp>|<xtensor/containers/xfixed.hpp>|g' \
+ -e 's|<xtensor/xtensor\.hpp>|<xtensor/containers/xtensor.hpp>|g' \
+ -e 's|<xtensor/xmath\.hpp>|<xtensor/core/xmath.hpp>|g' \
+ -e 's|<xtensor/xnoalias\.hpp>|<xtensor/core/xnoalias.hpp>|g' \
+ -e 's|<xtensor/xrandom\.hpp>|<xtensor/generators/xrandom.hpp>|g' \
+ -e 's|<xtensor/xio\.hpp>|<xtensor/io/xio.hpp>|g' \
+ -e 's|<xtensor/xsort\.hpp>|<xtensor/misc/xsort.hpp>|g' \
+ -e 's|<xtensor/xnorm\.hpp>|<xtensor/reducers/xnorm.hpp>|g' \
+ -e 's|<xtensor/xmasked_view\.hpp>|<xtensor/views/xmasked_view.hpp>|g' \
+ -e 's|<xtensor/xview\.hpp>|<xtensor/views/xview.hpp>|g' \
+ {} +
+
+ # xtensor 0.27 xmasked_view assignment is incompatible (ambiguous operator=);
+ # rewrite the Ackermann constraint using xt::where (equivalent semantics).
+ python3 - "$_mppi/include/nav2_mppi_controller/motion_models.hpp" <<'PY'
+import sys
+p = sys.argv[1]
+s = open(p).read()
+old = (" auto view = xt::masked_view(wz, (xt::fabs(vx) / xt::fabs(wz)) < min_turning_r_);\n"
+ " view = xt::sign(wz) * xt::fabs(vx) / min_turning_r_;")
+new = (" wz = xt::where(\n"
+ " (xt::fabs(vx) / xt::fabs(wz)) < min_turning_r_,\n"
+ " xt::sign(wz) * xt::fabs(vx) / min_turning_r_, wz);")
+if old not in s:
+ sys.exit("ERROR: masked_view pattern not found in motion_models.hpp")
+open(p, "w").write(s.replace(old, new))
+print("Patched motion_models.hpp: masked_view -> xt::where")
+PY
+}
build() {
- source /opt/ros/humble/setup.bash
-
- cmake -B build -S "$_pkgroot-$pkgver/$_pkgname" \
- -DCMAKE_BUILD_TYPE='None' \
- -DCMAKE_INSTALL_PREFIX='/opt/ros/humble' \
- -Wno-dev
-
- cmake --build build
+ local _src="$srcdir/navigation2-$pkgver"
+ local _staging="$srcdir/_staging"
+ rm -rf "$_staging"
+ mkdir -p "$_staging"
+
+ _build_install_isolated() {
+ msg2 "Building $1 ..."
+ local _subdir="$1"
+ local _extra_prefix="$2"
+ local _extra_cmake_args="$3"
+ cd "$_src/$_subdir"
+ # Use the installed ros2-humble environment
+ source "/opt/ros/humble/setup.bash"
+ # Clear stale CMake variables
+ unset rviz_common_DIR
+ # Build-time search paths: local staging prefixes first, then ros2-humble
+ # Set both AMENT_PREFIX_PATH (for ament) and CMAKE_PREFIX_PATH (for CMake)
+ if [ -n "$_extra_prefix" ]; then
+ export AMENT_PREFIX_PATH="${_extra_prefix}:/opt/ros/humble"
+ export CMAKE_PREFIX_PATH="${_extra_prefix}:/opt/ros/humble"
+ else
+ export AMENT_PREFIX_PATH="/opt/ros/humble"
+ export CMAKE_PREFIX_PATH="/opt/ros/humble"
+ fi
+ export CXXFLAGS="${CXXFLAGS} -Wall -Wextra -Wno-error -Wno-missing-include-dirs -Wno-unused-parameter -Wno-error=maybe-uninitialized -Wno-unused-but-set-variable -include cstdint -I/usr/include/opencv4"
+ export CFLAGS="${CFLAGS} -Wno-error -Wno-unused-but-set-variable"
+ export LDFLAGS="${LDFLAGS} -Wl,-rpath-link,/opt/ros/humble/lib"
+ local _pkg_staging="$_staging/$_subdir"
+ # Check if this is a Python-only package (no CMakeLists.txt but has setup.py)
+ if [ ! -f "CMakeLists.txt" ] && [ -f "setup.py" ]; then
+ msg2 " -> Python-only package, using setup.py"
+ source "/opt/ros/humble/setup.bash"
+ PYTHONPATH="/opt/ros/humble/lib/python3.11/site-packages:${PYTHONPATH}" \
+ python setup.py install --root="$_pkg_staging" --prefix=/opt/ros/humble --optimize=1
+ return
+ fi
+ local _bdir="build-$_subdir"
+ cmake -B "$_bdir" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/ros/humble -DBUILD_TESTING=OFF $_extra_cmake_args
+ cmake --build "$_bdir" -j2
+ DESTDIR="$_pkg_staging" cmake --install "$_bdir"
+ }
+
+ # Build a search prefix from an explicit list of staged package subdirs,
+ # so each sub-package's cmake sees only its actual nav2-internal deps.
+ _prefix() {
+ local _p="" _d
+ for _d in "$@"; do
+ _p="${_p:+$_p:}$_staging/$_d/opt/ros/humble"
+ done
+ printf '%s' "$_p"
+ }
+
+ # cv_bridge + opencv4 come from -I local packages in the chroot's /opt/ros/humble
+ local _cvbridge="/opt/ros/humble"
+
+ # --- Foundation: no nav2-internal deps ---
+ _build_install_isolated nav2_common ""
+ _build_install_isolated "nav2_dwb_controller/nav_2d_msgs" ""
+
+ # --- msgs / voxel_grid / util ---
+ _build_install_isolated nav2_msgs "$(_prefix nav2_common)"
+ _build_install_isolated nav2_voxel_grid "$(_prefix nav2_common)"
+ _build_install_isolated nav2_util "$(_prefix nav2_common nav2_msgs)"
+ _build_install_isolated "nav2_dwb_controller/nav_2d_utils" "$(_prefix nav2_common nav2_msgs nav2_util nav2_dwb_controller/nav_2d_msgs)"
+
+ # --- costmap_2d / core ---
+ _build_install_isolated nav2_costmap_2d "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid)"
+ _build_install_isolated nav2_core "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d)"
+
+ # --- localization / behavior / lifecycle / map ---
+ _build_install_isolated nav2_amcl "$(_prefix nav2_common nav2_msgs nav2_util)"
+ _build_install_isolated nav2_behavior_tree "$(_prefix nav2_common nav2_msgs nav2_util)"
+ _build_install_isolated nav2_lifecycle_manager "$(_prefix nav2_common nav2_msgs nav2_util)"
+ _build_install_isolated nav2_map_server "$(_prefix nav2_common nav2_msgs nav2_util)"
+ _build_install_isolated nav2_velocity_smoother "$(_prefix nav2_common nav2_msgs nav2_util)"
+ _build_install_isolated nav2_simple_commander ""
+
+ # --- planners / controllers (transitive closure via costmap_2d + core) ---
+ _build_install_isolated nav2_theta_star_planner "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
+ _build_install_isolated nav2_collision_monitor "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d)"
+ _build_install_isolated nav2_constrained_smoother "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
+ _build_install_isolated nav2_navfn_planner "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
+ _build_install_isolated nav2_planner "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
+ _build_install_isolated nav2_regulated_pure_pursuit_controller "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
+ _build_install_isolated nav2_route "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
+ _build_install_isolated nav2_smac_planner "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)"
+ _build_install_isolated nav2_mppi_controller "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core)" "-DCMAKE_CXX_STANDARD=20"
+ _build_install_isolated nav2_waypoint_follower "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core):$_cvbridge"
+ _build_install_isolated nav2_controller "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils)"
+ _build_install_isolated nav2_smoother "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils)"
+ _build_install_isolated nav2_graceful_controller "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils)"
+
+ # --- depend on behavior_tree ---
+ _build_install_isolated nav2_bt_navigator "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_behavior_tree)"
+ _build_install_isolated nav2_behaviors "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_behavior_tree)"
+
+ # --- depend on lifecycle_manager ---
+ _build_install_isolated nav2_rviz_plugins "$(_prefix nav2_common nav2_msgs nav2_util nav2_lifecycle_manager)"
+
+ # --- depend on controller ---
+ _build_install_isolated nav2_rotation_shim_controller "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils nav2_controller)"
+
+ # --- DWB chain ---
+ _build_install_isolated "nav2_dwb_controller/dwb_msgs" "$(_prefix nav2_dwb_controller/nav_2d_msgs)"
+ _build_install_isolated "nav2_dwb_controller/costmap_queue" "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d)"
+ _build_install_isolated "nav2_dwb_controller/dwb_core" "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils nav2_dwb_controller/dwb_msgs)"
+ _build_install_isolated "nav2_dwb_controller/dwb_critics" "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils nav2_dwb_controller/dwb_msgs nav2_dwb_controller/dwb_core nav2_dwb_controller/costmap_queue)"
+ _build_install_isolated "nav2_dwb_controller/dwb_plugins" "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils nav2_dwb_controller/dwb_msgs nav2_dwb_controller/dwb_core)"
+ _build_install_isolated "nav2_dwb_controller/nav2_dwb_controller" "$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils nav2_dwb_controller/dwb_msgs nav2_dwb_controller/dwb_core nav2_dwb_controller/costmap_queue nav2_dwb_controller/dwb_critics nav2_dwb_controller/dwb_plugins)"
+
+ # --- metapackage + bringup ---
+ _build_install_isolated navigation2 ""
+ _build_install_isolated nav2_bringup "$(_prefix navigation2 nav2_common)"
+
+ # --- system tests (needs gazebo_ros_pkgs via /opt/ros/humble from -I, and
+ # transitively nearly all nav2 packages via the packages it tests) ---
+ local _all_nav2="$(_prefix nav2_common nav2_msgs nav2_util nav2_voxel_grid nav2_costmap_2d nav2_core nav2_theta_star_planner nav2_amcl nav2_behavior_tree nav2_bt_navigator nav2_behaviors nav2_collision_monitor nav2_constrained_smoother nav2_controller nav2_lifecycle_manager nav2_map_server nav2_navfn_planner nav2_planner nav2_smoother nav2_regulated_pure_pursuit_controller nav2_rotation_shim_controller nav2_graceful_controller nav2_rviz_plugins nav2_simple_commander nav2_velocity_smoother nav2_route nav2_smac_planner nav2_mppi_controller nav2_waypoint_follower nav2_dwb_controller/nav_2d_msgs nav2_dwb_controller/nav_2d_utils nav2_dwb_controller/dwb_msgs nav2_dwb_controller/costmap_queue nav2_dwb_controller/dwb_core nav2_dwb_controller/dwb_plugins nav2_dwb_controller/dwb_critics nav2_dwb_controller/nav2_dwb_controller navigation2 nav2_bringup)"
+ _build_install_isolated nav2_system_tests "${_all_nav2}:/opt/ros/humble"
}
-package() {
- DESTDIR="$pkgdir" cmake --install build
+_pkg_copy() {
+ local _subdir="$1"
+ local _staging_pkg="$srcdir/_staging/$_subdir"
+ mkdir -p "$pkgdir/opt/ros/humble"
+ if [ -d "$_staging_pkg/opt/ros/humble" ]; then
+ cp -r "$_staging_pkg/opt/ros/humble/." "$pkgdir/opt/ros/humble/"
+ fi
}
+# Generate package functions automatically
+for pkg in "${pkgname[@]}"; do
+ pkgfunc="package_$pkg"
+ # Extract subdir name from pkgname (e.g., ros2-humble-nav2-common -> nav2_common)
+ _subdir="${pkg#ros2-humble-}"
+ _subdir="$(echo "$_subdir" | sed 's/-/_/g')"
+ # Special cases: nested source directories within nav2_dwb_controller
+ if [[ "$_subdir" == "nav_2d_utils" || "$_subdir" == "nav_2d_msgs" || "$_subdir" == "costmap_queue" || "$_subdir" == "dwb_core" || "$_subdir" == "dwb_critics" || "$_subdir" == "dwb_msgs" || "$_subdir" == "dwb_plugins" ]]; then
+ _subdir="nav2_dwb_controller/$_subdir"
+ elif [[ "$_subdir" == "nav2_dwb_controller" ]]; then
+ _subdir="nav2_dwb_controller/nav2_dwb_controller"
+ fi
+ eval "$pkgfunc() { _pkg_copy $_subdir; }"
+done
+

Scan history

Scanned at (UTC)SeverityRules
2026-08-03 00:08:14 LOW 2
2026-08-02 00:16:08 LOW 2
2026-08-01 00:11:18 LOW 2
2026-07-31 03:18:41 LOW 2
2026-07-31 03:17:12 HIGH 1
2026-07-30 00:17:23 CLEAN 1
2026-07-29 17:12:22 CLEAN 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion