Skip to content

Tracking error layer#5605

Open
silanus23 wants to merge 77 commits into
ros-navigation:mainfrom
silanus23:tracking_error_layer
Open

Tracking error layer#5605
silanus23 wants to merge 77 commits into
ros-navigation:mainfrom
silanus23:tracking_error_layer

Conversation

@silanus23

@silanus23 silanus23 commented Oct 13, 2025

Copy link
Copy Markdown
Contributor

Basic Info

Info Please fill out this column
Ticket(s) this addresses #5037
Primary OS tested on Ubuntu
Robotic platform tested on nav2 bringup
Does this PR contain AI generated software? unit tests
Was this PR description generated by AI software? Nope

Description of contribution in a few bullet points

I have added a layer that can draw a corridor around path with obstacles. In addition I added a geometry util that can draw smoother lines.

Description of documentation updates required from your changes

A costmap layer and it's params

Description of how this change was tested

Wrote a unit test and I have seen visually it is working


Future work that may be required in bullet points

Tests definitely need a see throgh.

Note:

I had to copy paste and carry changes to a new branch. Like I did on the prev 2 PR. This going to make me move with less burden. Commits look lesser and rushy but they ain't.

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

@SteveMacenski SteveMacenski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd recommend spending some time to think about how we can most optimally compute this since this is going to be a little heavy so its worth some performance considerations.

Off the cuff:

  • We don't really need to store an internal representation of the layer at all, so this could derive from the Layer rather than CostmapLayer since we shouldn't really need the internal costmap structure.
  • We default assume all points are lethal unless proven otherwise in the for each loop in the update window.
  • Given the path, we shift the path left/right by the left/right tolerances by the base frame. If we enclose the start of the path and the end of the path segment, we should end up with a polygon.
  • Using some polygon math, we can ID if a point is inside of that polygon or not. If inside, we set ignore. If outside, we set as lethal. We'd need to make sure this works with concave polygons since there's no promise that this is convex.

Also maybe ways that can improve the method you have now and/or convolved the path by some radius left/right?

We probably want this to mark more than just 1 cell around the boundary as lethal so that small quantization errors don't allow the system to break out. At least 3 cells thick, but also I was thinking perhaps it would be sensible to just default mark everything as occupied unless within the bounds of tracking. But maybe a "thick" line is fine actually if that gives us some computational gains :-)

this, std::placeholders::_1));

path_sub_ = node->create_subscription<nav_msgs::msg::Path>(
"/plan",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove forward slash in both subscriptions

tracking_feedback_sub_ = node->create_subscription<nav2_msgs::msg::TrackingFeedback>(
"/tracking_feedback",
std::bind(&TrackingErrorLayer::trackingCallback, this, std::placeholders::_1),
rclcpp::QoS(10).reliable()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For all QoS: Use the established Nav2 policies in nav2_ros_common

std::bind(&TrackingErrorLayer::trackingCallback, this, std::placeholders::_1),
rclcpp::QoS(10).reliable()
);
tf_buffer_ = std::make_shared<tf2_ros::Buffer>(node->get_clock());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should have this already from base classes to this class. You shouldn't need to manually create another (which is very heavy)

Comment on lines +74 to +75
std::mutex path_mutex_;
std::mutex tracking_error_mutex_;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think you can get away with a single data mutex

return result;
}

TrackingErrorLayer::~TrackingErrorLayer()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Move destructor right after the constructor

Comment on lines +354 to +359
void TrackingErrorLayer::reset() {}
void TrackingErrorLayer::activate() {enabled_ = true;}
void TrackingErrorLayer::deactivate() {enabled_ = false;}

void TrackingErrorLayer::onFootprintChanged() {}
void TrackingErrorLayer::cleanup() {}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Dont override if not implementing

Comment on lines +355 to +356
void TrackingErrorLayer::activate() {enabled_ = true;}
void TrackingErrorLayer::deactivate() {enabled_ = false;}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These two should create / destroy the subscriptions

dyn_params_handler_.reset();
}

void TrackingErrorLayer::reset() {}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should reset data and other states. Please check out other layers for example

@silanus23

silanus23 commented Dec 5, 2025

Copy link
Copy Markdown
Contributor Author

@SteveMacenski I deleted bresenham line drawer to make it faster. I think I fixed your review points. I think adding constraints as seperate obstacles is a better choice, cause if a user tries to use this on a bigger local costmap it can become a huge computation. Also with rasterization, sharp turns could create problems. Current version creates big distinct blocks (like watchtowers) one after another. This can be parameterized and improved later. Not looking good but would do the job I think.

