Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LayeredCostmap isCurrent() does not consider whether the plugins are enabled or not #3353

Closed
milidam opened this issue Jan 7, 2023 · 1 comment · Fixed by #3356
Closed
Labels
bug Something isn't working

Comments

@milidam
Copy link
Contributor

milidam commented Jan 7, 2023

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22.04
  • ROS2 Version:
    • Humble (apt binaries)
  • Version or commit hash:
    • 1.1.3-1jammy.20221207.081347
  • DDS implementation:
    • CycloneDDS

Steps to reproduce issue

  • configure nav2 with the InflationLayer and ObstacleLayer plugins configured for the local costmap; the InflationLayer is enabled, but the ObstacleLayer is disabled
  • implement a "go to pose" behavior tree, executed so that a follow_path is executed after having cleared the local costmap (e.g. after the execution of a recovery)

Expected behavior

nav2's controller server properly follows the computed path.

Actual behavior

nav2's controller server gets stuck in a endless loop after Received a goal, begin computing control effort..

Additional information

The endless loop is here.

After clearing the local costmap, calling the reset() of the different layered_costmap plugins, the current_ attribute of the ObstacleLayer plugin is set to False, so that the isCurrent() of the plugins returns False, and the LayeredCostmap's isCurrent() returns False as well, even is the plugin is disabled.
ObstacleLayer's current_ is never set back to True, as normally done in the the updateCosts(), that is "bypassed" when the plugin is not enabled.

Feature request

Feature description

The isCurrent() of the LayeredCostmap class should take into account whether the plugins are enabled or not.

Implementation considerations

Add a isEnabled() method to the Layer class, and modify

current_ = current_ && (*plugin)->isCurrent();

by

current_ = current_ && ((*plugin)->isCurrent() || !(*plugin)->isEnabled();

in LayeredCostmap's isCurrent() implementation.

Or simply replace Layer's isCurrent() implementation by

    return current_ || !enabled_;
@SteveMacenski
Copy link
Member

SteveMacenski commented Jan 9, 2023

in LayeredCostmap's isCurrent() implementation

That sounds good to me and makes sense! Can you open the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants