Repository navigation
Add task time, per-pose velocity/direction, and NSwathModified swath objective - #112
Conversation
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
|
The remaining 3 pr are on their way. I split them up this way to make them easier to review. |
There was a problem hiding this comment.
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
velocitiesandis_backwardvectors in the action result alongsidenav_path. - Refactor nav path densification to use
Path::discretizeSwath()and publishtask_time(guarded withstd::isfinite). - Add
NUMBER_MODIFIEDswath 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.
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.)
74bafee to
173d137
Compare
173d137 to
1307a3a
Compare
8f219b0 to
5ba29d1
Compare
|
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. |
…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
…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.
…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.

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
PathComponentsfloat64[] velocities(m/s) andbool[] is_backwardtoPathComponents.msg, filled in parallel withnav_path.poses.toNavPathMsgoverload populates the per-pose velocity/direction vectorsalongside the path; filled only when
generate_path=true, empty otherwise.coverage_serverandrow_coverage_server.2. Task time on the action result +
discretizeSwathrefactortoNavPathMsgnow usesPath::discretizeSwath(step_size)instead of ahand-written linear-interpolation loop — only
SWATHstates are split,TURNstates pass through unchanged.float64 task_timeto theComputeCoveragePathaction result,populated from
Path::getTaskTime()with anstd::isfiniteguard forzero-velocity states.
3.
NUMBER_MODIFIEDswath objectivef2c::obj::NSwathModifiedas a selectable swathobjective via
NUMBER_MODIFIED, handled inSwathGenerator::createObjective/toString/toType.4. Build fix: keep
-Wnull-dereferencenon-fataloperator==/!=(e.g.coordinate__struct.hpp) reached viagetFieldFromGoal(), breaking-Werrorbuilds on newer toolchains. The warning stays visible but is nolonger fatal.
Interface changes (all additive)
PathComponents.msg:+ float64[] velocities,+ bool[] is_backwardComputeCoveragePath.action(result):+ float64 task_timeSwathMode.msg:objectivenow also acceptsNUMBER_MODIFIED(doc comment updated)Testing
test_utils:discretizeSwathpoint count,TURNpassthrough regression,getTaskTimenormal/zero/empty; plus empty-path, forward-only,velocity/direction values, and vector-size-match cases.
test_swath:NUMBER_MODIFIEDround-trips throughtoType/toString/createObjective, plus a generation smoke test.