Skip to content

Add task time, per-pose velocity/direction, and NSwathModified swath objective - #112

Merged
SteveMacenski merged 8 commits into
open-navigation:mainfrom
u33549:Feature/umutc/f2c-enhancements-main/1-path-swath-output
Jul 3, 2026
Merged

SteveMacenski merged 8 commits into
open-navigation:mainfrom
u33549:Feature/umutc/f2c-enhancements-main/1-path-swath-output

Conversation

@u33549

@u33549 u33549 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

First of a few PRs splitting a larger Fields2Cover (F2C) v2 enhancement branch
into reviewable chunks, as discussed. It bundles three small, self-contained
output/objective improvements plus one build fix. None of these depend on the
larger field-decomposition / TSP-routing work that will follow in later PRs.

Changes

1. Per-pose velocity and direction on PathComponents

  • Adds float64[] velocities (m/s) and bool[] is_backward to
    PathComponents.msg, filled in parallel with nav_path.poses.
  • New toNavPathMsg overload populates the per-pose velocity/direction vectors
    alongside the path; filled only when generate_path=true, empty otherwise.
  • Wired through both coverage_server and row_coverage_server.

2. Task time on the action result + discretizeSwath refactor

  • toNavPathMsg now uses Path::discretizeSwath(step_size) instead of a
    hand-written linear-interpolation loop — only SWATH states are split,
    TURN states pass through unchanged.
  • Adds float64 task_time to the ComputeCoveragePath action result,
    populated from Path::getTaskTime() with an std::isfinite guard for
    zero-velocity states.

3. NUMBER_MODIFIED swath objective

  • Exposes Fields2Cover's f2c::obj::NSwathModified as a selectable swath
    objective via NUMBER_MODIFIED, handled in
    SwathGenerator::createObjective/toString/toType.

4. Build fix: keep -Wnull-dereference non-fatal

  • GCC false-positives on inlined ROS 2 message operator==/!= (e.g.
    coordinate__struct.hpp) reached via getFieldFromGoal(), breaking
    -Werror builds on newer toolchains. The warning stays visible but is no
    longer fatal.

Interface changes (all additive)

  • PathComponents.msg: + float64[] velocities, + bool[] is_backward
  • ComputeCoveragePath.action (result): + float64 task_time
  • SwathMode.msg: objective now also accepts NUMBER_MODIFIED (doc comment updated)

Testing

  • test_utils: discretizeSwath point count, TURN passthrough regression,
    getTaskTime normal/zero/empty; plus empty-path, forward-only,
    velocity/direction values, and vector-size-match cases.
  • test_swath: NUMBER_MODIFIED round-trips through
    toType/toString/createObjective, plus a generation smoke test.

u33549 added 4 commits July 2, 2026 13:21
GCC false-positives with -Wnull-dereference on inlined ROS 2 message
operator==/!= (e.g. coordinate__struct.hpp) when included via
getFieldFromGoal(), breaking -Werror builds on newer toolchains. Keep
the warning visible but not fatal.
…k_time

- toNavPathMsg: remove hand-written linear interpolation loop; use
  Path::discretizeSwath(step_size) — only SWATH states are split,
  TURN states pass through unchanged
- ComputeCoveragePath.action: add float64 task_time to result
- coverage_server + row_coverage_server: populate task_time via
  Path::getTaskTime() with std::isfinite guard for zero-velocity states
- test_utils: add five test cases covering discretizeSwath point count,
  TURN passthrough regression, getTaskTime normal/zero/empty
…om path states

- Add float64[] velocities and bool[] is_backward to PathComponents.msg
- Add toNavPathMsg overload that fills per-pose velocity/direction vectors
  parallel to nav_path.poses (uses discretizeSwath, same as B.7 overhaul)
- Update coverage_server and row_coverage_server to use new overload
- Add 4 unit tests: empty path, forward-only, velocity/dir values, size match
Copilot AI review requested due to automatic review settings July 2, 2026 21:11
@u33549

u33549 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

The remaining 3 pr are on their way. I split them up this way to make them easier to review.

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

This PR adds several additive outputs and objective options around Fields2Cover path generation: per-pose velocity/direction vectors on PathComponents, task_time in the ComputeCoveragePath action result, and exposes Fields2Cover’s NSwathModified as a selectable swath objective. It also adjusts build flags to keep -Wnull-dereference warnings visible without failing -Werror builds.

