Repository navigation
Add field decomposition (trapezoidal / boustrophedon) with HL_SWATH handling - #113
Conversation
There was a problem hiding this comment.
Pull request overview
Adds optional field decomposition support (trapezoidal / boustrophedon) to the coverage pipeline, including the multi-cell generator overloads and message/BT plumbing needed to run decomposition from action goals or node defaults. Also updates path conversion to tolerate HL_SWATH sections produced by decomposed fields, and extends testing and CI dependencies accordingly.
Changes:
- Introduces
DecompGenerator+DecompType, newDecompMode.msg, and wires decomposition intocoverage_serverbehindgenerate_decomp/default_generate_decomp. - Adds multi-cell swath/headland generation paths (
F2CCells) and updates path conversions to treatHL_SWATHas swath-like. - Expands unit/integration tests and updates CI apt dependencies to keep rolling builds green.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| opennav_row_coverage/src/row_coverage_server.cpp | Propagates per-pose velocity/direction outputs and guards task_time with std::isfinite. |
| opennav_coverage/test/test_utils.cpp | Adds/updates tests for HL_SWATH handling, discretization behavior, per-pose velocity/direction, and task_time. |
| opennav_coverage/test/test_swath.cpp | Extends swath objective tests and adds multi-cell swath generation test. |
| opennav_coverage/test/test_server.cpp | Adds server-level action tests that exercise decomposition paths. |
| opennav_coverage/test/test_headland.cpp | Adds multi-cell headland generation test. |
| opennav_coverage/test/test_decomp_generator.cpp | New unit tests for decomposition mode parsing and decomposition behavior. |
| opennav_coverage/test/CMakeLists.txt | Registers the new decomposition gtest target. |
| opennav_coverage/src/swath_generator.cpp | Refactors swath param resolution, adds multi-cell overload, and adds NUMBER_MODIFIED objective support. |
| opennav_coverage/src/headland_generator.cpp | Adds a multi-cell overload applying headlands per decomposed cell. |
| opennav_coverage/src/decomp_generator.cpp | Implements decomposition execution and string/type conversions. |
| opennav_coverage/src/coverage_server.cpp | Wires decomposition into the server pipeline and fills velocity/direction/task_time outputs. |
| opennav_coverage/include/opennav_coverage/utils.hpp | Treats HL_SWATH as swath-like in coverage message conversion; refactors nav path conversion and adds optional velocity/direction outputs. |
| opennav_coverage/include/opennav_coverage/types.hpp | Adds DecompType and extends SwathType with NUMBER_MODIFIED. |
| opennav_coverage/include/opennav_coverage/swath_generator.hpp | Declares multi-cell overload and shared swath param resolution struct/helper. |
| opennav_coverage/include/opennav_coverage/headland_generator.hpp | Declares multi-cell headland overload. |
| opennav_coverage/include/opennav_coverage/decomp_generator.hpp | Declares decomposition generator, configuration parameters, and conversion helpers. |
| opennav_coverage/include/opennav_coverage/coverage_server.hpp | Adds DecompGenerator member and default decomposition gating parameter. |
| opennav_coverage/CMakeLists.txt | Builds the new decomposition source and adjusts compile options for rolling GCC warnings. |
| opennav_coverage_msgs/msg/SwathMode.msg | Documents NUMBER_MODIFIED as a supported swath objective string. |
| opennav_coverage_msgs/msg/PathComponents.msg | Adds per-pose velocities and is_backward arrays aligned with nav_path.poses. |
| opennav_coverage_msgs/msg/DecompMode.msg | New message type for decomposition mode and split-angle. |
| opennav_coverage_msgs/CMakeLists.txt | Adds DecompMode.msg to interface generation. |
| opennav_coverage_msgs/action/ComputeCoveragePath.action | Adds decomposition goal fields and task_time in the result. |
| opennav_coverage_demo/params/demo_params.yaml | Adds default decomposition parameters for the demo configuration. |
| opennav_coverage_bt/test/test_compute_coverage_path.cpp | Adds BT test asserting new decomposition ports flow into the action goal. |
| opennav_coverage_bt/src/compute_complete_coverage_path.cpp | Populates new decomposition goal fields from BT ports. |
| opennav_coverage_bt/include/opennav_coverage_bt/compute_complete_coverage_path.hpp | Declares new BT input ports for decomposition mode and split angle. |
| .github/workflows/test.yml | Adds missing build dependencies for rolling CI images (vendor helper, OpenBLAS, message_filters). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
95d86a9 to
b8b6ae3
Compare
|
I didn't understand a thing, I didn't change anything, but the ci/cd crashed. This is getting annoying. |
The colcon build/install cache was keyed only on deps.repos, but the container image tag (:master) is rebuilt nightly and rosdep installs from the live rolling repo. Reusing a build tree configured in an older image breaks incremental make with stale baked-in flags (seen as behaviortree_cpp failing to find ament_index_cpp headers while the package was installed). Split the cache in two: sources (src/deps, keyed on deps.repos as before) and build/install, now also keyed on a dpkg fingerprint taken after all apt/rosdep steps. Any environment change forces one clean rebuild instead of a poisoned incremental one. The build cache is never restored when the source cache missed, so an old tree can't be combined with freshly imported sources.
ament_index_cpp 1.14 (rolling, 2026-06-30) removed get_package_share_directory() -- both the header and the library symbol -- in favour of get_package_share_path(). The sources we build from live branches still include it (BehaviorTree.CPP master's xml_parsing.cpp; nav2 main's node_utils.hpp includes it unconditionally with only the replacement include version-guarded; several nav2 tests), so a clean build cannot succeed on the current image. Restore the header as an inline forwarder to get_package_share_path() before the build. The step is a no-op when the real header exists, and the shim gets a fixed mtime so cached objects that depend on it are not recompiled on every run.
|
I know there are tons of comments in the ci/cd code, but I'm really confused about that right now; once the issues are resolved, I'll simplify it. |
nav2 main's map_io.cpp uses rclcpp::get_logger, RCLCPP_*_STREAM and rclcpp::Clock without including any rclcpp header; the transitive includes it relied on are gone from current rolling, so it fails to compile. Insert the three includes it actually uses, the same way the nav2_common -Werror patch is applied. Verified against the exact CI image (digest 9fa05b82) in a local container reproducing every workflow step: full 54-package build succeeds and all 305 tests of the opennav packages pass.
Co-authored-by: Steve Macenski <[email protected]>
Co-authored-by: Steve Macenski <[email protected]>
Co-authored-by: Steve Macenski <[email protected]>
SteveMacenski
left a comment
There was a problem hiding this comment.
Got it - ping me with CI fixed and I'll merge
|
Do you have any idea why it might be broken and what steps I should take? |
OR-Tools v9.9 compiles gurobi_isv.cc without depending on the target that generates its math_opt proto header, failing nondeterministically under parallel make. Backport the one-line v9.10 fix as a vendor patch; verified in the CI image. Also add one visible build retry.
Existing source caches predate the patch file, so gating it on a cache miss would leave the race unfixed until the cache rotates. Idempotent, fixed mtime.
|
@SteveMacenski i think everything is okey. Do you think we're doing well? Is there anything we need to change? Both in terms of the project and for personal feedback. |
|
This all seems good!! |
Summary
Second PR in the series splitting the Fields2Cover (F2C) v2 enhancement branch
into reviewable chunks. Adds optional field decomposition — splitting a
non-convex field into sub-cells before swath/headland generation — plus the
HL_SWATHpath handling that decomposed fields require. Builds on #112.Changes
Field decomposition (core)
DecompTypeenum:NONE,TRAPEZOIDAL,BOUSTROPHEDON.DecompGenerator: wraps the Fields2Cover decomposition, selectable via modeand
split_angle.F2CCellsproduced by decomposition.coverage_serverbehind a single gate: thegenerate_decompgoalflag or a
default_generate_decompYAML parameter.HL_SWATH handling
HL_SWATHstates for inter-cell headland passes.toCoveragePathMsg/toNavPathMsgnow treatHL_SWATHlikeSWATH, sodecomposed fields no longer crash the server.
Interface changes (additive)
DecompMode.msg(new):string mode(NONE/TRAPEZOIDAL/BOUSTROPHEDON),float64 split_angle(radians;0= parallel to swath angle).ComputeCoveragePath.action:+ bool generate_decomp,+ DecompMode decomp_mode.types.hpp:+ enum class DecompType.Testing
HL_SWATHpath-conversion test (velocity/direction fill withHL_SWATHstates).Note
This adds the decomposition machinery and message/BT plumbing. The TSP route
planning that consumes the decomposed cells follows in the next PR of the series.