Fix warnings - #76
Merged
Merged
Conversation
Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on eliminating several compiler warnings across the EasyNav plugin stack, and fixes a functional bug in SerestController where GoalManager-provided goal tolerances were being computed but not actually applied to the logic that consumes the member tolerances.
Changes:
- Fix: propagate resolved
goal_tolerance.position/goal_tolerance.yawvalues intoSerestControllermembers so downstream goal-zone / final-align logic uses the override. - Warning cleanup: remove/avoid uninitialized and unused-variable warnings in costmap inflation, AMCL localizers, and fusion-localizer tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| controllers/easynav_serest_controller/src/easynav_serest_controller/SerestController.cpp | Applies resolved goal tolerance overrides to the member variables actually used by goal checks/alignment. |
| maps_managers/easynav_costmap_maps_manager/src/easynav_costmap_maps_manager/filters/InflationFilter.cpp | Uses precomputed size_x/size_y for loops to avoid sign-compare warnings and removes an unused local. |
| localizers/easynav_simple_localizer/src/easynav_simple_localizer/AMCLLocalizer.cpp | Initializes num_particles to avoid uninitialized warnings during parameter retrieval. |
| localizers/easynav_costmap_localizer/src/easynav_costmap_localizer/AMCLLocalizer.cpp | Same num_particles initialization change as the simple localizer variant. |
| localizers/easynav_fusion_localizer/tests/fusion_localizer_tests.cpp | Removes unused locals in the test to silence -Wunused-variable. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| int num_particles; | ||
| int num_particles = 100; | ||
| double x_init, y_init, yaw_init, std_dev_xy, std_dev_yaw; | ||
|
|
| @@ -189,7 +189,7 @@ AMCLLocalizer::on_initialize() | |||
| auto node = get_node(); | |||
| const auto & plugin_name = get_plugin_name(); | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
This PR removes the warnings in the compilation. While this process, I discovered a real bug.
I hope it helps!!!
Bug fixes
easynav_plugins/controllers/easynav_serest_controller/src/easynav_serest_controller/SerestController.cpp:update_rt()computedgoal_pos_tol/goal_yaw_tolfrom aGoalManager-provided override (nav_statekeysgoal_tolerance.position/goal_tolerance.yaw) but never applied them —compute_goal_zone()andmaybe_final_align_and_publish()only ever read the member defaultsgoal_pos_tol_/goal_yaw_tol_deg_. The resolved override is now written back into those members before use, so a sharedGoalManagertolerance actually takes effect instead of being silently discarded.Warning cleanup
easynav_plugins/localizers/easynav_simple_localizerandeasynav_costmap_localizer(AMCLLocalizer.cpp): initializednum_particlesat declaration (= 100, matching thedeclare_parameterdefault) to silence-Wuninitialized/-Wmaybe-uninitializedfrom theget_parameter<int>()call.easynav_plugins/localizers/easynav_fusion_localizer/tests/fusion_localizer_tests.cpp: removed deadx0/y0/yaw0locals left over from an earlier version of the test (-Wunused-variable); the test only exercisesx1/y1/yaw1.easynav_plugins/maps_managers/easynav_costmap_maps_manager/.../filters/InflationFilter.cpp: the cost-update loop now bounds on the already-computedint size_x/size_yinstead of callinggetSizeInCellsX()/getSizeInCellsY()(unsigned int) again, fixing-Wsign-compare; also dropped an unusedindexlocal.