Skip to content

Add field decomposition (trapezoidal / boustrophedon) with HL_SWATH handling#113

Open
u33549 wants to merge 13 commits into
open-navigation:mainfrom
u33549:Feature/umutc/f2c-enhancements-main/2-decomposition
Open

Add field decomposition (trapezoidal / boustrophedon) with HL_SWATH handling#113
u33549 wants to merge 13 commits into
open-navigation:mainfrom
u33549:Feature/umutc/f2c-enhancements-main/2-decomposition

Conversation

@u33549

@u33549 u33549 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

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_SWATH path handling that decomposed fields require. Builds on #112.

Changes

Field decomposition (core)

  • DecompType enum: NONE, TRAPEZOIDAL, BOUSTROPHEDON.
  • DecompGenerator: wraps the Fields2Cover decomposition, selectable via mode
    and split_angle.
  • Multi-cell overloads for the swath and headland generators, operating on the
    F2CCells produced by decomposition.
  • Wired into coverage_server behind a single gate: the generate_decomp goal
    flag or a default_generate_decomp YAML parameter.
  • BT node ports exposing decomposition control.

HL_SWATH handling

  • Decomposition emits HL_SWATH states for inter-cell headland passes.
    toCoveragePathMsg/toNavPathMsg now treat HL_SWATH like SWATH, so
    decomposed 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

  • Decomposition + multi-cell swath/headland generation unit tests.
  • HL_SWATH path-conversion test (velocity/direction fill with HL_SWATH states).

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.

Copilot AI review requested due to automatic review settings July 3, 2026 01:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, new DecompMode.msg, and wires decomposition into coverage_server behind generate_decomp / default_generate_decomp.
  • Adds multi-cell swath/headland generation paths (F2CCells) and updates path conversions to treat HL_SWATH as 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.

Comment thread opennav_coverage/src/swath_generator.cpp
Comment thread opennav_coverage/src/swath_generator.cpp
Comment thread opennav_coverage/include/opennav_coverage/swath_generator.hpp Outdated
Comment thread opennav_coverage_msgs/msg/DecompMode.msg Outdated
Comment thread opennav_coverage/src/decomp_generator.cpp
@u33549 u33549 force-pushed the Feature/umutc/f2c-enhancements-main/2-decomposition branch from 95d86a9 to b8b6ae3 Compare July 3, 2026 07:17
@u33549

u33549 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

I didn't understand a thing, I didn't change anything, but the ci/cd crashed. This is getting annoying.

u33549 added 2 commits July 3, 2026 11:29
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.
@u33549

u33549 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants