Skip to content

implemented 'update costmap on request' option#3297

Closed
JohnTGZ wants to merge 1 commit intoros-navigation:humblefrom
JohnTGZ:humble-update-costmap-on-request
Closed

implemented 'update costmap on request' option#3297
JohnTGZ wants to merge 1 commit intoros-navigation:humblefrom
JohnTGZ:humble-update-costmap-on-request

Conversation

@JohnTGZ
Copy link

@JohnTGZ JohnTGZ commented Nov 22, 2022


Basic Info

This PR targets #3121, adding the 'update costmap on request' option via the parameter update_on_request which can be specified on the costmap layer, as shown in nav2_bringup/params/nav2_params.yaml.

Info Please fill out this column
Ticket(s) this addresses (#3121)
Primary OS tested on (Ubuntu 22.04)
Robotic platform tested on (turtlebot gazebo simulation)

Description of contribution in a few bullet points

  • The implementation is such that if update_on_request is set to TRUE, the value of update_frequency is set to 0.0, therefore disabling the costmap update loop on the thread.
  • Then, planner server will update the costmap on each call to waitForCostmap() instead of the costmap being updated on a fixed loop.
  • Similarly, the costmap for the controller server will be updated the call to computeControl().
  • If update_on_request is FALSE, the behaviour is as default.

Description of documentation updates required from your changes

Will need to update the documentation for the update_on_request parameter and how setting it to TRUE will affect the value of update_frequency internally.


Future work that may be required in bullet points

If update_on_request is set to TRUE, it is possible to disable initializing the thread for the map update loop as it won't be utilised.

For Maintainers:

  • Check that any new parameters added are updated in navigation.ros.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

@mergify
Copy link
Contributor

mergify bot commented Nov 22, 2022

@JohnTGZ, all pull requests must be targeted towards the main development branch.
Once merged into main, it is possible to backport to @humble, but it must be in main
to have these changes reflected into new distributions.

@mergify
Copy link
Contributor

mergify bot commented Nov 22, 2022

@JohnTGZ, please properly fill in PR template in the future. @SteveMacenski, use this instead.

  • Check that any new parameters added are updated in navigation.ros.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

Copy link
Collaborator

@AlexeyMerzlyakov AlexeyMerzlyakov left a comment

Choose a reason for hiding this comment

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

@JohnTGZ, Thank you for taking care on this issue. Please refer to the review items. And then make a PR to a Nav2 main branch instead of humble (since we are working with main branch in Nav2 first).

stop_updates_ = false;
map_update_thread_shutdown_ = false;

updateMapOnRequest();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Despite it is never guaranteed (that is really deserves a separate bug ticket), plugin->activate() should be called once before main updating loop with plugin->updateBounds(), plugin->updateCosts() calls. Therefore, updateMapOnRequest() can not be called before the start(), to not cause to plugin->updateCosts() to be executed before plugin is being initialized.
Please note, that to ensure that start() to work well without parallel execution with main update loop, initialized_ variable should be set to true.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for pointing this out, I studied the code in more detail and this is an important detail to take note of

@JohnTGZ
Copy link
Author

JohnTGZ commented Nov 24, 2022

@AlexeyMerzlyakov Thanks for the feedback, I have studied the code in more detail to understand the implications behind the code Im changing. I have addressed these comments in another branch that merges with main. Should I close this branch and open another PR?

@AlexeyMerzlyakov
Copy link
Collaborator

AlexeyMerzlyakov commented Nov 25, 2022

Should I close this branch and open another PR?

Yep. Once you will resolve all review items from this PR, please open a new one for main branch.

@JohnTGZ JohnTGZ mentioned this pull request Nov 26, 2022
7 tasks
@JohnTGZ
Copy link
Author

JohnTGZ commented Nov 26, 2022

This PR has been shifted to #3300 as this PR is for the wrong branch.

@JohnTGZ JohnTGZ closed this Nov 26, 2022
@JohnTGZ JohnTGZ deleted the humble-update-costmap-on-request branch December 15, 2022 14:39
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.

2 participants