← Back to Pull requests

Compute remaining_path_length once per path #6871

Open
unknown opened this pull request with 279 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 27, 2026 22:09 UTC
Author

<!-- Please fill out the following pull request template for non-trivial changes to help us process your PR faster and more efficiently.-->

---

Basic Info

| Info | Please fill out this column |
| ------ | ----------- |
| Ticket(s) this addresses | #6759 (part 1/2, pruning in #6872) |
| Primary OS tested on | Ubuntu 26.04 |
| Robotic platform tested on | Unit tests only |
| Does this PR contain AI generated software? | Yes, manually reviewed and tested |
| Was this PR description generated by AI software? | No |

---

Description of contribution in a few bullet points

  • Added a small TrackedPath struct in ControllerServer to group the path, current index, and remaining lengths together instead of keeping a separate start_index_.

  • Precomputes the remaining lengths once in set() (summed backwards from the goal) so we just do a lookup each cycle instead of running calculate_path_length() every time.

  • Kept this separate from PrunablePath in #6872 since the path handler doesn't need the lengths anyway.
  • Description of documentation updates required from your changes

  • None
  • Description of how this change was tested

  • Added TrackedPathRemainingLength test to verify the lookup matches calculate_path_length() and that setting a new path resets the index.

  • Ran colcon test --packages-select nav2_controller (all 143 tests and linters pass).
  • ---

    Future work that may be required in bullet points

  • Not ABI-compatible for backporting since current_path_ changes type and start_index_ is removed.
  • For Maintainers: <!-- DO NOT EDIT OR REMOVE -->


  • 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-*.
  • Diff: 279 lines (+209 / -70) across 3 files Reviewer: SteveMacenski Review duration: 9561m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 279 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.337
    Real PR Conversation Timeline
    1 comments
    "Review active on #6871"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.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.6% (MEDIUM) · Higher = larger blast radius
    39.6%
    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: 46.7% · Lower = rushed or shallow review
    46.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: 21.1% · Safe to merge
    21.1%