You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Restore saved Xacro arguments when loading a MoveIt config - #4008
Fixes#3605. Restore the Xacro argument vector when loading a URDF from a package, and clear stale saved arguments when the next configuration has none.
Checklist
Code auto-formatted with clang-format
Tutorial/documentation changes (not needed)
API migration (no API change)
Added regression test for loading saved arguments and reloading without them
Screenshot (not a GUI change)
Review another open PR
Validation: Xacro fixture expands to the expected link with and without arguments; changed-file pre-commit hooks pass. The ROS 2 C++ build and GTest could not be executed locally because ROS 2 and colcon are unavailable. CI validation is required.
Summary by CodeRabbit
Bug Fixes
Previously saved Xacro arguments are now applied when loading a URDF configuration, so custom settings such as link names are retained. When no saved arguments are available, the Xacro file’s defaults are used.
No actionable comments were generated in the recent review.
Walkthrough
URDF configuration loading now uses saved xacro arguments when reloading a package. A new Google Test checks that a supplied argument sets the link name and that the xacro default is used when arguments are absent.
Changes: URDF xacro argument reload
Layer / File(s)
Summary
Load saved arguments and verify results moveit_setup_assistant/moveit_setup_framework/src/urdf_config.cpp, moveit_setup_assistant/moveit_setup_framework/CMakeLists.txt, moveit_setup_assistant/moveit_setup_framework/package.xml, moveit_setup_assistant/moveit_setup_framework/test/test_urdf_config.cpp
loadPrevious passes saved xacro arguments to loadFromPackage, which initializes the argument vector before loading. The new test checks the custom link name and the xacro default when arguments are absent. CMake registers the test, and the manifest adds its test dependencies.
Reloading a MoveIt configuration now restores its saved xacro arguments and clears stale ones when none are saved. A regression test covers both cases. No merge-blocking risk was found; CI should confirm the build and test.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "Restore saved Xacro arguments when loading a MoveIt config" matches the main change. The urdf_config.cpp change passes saved xacro_args through loadPrevious and loadFromPackage so they appl…
Linked Issues check
[#3605] The reported defect is that saved Xacro arguments (bimanual:=true) were recognized but not applied when editing an existing package. At the merge base, URDFConfig::loadFromPackage set `xac…
Out of Scope Changes check
All changed files relate to the objective. src/urdf_config.cpp contains the fix. test/test_urdf_config.cpp is the regression test. CMakeLists.txt registers that test when BUILD_TESTING is enab…
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title "Restore saved Xacro arguments when loading a MoveIt config" matches the main change. The urdf_config.cpp change passes saved xacro_args through loadPrevious and loadFromPackage so they apply on load. The new test checks that saved link_name:=custom_link is used and that the default applies when no arguments are saved. The PR objectives describe the same fix for issue #3605.
Full details: Linked Issues check
Explanation
[#3605] The reported defect is that saved Xacro arguments (bimanual:=true) were recognized but not applied when editing an existing package. At the merge base, URDFConfig::loadFromPackage set xacro_args_ but did not update xacro_args_vec_. load() passes xacro_args_vec_ to rdf_loader::RDFLoader::loadXmlFileToString, so the saved arguments were dropped. At head, loadFromPackage sets xacro_args_vec_ = { xacro_args_ };, so load() receives the saved arguments. This matches the existing loadFromPath(string) pattern. loadPrevious now reads xacro_args into a local string, so an absent xacro_args key yields an empty value. This clears stale arguments from a prior configuration. The PR adds a regression test (test/test_urdf_config.cpp) that covers loading with link_name:=custom_link and loading without arguments. Limits: the ROS 2 build and GTest were not run in this review. Multi-argument strings are passed as one vector element, as in the existing loadFromPath(string) path. This behavior was not verified for multi-argument inputs. The issue's single-argument case is covered.
Full details: Out of Scope Changes check
Explanation
All changed files relate to the objective. src/urdf_config.cpp contains the fix. test/test_urdf_config.cpp is the regression test. CMakeLists.txt registers that test when BUILD_TESTING is enabled. package.xml adds the test dependencies ament_cmake_gtest and xacro, which the test requires. No unrelated functional change was identified in the summary or the reviewed urdf_config.cpp diff. No public declarations changed.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.
Queue this pull request once it meets the queue conditions
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
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
Fixes #3605. Restore the Xacro argument vector when loading a URDF from a package, and clear stale saved arguments when the next configuration has none.
Checklist
Validation: Xacro fixture expands to the expected link with and without arguments; changed-file pre-commit hooks pass. The ROS 2 C++ build and GTest could not be executed locally because ROS 2 and colcon are unavailable. CI validation is required.
Summary by CodeRabbit