← Back to Pull requests

nav2_collision_monitor: keep polygons when source_timeout is zero (backport #6881) #6895

Closed
unknown closed this pull request without merging on Dec 01, 2026 18:40 UTC
View on GitHub
unknown unknown commented on Dec 01, 2026 18:35 UTC
Author

---

Basic Info

| Info | Please fill out this column |
| ------ | ----------- |
| Ticket(s) this addresses | #6875 |
| Primary OS tested on | Ubuntu 26.04, ROS 2 Lyrical (source build of main) |
| Robotic platform tested on | None, unit tests |
| Does this PR contain AI generated software? | Yes, AI was used as an assistant |
| Was this PR description generated by AI software? | Yes, AI was used as an assistant to draft this description |

---

Description of contribution in a few bullet points

A source_timeout of 0 turns the source timeout off: Source::sourceValid() skips the check when it is zero. PolygonSource::getSourceData() didn't, and removed every polygon with curr_time - stamp > source_timeout. With a timeout of 0, that removes any polygon not stamped exactly at the current time, so a polygon source with source_timeout: 0 never gave any data.
The stale polygon removal is now skipped when source_timeout is 0, like in sourceValid(). Behavior with a non-zero timeout is unchanged.

Description of documentation updates required from your changes

None

Description of how this change was tested

New test testPolygonZeroTimeout in sources_test.cpp: a polygon source with source_timeout 0 gets a polygon stamped 100 ms before the current time, and must return its points.
Current main: fails, 0 points instead of 84.
This PR: passes.
All sources_test tests pass. ament_uncrustify and ament_cpplint are clean on the changed files.

---

Future work that may be required in bullet points

None

For Maintainers:


  • Check that any new parameters added are updated in docs.nav2.org

  • Check that any significant change is added to the migration guide

  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide

  • Check that any new functions have Doxygen added

  • Check that any new features have test coverage

  • Check that any new plugins is added to the plugins page

  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists

  • Should this be backported to current distributions? If so, tag with backport-*.

  • <hr>This is an automatic backport of pull request #6881 done by Mergify.

    Diff: 290 lines (+217 / -73) across 3 files Reviewer: SteveMacenski Review duration: 4m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.40) × (1 − Review Confidence (0.51)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 290 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 60% · Reviewer familiarity: 35%
    50%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.339
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6895"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 50.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.9% (MEDIUM) · Higher = larger blast radius
    39.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 50.7% · Lower = rushed or shallow review
    50.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.7% · Safe to merge
    19.7%