Changes:

  • Populate per-pose velocities and is_backward vectors in the action result alongside nav_path.
  • Refactor nav path densification to use Path::discretizeSwath() and publish task_time (guarded with std::isfinite).
  • Add NUMBER_MODIFIED swath objective support end-to-end (type enum, string conversions, objective creation, and tests).

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
opennav_row_coverage/src/row_coverage_server.cpp Populates per-pose velocity/direction vectors and task_time in the row coverage action result.
opennav_coverage/src/coverage_server.cpp Populates per-pose velocity/direction vectors and task_time in the coverage action result.
opennav_coverage/include/opennav_coverage/utils.hpp Refactors nav path construction to use discretizeSwath() and adds a toNavPathMsg overload that outputs velocity/direction vectors.
opennav_coverage/test/test_utils.cpp Adds unit tests for swath discretization count, TURN passthrough, getTaskTime, and velocity/direction vector behavior.
opennav_coverage/test/test_swath.cpp Extends tests to cover NUMBER_MODIFIED round-tripping and a smoke generation call.
opennav_coverage/src/swath_generator.cpp Adds NUMBER_MODIFIED support in createObjective, toString, and toType.
opennav_coverage/include/opennav_coverage/types.hpp Extends SwathType enum with NUMBER_MODIFIED.
opennav_coverage/CMakeLists.txt Adds -Wno-error=null-dereference to keep null-deref warnings non-fatal.
opennav_coverage_msgs/msg/SwathMode.msg Documents NUMBER_MODIFIED as an accepted objective string.
opennav_coverage_msgs/msg/PathComponents.msg Adds velocities and is_backward arrays to carry per-pose motion metadata.
opennav_coverage_msgs/action/ComputeCoveragePath.action Adds task_time to the action result.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread opennav_coverage/CMakeLists.txt Resolved
@u33549

u33549 commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor Author

A new ci/cd error ./ I'll fix it soon.

image

It was working on my computer

toNavPathMsg clears and fills its out-vectors by reference, so pass
result->coverage_path.velocities/is_backward directly instead of filling
local temporaries and copying them in. Removes two vector copies per call
in both the coverage and row-coverage servers. (Addresses PR review.)
@u33549
u33549 force-pushed the Feature/umutc/f2c-enhancements-main/1-path-swath-output branch from 74bafee to 173d137 Compare July 2, 2026 22:06
@u33549
u33549 force-pushed the Feature/umutc/f2c-enhancements-main/1-path-swath-output branch from 173d137 to 1307a3a Compare July 2, 2026 22:19
Comment thread opennav_coverage/CMakeLists.txt Resolved
@u33549
u33549 force-pushed the Feature/umutc/f2c-enhancements-main/1-path-swath-output branch from 8f219b0 to 5ba29d1 Compare July 3, 2026 00:47
@u33549

u33549 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

From now on, I will try to keep the comments shorter. I develop it with Ai and leave notes while developing it so that we don't have any problems in another session. I will pay more attention to unnecessary detailed comments before creating PR.

