Skip to content

Fix warnings - #76

Merged
fmrico merged 4 commits into
rollingfrom
fix_warnings
Aug 2, 2026
Merged

Fix warnings#76
fmrico merged 4 commits into
rollingfrom
fix_warnings

Conversation

@fmrico

@fmrico fmrico commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

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() computed goal_pos_tol/goal_yaw_tol from a GoalManager-provided override (nav_state keys goal_tolerance.position / goal_tolerance.yaw) but never applied them — compute_goal_zone() and maybe_final_align_and_publish() only ever read the member defaults goal_pos_tol_ / goal_yaw_tol_deg_. The resolved override is now written back into those members before use, so a shared GoalManager tolerance actually takes effect instead of being silently discarded.

Warning cleanup

  • easynav_plugins/localizers/easynav_simple_localizer and easynav_costmap_localizer (AMCLLocalizer.cpp): initialized num_particles at declaration (= 100, matching the declare_parameter default) to silence -Wuninitialized/-Wmaybe-uninitialized from the get_parameter<int>() call.
  • easynav_plugins/localizers/easynav_fusion_localizer/tests/fusion_localizer_tests.cpp: removed dead x0/y0/yaw0 locals left over from an earlier version of the test (-Wunused-variable); the test only exercises x1/y1/yaw1.
  • easynav_plugins/maps_managers/easynav_costmap_maps_manager/.../filters/InflationFilter.cpp: the cost-update loop now bounds on the already-computed int size_x/size_y instead of calling getSizeInCellsX()/getSizeInCellsY() (unsigned int) again, fixing -Wsign-compare; also dropped an unused index local.

fmrico added 4 commits August 2, 2026 11:27
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>
Copilot AI review requested due to automatic review settings August 2, 2026 09:31

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 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.yaw values into SerestController members 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();
@fmrico
fmrico merged commit da78801 into rolling Aug 2, 2026
2 checks passed
@fmrico
fmrico deleted the fix_warnings branch August 2, 2026 10:10
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