Skip to content

Add option to override lethal cost in keepout zone#5433

Merged
SteveMacenski merged 4 commits intoros-navigation:mainfrom
mini-1235:refactor/keepout_zone
Aug 12, 2025
Merged

Add option to override lethal cost in keepout zone#5433
SteveMacenski merged 4 commits intoros-navigation:mainfrom
mini-1235:refactor/keepout_zone

Conversation

@mini-1235
Copy link
Collaborator


Basic Info

Info Please fill out this column
Ticket(s) this addresses #5410 (comment)
Primary OS tested on (Ubuntu, MacOS, Windows)
Robotic platform tested on (Steve's Robot, gazebo simulation of Tally, hardware turtlebot)
Does this PR contain AI generated software? (No; Yes and it is marked inline in the code)
Was this PR description generated by AI software? Out of respect for maintainers, AI for human-to-human communications are banned

Description of contribution in a few bullet points

As requested in #5410 (comment)

My current implementation will always prioritize map update, if there is a map update, it will skip checking "is_pose_lethal", and check it in the next loop

Description of documentation updates required from your changes

Description of how this change was tested


Future work that may be required in bullet points

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-*.

@mini-1235 mini-1235 changed the title Refactor/keepout zone Add option to override lethal cost in keepout zone Aug 8, 2025
@SteveMacenski SteveMacenski requested a review from Copilot August 8, 2025 20:45
Copy link
Contributor

Copilot AI left a comment

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 functionality to override lethal costs in keepout zones, allowing robots to navigate out of forbidden areas when they find themselves inside them. The main change relocates lethal pose checking from the process() method to updateBounds() to improve timing and efficiency.

  • Moves lethal pose detection logic from process() to updateBounds() method
  • Changes lethal state tracking variables from unsigned int to double for world coordinates
  • Adds early return optimization when new keepout zone data is received

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
keepout_filter.cpp Relocates lethal pose checking logic and optimizes bound updates for lethal state tracking
keepout_filter.hpp Updates member variable types from unsigned int to double for lethal state coordinates

@SteveMacenski
Copy link
Member

@mini-1235 can you fix the bot's comment on signed constness? that's a real fix needed

@SteveMacenski
Copy link
Member

@mini-1235 can you pull in main? The CircleCI should pass then

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

mini-1235 and others added 4 commits August 12, 2025 16:48
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
@mini-1235 mini-1235 force-pushed the refactor/keepout_zone branch from 87767af to 74b0c5f Compare August 12, 2025 16:49
@codecov
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 43.90244% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...tmap_2d/plugins/costmap_filters/keepout_filter.cpp 43.90% 23 Missing ⚠️
Files with missing lines Coverage Δ
...tmap_2d/plugins/costmap_filters/keepout_filter.cpp 78.83% <43.90%> (-2.09%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SteveMacenski SteveMacenski merged commit 920dff0 into ros-navigation:main Aug 12, 2025
13 of 16 checks passed
@mini-1235 mini-1235 deleted the refactor/keepout_zone branch August 13, 2025 16:01
bkoensgen pushed a commit to bkoensgen/navigation2 that referenced this pull request Aug 29, 2025
* Add option to override lethal cost in keepout zone

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Linting

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Update nav2_costmap_2d/plugins/costmap_filters/keepout_filter.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Base class call

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

---------

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
silanus23 pushed a commit to silanus23/navigation2 that referenced this pull request Sep 18, 2025
* Add option to override lethal cost in keepout zone

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Linting

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Update nav2_costmap_2d/plugins/costmap_filters/keepout_filter.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Base class call

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

---------

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
BCKSELFDRIVEWORLD pushed a commit to BCKSELFDRIVEWORLD/navigation2 that referenced this pull request Sep 23, 2025
* Add option to override lethal cost in keepout zone

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Linting

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Update nav2_costmap_2d/plugins/costmap_filters/keepout_filter.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

* Base class call

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>

---------

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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