SteveMacenski pushed a commit that referenced this pull request Jul 13, 2026
…objective (Lyrical) (#123)

* B.6: add velocity and direction fields to PathComponents, populate from path states

- Add float64[] velocities and bool[] is_backward to PathComponents.msg
- toNavPathMsg fills per-pose velocity/direction vectors parallel to
  nav_path.poses, by reference; empty when path is not generated
- Update coverage_server and row_coverage_server to pass the vectors in place
- Add 4 unit tests: empty path, forward-only, velocity/dir values, size match

* B.7: add task_time to the action result

- ComputeCoveragePath.action: add float64 task_time to result
- coverage_server + row_coverage_server: populate task_time via
  Path::getTaskTime() with std::isfinite guard for zero-velocity states
- test_utils: add tests covering discretizeSwath point count,
  TURN passthrough regression, getTaskTime normal/zero/empty

Note: the discretizeSwath swath refactor from the rolling counterpart (#112)
already landed on lyrical via the Fields2Cover v2 migration, so only the
task_time additions are new here.

* B.4: add NSwathModified swath objective

Expose Fields2Cover's f2c::obj::NSwathModified as a selectable swath
objective via NUMBER_MODIFIED, handled in
SwathGenerator::createObjective/toString/toType, and documented in
SwathMode.msg. Add test_swath round-trips plus a generation smoke test.

* fix: keep null-dereference diagnostics non-fatal

GCC false-positives with -Wnull-dereference on inlined ROS 2 message
operator==/!= (e.g. coordinate__struct.hpp) when included via
getFieldFromGoal(), breaking -Werror builds on newer toolchains. Keep
the warning visible but not fatal.

* ci: port rolling CI overhaul to the Lyrical workflow

Bring the Lyrical Test workflow up to the current rolling/main CI, keeping
the Lyrical image, ros_distro and setup paths:

- Split the colcon cache in two (frozen third-party sources vs
  build/install), keying the latter on a post-install dpkg fingerprint so a
  nightly-rebuilt image forces one clean rebuild instead of a poisoned
  incremental one.
- Add source patches applied between vcs import and build: nav2_map_server
  missing rclcpp includes, and the ortools_vendor gurobi/math_opt proto race.
- Shim the get_package_share_directory header removed by ament_index_cpp 1.14,
  which BT.CPP master and nav2 main still include.
- Install the extra build deps rosdep can't reliably resolve on resolute
  (backward-ros, ament-cmake-vendor-package, message-filters, ament-index-cpp,
  OpenBLAS), and add one visible build retry for transient parallel-build flakes.

* ci: shim launch_testing pytest hookspec for launch_testing_ros 0.29.9
SteveMacenski pushed a commit that referenced this pull request Jul 13, 2026
…objective (humble) (#122)

* B.6: add velocity and direction fields to PathComponents, populate from path states

- Add float64[] velocities and bool[] is_backward to PathComponents.msg
- toNavPathMsg fills per-pose velocity/direction vectors parallel to
  nav_path.poses, by reference; empty when path is not generated
- Update coverage_server and row_coverage_server to pass the vectors in place
- Add 4 unit tests: empty path, forward-only, velocity/dir values, size match

* B.7: add task_time to the action result

- ComputeCoveragePath.action: add float64 task_time to result
- coverage_server + row_coverage_server: populate task_time via
  Path::getTaskTime() with std::isfinite guard for zero-velocity states
- test_utils: add tests covering discretizeSwath point count,
  TURN passthrough regression, getTaskTime normal/zero/empty

Note: the discretizeSwath swath refactor from the rolling counterpart (#112)
already landed on humble via the straight-swath collapse bugfix, so only the
task_time additions are new here.

* B.4: add NSwathModified swath objective

Expose Fields2Cover's f2c::obj::NSwathModified as a selectable swath
objective via NUMBER_MODIFIED, handled in
SwathGenerator::createObjective/toString/toType, and documented in
SwathMode.msg. Add test_swath round-trips plus a generation smoke test.

* fix: keep null-dereference diagnostics non-fatal

GCC false-positives with -Wnull-dereference on inlined ROS 2 message
operator==/!= (e.g. coordinate__struct.hpp) when included via
getFieldFromGoal(), breaking -Werror builds on newer toolchains. Keep
the warning visible but not fatal.
SteveMacenski pushed a commit that referenced this pull request Jul 13, 2026
…objective (jazzy) (#121)

* B.6: add velocity and direction fields to PathComponents, populate from path states

- Add float64[] velocities and bool[] is_backward to PathComponents.msg
- toNavPathMsg fills per-pose velocity/direction vectors parallel to
  nav_path.poses, by reference; empty when path is not generated
- Update coverage_server and row_coverage_server to pass the vectors in place
- Add 4 unit tests: empty path, forward-only, velocity/dir values, size match

* B.7: add task_time to the action result

- ComputeCoveragePath.action: add float64 task_time to result
- coverage_server + row_coverage_server: populate task_time via
  Path::getTaskTime() with std::isfinite guard for zero-velocity states
- test_utils: add tests covering discretizeSwath point count,
  TURN passthrough regression, getTaskTime normal/zero/empty

Note: the discretizeSwath swath refactor from the rolling counterpart (#112)
already landed on jazzy via the straight-swath collapse bugfix, so only the
task_time additions are new here.

* B.4: add NSwathModified swath objective

Expose Fields2Cover's f2c::obj::NSwathModified as a selectable swath
objective via NUMBER_MODIFIED, handled in
SwathGenerator::createObjective/toString/toType, and documented in
SwathMode.msg. Add test_swath round-trips plus a generation smoke test.

* fix: keep null-dereference diagnostics non-fatal

GCC false-positives with -Wnull-dereference on inlined ROS 2 message
operator==/!= (e.g. coordinate__struct.hpp) when included via
getFieldFromGoal(), breaking -Werror builds on newer toolchains. Keep
the warning visible but not fatal.
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.

3 participants