@SteveMacenski

Copy link
Copy Markdown
Member

Related to your other PR, I'm passing off the first review stage to @mini-1235 and I'll come in afterwards

@SteveMacenski

Copy link
Copy Markdown
Member

@SteveMacenski I deleted bresenham line drawer to make it faster. I think I fixed your review points. I think adding constraints as seperate obstacles is a better choice, cause if a user tries to use this on a bigger local costmap it can become a huge computation. Also with rasterization, sharp turns could create problems. Current version creates big distinct blocks (like watchtowers) one after another. This can be parameterized and improved later. Not looking good but would do the job I think.

Can you show an image of this behavior for example?

@SteveMacenski SteveMacenski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OK I can't help myself, here's a few notes. I didn't look at the main get path segments / wall functions, but I looked at the layer boilerplate

Comment thread nav2_costmap_2d/costmap_plugins.xml Outdated
<class type="nav2_costmap_2d::VoxelLayer" base_class_type="nav2_costmap_2d::Layer">
<description>Similar to obstacle costmap, but uses 3D voxel grid to store data.</description>
</class>
<class type="nav2_costmap_2d::TrackingErrorLayer" base_class_type="nav2_costmap_2d::Layer">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe rename to BoundedTrackingErrorLayer since its adding bounds

namespace nav2_costmap_2d
{

TrackingErrorLayer::TrackingErrorLayer() {}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can just set this to TrackingErrorLayer() = default; in the header file instead

Comment thread nav2_costmap_2d/plugins/bounded_tracking_error_layer.cpp Outdated
Comment on lines +75 to +81
void TrackingErrorLayer::trackingCallback(
const nav2_msgs::msg::TrackingFeedback::SharedPtr msg)
{
std::lock_guard<std::mutex> lock(data_mutex_);
last_tracking_feedback_ = *msg;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be good to check on timestamps to make sure these are sufficiently current

Comment thread nav2_costmap_2d/plugins/bounded_tracking_error_layer.cpp Outdated

// Create subscriptions when layer is activated
path_sub_ = node->create_subscription<nav_msgs::msg::Path>(
"/plan",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove forward slashes here and in the tracking feedback to let this work with namespaces

@silanus23 silanus23 Dec 5, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have tried without "/" but didn't work. It wasn't subscribing to those topics. Am I doing anything else wrong about this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah. I know why. The costmap namespaces things on its topic. I think maybe instead you should make these parameters + add those parameters to the yaml file where there you set it.

Just make sure to use this function to parse the parameter https://github.com/ros-navigation/navigation2/blob/main/nav2_costmap_2d/include/nav2_costmap_2d/layer.hpp#L180. Grep the obstacle / static layer for use examples

Comment on lines +340 to +341
last_path_.poses.clear();
last_path_.header = std_msgs::msg::Header();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
last_path_.poses.clear();
last_path_.header = std_msgs::msg::Header();
last_path_ = nav_msgs::msg::Path();

Comment thread nav2_costmap_2d/plugins/bounded_tracking_error_layer.cpp Outdated
@silanus23 silanus23 marked this pull request as ready for review December 8, 2025 15:53
Copilot AI review requested due to automatic review settings December 8, 2025 15:53
@silanus23

silanus23 commented Dec 8, 2025

Copy link
Copy Markdown
Contributor Author
image

@SteveMacenski currently looks like this. with bresenham function it was a smooth straight line.
About naming I though trackingbounds layer was better and shorter but if you want I can make it boundedtrackingerror. I couldn't find tf function you mentioned about path transforming. Can you help me about that? Or maybe I misunderstood you.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a new TrackingBoundsLayer costmap plugin that creates a corridor around the robot's path with obstacles, helping to constrain navigation within path boundaries. The implementation adds a new costmap layer, configuration parameters, and comprehensive unit tests.

Key Changes

  • Added TrackingBoundsLayer plugin that subscribes to path and tracking feedback topics to dynamically create corridor boundaries
  • Implemented wall point generation algorithm that calculates perpendicular boundaries around path segments
  • Added unit tests covering initialization, path segment extraction, wall point generation, and edge cases

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
nav2_util/include/nav2_util/geometry_utils.hpp Adds utility include for geometry operations
nav2_costmap_2d/include/nav2_costmap_2d/tracking_bounds_layer.hpp Defines the TrackingBoundsLayer class interface with lifecycle methods and member variables
nav2_costmap_2d/plugins/tracking_bounds_layer.cpp Implements the tracking bounds layer logic including callbacks, path segmentation, and costmap updates
nav2_costmap_2d/test/unit/tracking_bounds_layer_test.cpp Provides comprehensive unit tests for the new layer functionality
nav2_costmap_2d/test/unit/CMakeLists.txt Adds test target for tracking_bounds_layer_test
nav2_costmap_2d/CMakeLists.txt Integrates tracking_bounds_layer.cpp into the layers library
nav2_costmap_2d/costmap_plugins.xml Registers the TrackingBoundsLayer as a plugin
nav2_bringup/params/nav2_params.yaml Configures the tracking_bounds_layer in the local costmap with default parameters

Comment thread nav2_costmap_2d/test/unit/bounded_tracking_error_layer_test.cpp Outdated
Comment thread nav2_costmap_2d/plugins/bounded_tracking_error_layer.cpp Outdated
Comment thread nav2_costmap_2d/plugins/bounded_tracking_error_layer.cpp Outdated
Comment thread nav2_costmap_2d/plugins/bounded_tracking_error_layer.cpp Outdated
Comment thread nav2_costmap_2d/plugins/bounded_tracking_error_layer.cpp Outdated
Comment thread nav2_costmap_2d/plugins/bounded_tracking_error_layer.cpp Outdated
Comment thread nav2_costmap_2d/include/nav2_costmap_2d/tracking_bounds_layer.hpp Outdated
Comment on lines +73 to +86
void TrackingBoundsLayer::pathCallback(const nav_msgs::msg::Path::SharedPtr msg)
{
std::lock_guard<std::mutex> lock(data_mutex_);
auto now = node_.lock()->now();
auto msg_time = rclcpp::Time(msg->header.stamp);
auto age = (now - msg_time).seconds();

if (age > 1.0) {
RCLCPP_WARN_THROTTLE(
node_.lock()->get_logger(),
*node_.lock()->get_clock(),
5000,
"Path is %.2f seconds old", age);
return;

Copilot AI Dec 8, 2025

Copy link

Choose a reason for hiding this comment

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

Multiple calls to node_.lock() without checking if the lock is successful. If the node has been destroyed, this could lead to a crash. Store the locked node in a local variable and check it once at the beginning of the function.

Example fix:

void TrackingBoundsLayer::pathCallback(const nav_msgs::msg::Path::SharedPtr msg)
{
  std::lock_guard<std::mutex> lock(data_mutex_);
  auto node = node_.lock();
  if (!node) {
    return;
  }
  auto now = node->now();
  // ... rest of the function using 'node' instead of node_.lock()

Copilot uses AI. Check for mistakes.
Comment thread nav2_costmap_2d/plugins/bounded_tracking_error_layer.cpp Outdated
Comment thread nav2_bringup/params/nav2_params.yaml Outdated
enabled: True
look_ahead: 5.0
step: 5
corridor_width: 2.0

Copilot AI Dec 8, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The tracking_bounds_layer configuration is missing the tracking_feedback_topic and path_topic parameters. While these have defaults in the code ("tracking_feedback" and "plan"), they should be explicitly documented in the configuration file for clarity, especially since this is a new plugin. Add:

tracking_bounds_layer:
  plugin: "nav2_costmap_2d::TrackingBoundsLayer"
  enabled: True
  look_ahead: 5.0
  step: 5
  corridor_width: 2.0
  tracking_feedback_topic: "tracking_feedback"
  path_topic: "plan"
Suggested change
corridor_width: 2.0
corridor_width: 2.0
tracking_feedback_topic: "tracking_feedback"
path_topic: "plan"

Copilot uses AI. Check for mistakes.
@SteveMacenski

Copy link
Copy Markdown
Member

@SteveMacenski currently looks like this. with bresenham function it was a smooth straight line.

This doesn't look very dense / complete (?). I see large gaps there.

About naming I though trackingbounds layer was better and shorter but if you want I can make it boundedtrackingerror. I couldn't find tf function you mentioned about path transforming. Can you help me about that? Or maybe I misunderstood you.

Please update the name - I think the "Error" bit is an important clarification. You are correct on the TF thing - Maurice convinced me that my internal AI was hallucinating about it. That seems like something we should add to Nav2 utils.

@SteveMacenski

SteveMacenski commented Dec 9, 2025

Copy link
Copy Markdown
Member

Can you provide some updated picture + compute times? I think the density is worth it, but maybe there are other methods we could consider and/or optimize if the performance isn't high enough

@silanus23

silanus23 commented Dec 9, 2025

Copy link
Copy Markdown
Contributor Author
Screenshot from 2025-12-09 18-40-46 Screenshot from 2025-12-09 18-40-40

I can make lines thicker. About computation I can try to bring numbers but I gotta say my pc is extremely bad (gpu burnt and 5 y.o.) and didn't felt any diffirence.

@SteveMacenski

SteveMacenski commented Dec 9, 2025

Copy link
Copy Markdown
Member

Can we make the line at least 2 pixels thick? 1 pixel, as before, could cause issues if the search window is larger than 1 cell length (like smac, which is $\sqrt{2}$, so in some cases it could skip over a good chunk of a cell at an angle that would bypass that check when the 2 lethal cells added are not edge-connected but corner-connected)

@silanus23

Copy link
Copy Markdown
Contributor Author

Should I parameterize it?

@SteveMacenski

Copy link
Copy Markdown
Member

I think that might be good. Default at 2 though I think would be good.

@mergify

mergify Bot commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

This pull request is in conflict. Could you fix it @silanus23?

@silanus23

silanus23 commented Dec 12, 2025

Copy link
Copy Markdown
Contributor Author

@SteveMacenski I will solve conflict and open a doc. About computational weight I can bring actually numbers with perf but this can take too long in addition theoretically corridor logic (especially better in bigger local costmap bounds) and bresenham line function (specifically made for this usage) is the most performative choice I think. I still can bring out the numbers if you want.

@SteveMacenski

Copy link
Copy Markdown
Member

@mini-1235 is taking over the first set of reviews on this feature - please direct to him for now :-)

@silanus23 silanus23 force-pushed the tracking_error_layer branch from 52b0dba to 308b361 Compare December 13, 2025 21:06
@codecov

codecov Bot commented Dec 15, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.62550% with 32 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ostmap_2d/plugins/bounded_tracking_error_layer.cpp 93.52% 32 Missing ⚠️
Files with missing lines Coverage Δ
...e/nav2_costmap_2d/bounded_tracking_error_layer.hpp 100.00% <100.00%> (ø)
...ostmap_2d/plugins/bounded_tracking_error_layer.cpp 93.52% <93.52%> (ø)

... and 11 files with indirect coverage changes

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

@mini-1235

Copy link
Copy Markdown
Collaborator

Screenshot from 2025-12-09 18-40-46 Screenshot from 2025-12-09 18-40-40
I can make lines thicker. About computation I can try to bring numbers but I gotta say my pc is extremely bad (gpu burnt and 5 y.o.) and didn't felt any diffirence.

Hi @silanus23, regarding the visualization, I don't think it is very clear at the moment. It would also be helpful to get some metrics to see whether we are on the right track, especially to ensure this works well on weaker CPUs

@silanus23

silanus23 commented Dec 22, 2025

Copy link
Copy Markdown
Contributor Author

Hi @mini-1235 I am aware that a PC's cpu is enough to compensate diffirences so you are right about asking for metrics. I just wanted to point out no overflows and in complexity wise current one was the best I could find. I will try to bring out metrics . In addition Currently lines are parameterized and double thickness of those and the thickness is parameterized.

As a last note: I might be away for a short period soon, but I will jump back into this and all other pending PRs as soon as I return. :-)

@silanus23 silanus23 force-pushed the tracking_error_layer branch from fe89b10 to 3fd5bca Compare January 30, 2026 15:02
@silanus23

silanus23 commented Jan 30, 2026

Copy link
Copy Markdown
Contributor Author
Screenshot from 2026-01-30 08-42-48
  • After initial tests I've seen some optimizations needed and started to use existing functions instead bresenham.
  • I will put new performance reports of current as soon as I can.
  • After some tests on tb4 I have seen that creating lethal obstacles can stop path planner from finding shortest path and make obstacle avoidance problematic. I observed corridor was making robot stuck (couldn't see these problems on tb3 due to smaller env.). Current version is healthier and the only way to harmonize with path planner imo.

@silanus23 silanus23 force-pushed the tracking_error_layer branch from 3fd5bca to 74d4d46 Compare February 27, 2026 10:28
silanus23 added 18 commits May 26, 2026 05:39
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
… refactor applyFillOutside func

Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
@silanus23 silanus23 force-pushed the tracking_error_layer branch from 3d81919 to 8b951d9 Compare May 26, 2026 02:40
@silanus23

silanus23 commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

@mini-1235
Other global costmap layers update at the same frequency too.

relevant code snippet

// costmap_2d_ros.cpp :: Costmap2DROS::mapUpdateLoop()

nav2::Rate r(this, frequency);

while (rclcpp::ok() && !map_update_thread_shutdown_) {

  if (!stopped_) {
    std::scoped_lock<std::mutex> lock(_dynamic_parameter_mutex);

    updateMap();
...
  }

  // Make sure to sleep for the remainder of our cycle time
  r.sleep();
}

A layer has no way to insert itself into this cycle independently. To make the layer more up to date I could come up with these 3 choices:

  1. Making it a local costmap layer since it gets more frequent updates
  2. Giving global costmap layers the ability to update at their own frequency, but this requires changes at the heart of the costmap package, I don't think you would approve this.
  3. Changing the base class: CostmapLayer can update independently unlike the plain Layer base class, but Layer base class is previously suggested. CostmapLayer is heavier and needs lots of change too.

About path age: I made it distance based. It doesn't solve a major problem but there are 2 reasons:

  1. Weights shouldn't sit there after motion completes not only unnecessary but creates a natural barrier when a new goal is given in the weighted area. It clears itself eventually but that's not looking ideal.
  2. Why use CPU when the mission is complete?

If there is any other way I'm not seeing about age check and frequency, I'm open to suggestions but I really can't find much more.

@mini-1235

Copy link
Copy Markdown
Collaborator

Other global costmap layers update at the same frequency too.

That's not what I meant, do you see a similar "delay" in other layers?

From the previous videos, we can clearly see the plan is being replanned multiple times with very large deviations due to this delay. In reality, we can have many combinations of costmap update rate + plan rate, and we are already seeing issues with the default values. I would still argue this is something we need to solve.

As you mentioned this issue might be specific to low costmap update rates, here is what I would suggest: try lowering the update rate on the local costmap first. If you see the same result, then maybe your assumption holds, and we would need to think about how to handle it from there. Overall, looking at the video, I don't think we have really achieved the desired result yet, but I don't have a complete solution off the top of my head without taking this over and working on it myself

On the "path age" thing, it doesn't immediately strike me as necessary, but it doesn't hurt either, so I think you can keep it. I would however rename it to path_length_tolerance to be consistent with other components

ps: I also went back and rewatched all your videos, looks like the last two only show the result after a single plan, which is different from the earlier videos you showed me that made me think there was an issue

@silanus23

silanus23 commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

https://drive.google.com/file/d/1B75-0bWF8P82O9EdJskl8rGnK9INIh5R/view?usp=drive_link

I sent the video to assure you about current situation. It can handle multiple mid plan changes still.

From the previous videos, we can clearly see the plan is being replanned multiple times with very large deviations due to this delay

I think now I can understand the problem. multiple replans etc. is happenning in goal changes. The replanning deviations happen specifically at goal change, not during normal navigation. We allready have a goal change tracker. We should 0 out weights for 1 plan cycle. Wait till new plan comes after cost updated so with this way we are giving planner a breathing room to create plans without weights of this layer. I will try to send video of this today.

I sent this message to confirm solution and assurance about current situation.

Edit: For plan once scenario I will put a parameterized fallback timer.

silanus23 added 5 commits May 27, 2026 06:08
…d circle anchor fixes, race fixes

Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
Signed-off-by: silanus23 <berkantali23@outlook.com>
@silanus23

silanus23 commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

@mini-1235

https://drive.google.com/file/d/1d-epKvXq2fZ2964wtnlFlQNQF2CN4_ya/view?usp=drive_link

I have implemented above refactor that I have sent. In addition coming after some time with fresh eyes I have caught some necessary changes in styling. This is a frequency mismatch issue rather than direct delay inside layer. To make this work regardless of frequency combination I suppress weights whenever there is a goal change. It goes like:

  • Goal change hits the callback , flag it
  • suppres weights and update costs call comes
  • new path comes
  • return normal mode.

In addition to this for plan once scenarios I have put a timer fallback. Still the first plan is going to be with old costmap version but that's inevitable since planners triggered by new goals but costmap updates with a constant frequency.

Is current version acceptable?
I forgot to use name path_length_tolerance but I will update it on the next cycle.

Edit:
image

just in case curving back itself a necessary edge case for you.

@silanus23

Copy link
Copy Markdown
Contributor Author

Dear nav2 crew @mini-1235 @SteveMacenski :
I will be going offline on this saturday to do my mandatory military service. Sending this message to inform you that I won't be able to respond to reviews and requests. I will be coming back online after first of july.

@silanus23

Copy link
Copy Markdown
Contributor Author

@mini-1235 Just pinging to let you know I'm back online. I'm ready to address reviews whenever you have a chance to take a look.

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.

4 participants