Skip to content

Conversation

@bpwilcox
Copy link

The nav2_system_tests were failing in large part due to the parameter callbacks being called erroneously during the on_cleanup of the Costmap2DROS object. It is a pattern that the reset of costmap plugins will reset/deactivate and also re-initialize. In this PR I'm maintaining that behavior since I believe that is intended for use when clearing the costmap during run-time, but here I'm removing the resetLayers inside of on_cleanup, especially since deleting the layered_costmap will destroy the plugins anyway. Also, since the parameters are being declare_if_not_declared, there's no real need to undeclare the parameters when resetting.

Future work that may be required in bullet points

  • cleanup plugin activate/deactivate/reset logic in alignment with lifecycle transitions

@SteveMacenski
Copy link
Member

SteveMacenski commented Dec 11, 2019

Looks like a unit test needs updating if removing undeclare.

Otherwise seems good

@bpwilcox
Copy link
Author

Looks like a unit test needs updating if removing undeclare.

The plugins' declareParameter function uses declare_if_not_declared underlying, so it should not have an issue.

@SteveMacenski
Copy link
Member

Look at the CI test results. You need to update a unit test that is failing from your change.

@ghost
Copy link

ghost commented Dec 11, 2019

Look at the CI test results

CircleCI doesn't work on the release branches yet.

@codecov
Copy link

codecov bot commented Dec 11, 2019

Codecov Report

❗ No coverage uploaded for pull request base (eloquent-devel@d03cfcc). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@               Coverage Diff                @@
##             eloquent-devel   #1431   +/-   ##
================================================
  Coverage                  ?   40.2%           
================================================
  Files                     ?     231           
  Lines                     ?   11848           
  Branches                  ?    5116           
================================================
  Hits                      ?    4764           
  Misses                    ?    3717           
  Partials                  ?    3367
Flag Coverage Δ
#project 40.2% <100%> (?)
Impacted Files Coverage Δ
...map_2d/include/nav2_costmap_2d/inflation_layer.hpp 92.85% <ø> (ø)
nav2_costmap_2d/plugins/static_layer.cpp 34.88% <ø> (ø)
nav2_costmap_2d/plugins/obstacle_layer.cpp 43.43% <ø> (ø)
nav2_costmap_2d/plugins/voxel_layer.cpp 19.92% <ø> (ø)
nav2_costmap_2d/src/costmap_2d_ros.cpp 23.82% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d03cfcc...08f508a. Read the comment docs.

@SteveMacenski
Copy link
Member

https://github.com/ros-planning/navigation2/pull/1431/commits/08f508a0ea324e1dd07b987a85a41686a1e8c9c2 looks like you found it

@bpwilcox
Copy link
Author

@SteveMacenski Just updated the test. Like I mentioned in description, I don't think we want/need to undeclare parameters during a layer reset. I could be onboard for undeclaring parameters in the node in the destructor for each plugin though, if it is worth cleaning up parameters in the case that different plugins are swapped in a re-configure of the Costmap2DROS object.

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.

Yeah, no issues, I just wanted CI to pass with the test update 👍

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

I don't understand how CI is passing, but I'll take it.

@bpwilcox bpwilcox merged commit d944a84 into ros-navigation:eloquent-devel Dec 12, 2019
ghost pushed a commit to mlherd/navigation2 that referenced this pull request Dec 12, 2019
ghost pushed a commit that referenced this pull request Dec 12, 2019
* -fix for #1363. -created clearMap function for each layer. -use clearMap instead of reset to clear the costmaps

* -function name change -infilation layer clearMap change -make resetMap a pure virtual function

* Changing clearMaps back to reset

* Fix uncrustify error

* Fixing lifecycle transitions and tests now that reset doesn't act as a cleanup function

* Updating this based on the approach taken in PR #1431

* Moving voxel_grid reset to the resetMaps function.

* Missed adding resetMaps back to header.

* Adding some comments to help navigate the inheritance hierarchy
ghost pushed a commit that referenced this pull request Dec 13, 2019
* -fix for #1363. -created clearMap function for each layer. -use clearMap instead of reset to clear the costmaps

* -function name change -infilation layer clearMap change -make resetMap a pure virtual function

* Changing clearMaps back to reset

* Fix uncrustify error

* Fixing lifecycle transitions and tests now that reset doesn't act as a cleanup function

* Updating this based on the approach taken in PR #1431

* Moving voxel_grid reset to the resetMaps function.

* Missed adding resetMaps back to header.

* Adding some comments to help navigate the inheritance hierarchy
Forsyth-Creations pushed a commit to Forsyth-Creations/navigation2 that referenced this pull request Feb 19, 2025
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