Unify ROS params: replace C++ PARAM_ macros with YAML-based config structs (vision filter + planning)#2499
Closed
Unify ROS params: replace C++ PARAM_ macros with YAML-based config structs (vision filter + planning)#2499
Conversation
Refactor the vision filter module to remove DEFINE_*/DECLARE_*/PARAM_ macro-based parameter system and replace it with a config struct approach. The VisionFilterConfig struct (already created in params.hpp) is now passed through the class hierarchy: - KalmanFilter2D/KalmanFilter3D: Accept config in parameterized constructors - KalmanBall/KalmanRobot: Accept and store config reference, use for filter health params, kick detector hist length, and max time outside vision - WorldBall/WorldRobot: Accept config parameter for merger power settings - BallBounce: Accept config parameter for bounce damping coefficients - FastKickDetector/SlowKickDetector: Store config pointer for kick detection params - Camera: Pass config through to KalmanBall/KalmanRobot/BallBounce - World: Initialize kick detectors with config, pass config to world objects All test files updated to create VisionFilterConfig instances and pass them to the updated constructors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…d of PARAM_ macros Co-authored-by: rishiso <52169818+rishiso@users.noreply.github.com>
…_planner - Replace all collect::PARAM_* with plan_request.planning_config->collect.* - Replace all settle::PARAM_* with plan_request.planning_config->settle.* - Update Replanner::partial_replan_lead_time() call to pass config - Add plan_request.planning_config to all Replanner::PlanParams constructions - Update check_solution_validity header signature to accept PlanningConfig& Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…anner - Replace all settle::PARAM_X accesses with plan_request.planning_config->settle.X in plan() and intercept() methods - Add const PlanningConfig& config parameter to check_solution_validity() and calc_delta_pos_for_dir(), using config.settle.X internally - Update call sites in plan() to pass *plan_request.planning_config - Add planning_config to Replanner::PlanParams aggregate initializations - Update header file with new #include and updated function signatures Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…lanning pipeline - PlannerNode: Add load_planning_config() to read params from ROS2 YAML - PlanRequest: Add planning_config pointer member - PlannerForRobot: Accept and pass PlanningConfig to PlanRequest - Update all Replanner::PlanParams initializations to include config - Pass PlanningConfig to CreatePath::intermediate calls in planners - Remove global param provider from main.cpp - Remove rj_param_utils includes from planner_node.hpp Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address code review feedback: use PlanningConfig{}.member instead of
magic numbers for fallback values in pivot planners and planner_for_robot.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Unify ROS parameters to use YAML files consistently
Unify ROS params: replace C++ PARAM_ macros with YAML-based config structs (vision filter + planning)
Feb 23, 2026
automated style fixes Co-authored-by: Copilot <Copilot@users.noreply.github.com>
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.
Description
Replaces the custom
DEFINE_*/DECLARE_*/PARAM_macro-based parameter system with plain config structs populated from YAML viathis->get_parameter(). This eliminates the indirection of global static variables and aligns with standard ROS2 parameter patterns.Vision Filter module (~33 files):
VisionFilterConfigstruct inparams.hppholds all vision filter parametersVisionFilternode loads params from YAML inload_config(), passes config down the class hierarchy:World → Camera → KalmanBall/KalmanRobot → KalmanFilter2D/3D, kick detectors, bounce, world ball/robotDEFINE_NS_FLOAT64,DECLARE_*,using PARAM_*from vision filter sourcesglobal_params.hppandLocalROS2ParamProviderdependencies from vision filterPlanning module (~28 files):
PlanningConfigstruct with all planner parameters (constraints, RRT, replanner, collect, settle, escape, pivot, intermediate)PlannerNodeloads config and threads it throughPlannerForRobot → PathPlannersubclasses viaPlanRequestMotionConstraints/RotationConstraintsto use hardcoded defaults instead ofPARAM_referencesreplanner,create_path,rrt_utilExample — before:
Example — after:
Not yet addressed (follow-up work):
motion_control.cpp)world_state.cpp,packet_convert.cpp)rj_param_utilsinfrastructure (param.hppmacros,global_params.cpp/hpp,planning_params.cpp/hpp,vision_params.cpp/hpp)Associated Issue
Unify ROS params across all files for consistent YAML-based access.
Design Documents
Pattern follows ROS2 Global Parameters — nodes load params from YAML, pass values to non-node classes via config structs.
Steps to test
Test Case 1
makesoccer.launch.pywith sim_params.yaml — verify vision filter and planner initialize with correct parameter valuesExpected result: All parameters load from YAML identically to previous macro-based behavior. No functional change.
(Optional) Sub-issues (for drafts)
rj_param_utilsmacro infrastructure💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.