Arena 5.0 / Colcon build failures (Nav2, DWB, rosidl)
What broke
Symptom A: Nav2/DWB fails with -Werror=maybe-uninitialized
On the first colcon build after running bash install.sh in the repo root, 7 packages failed: nav2_constrained_smoother, nav2_smoother, nav2_planner, nav2_waypoint_follower, nav2_behaviors, dwb_critics and dwb_plugins.
The blocker was the toolchain treating warnings as errors, specifically -Werror=maybe-uninitialized.
Symptom B: partial rebuild fails with “Failed to find … package.sh”
After the initial failure, trying to rebuild only Nav2 packages while their install prefixes were missing caused errors like:
- “Failed to find …
package.sh”
Fix (exact sequence)
Step 1: load the workspace environment
cd ~/arena5_wssource src/Arena/_meta/tools/sourceStep 2 (optional): clean Nav2/DWB residues
Do this if the install prefixes are missing, or if you want a clean forced rebuild for Nav2/DWB.
rm -rf build/nav2_* build/dwb_* install/nav2_* install/dwb_* logStep 3 (only if needed): rebuild rosidl fundamentals
If you see missing rosidl_cmake files (for example, it cannot find rosidl_generate_interfaces.cmake), clean rosidl and rebuild the rosidl baseline first:
rm -rf build/rosidl_* install/rosidl_* log
colcon build --symlink-install --event-handlers console_direct+ \ --packages-select rosidl_cmake rosidl_generator_c rosidl_generator_cpp \ rosidl_typesupport_introspection_c rosidl_typesupport_introspection_cpp \ rosidl_typesupport_fastrtps_c rosidl_typesupport_fastrtps_cpp \ rosidl_generator_py rosidl_generator_tests \ --cmake-args -DCMAKE_CXX_FLAGS="-Wno-error=maybe-uninitialized -Wno-error=uninitialized"Step 4: rebuild Nav2 + DWB (allow warnings)
colcon build --symlink-install --event-handlers console_direct+ \ --packages-up-to nav2_behaviors nav2_constrained_smoother nav2_planner \ nav2_smoother nav2_waypoint_follower dwb_critics dwb_plugins \ --cmake-args -DCMAKE_CXX_FLAGS="-Wno-error -Wno-error=maybe-uninitialized -Wno-error=uninitialized"Result
The build completed with:
Summary: 185 packages finished
Most remaining stderr output was lint / warning noise. The hard blockers (Nav2 + rosidl) were resolved.
文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!