Skip to content

Honor explicitly empty Xacro mappings - #4021

Open
sylvesterkaczmarek wants to merge 1 commit into
moveit:mainfrom
sylvesterkaczmarek:fix/explicit-empty-xacro-mappings
Open

sylvesterkaczmarek wants to merge 1 commit into
moveit:mainfrom
sylvesterkaczmarek:fix/explicit-empty-xacro-mappings

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Nov 29, 2026 •

Copy link
Copy Markdown

Description

Fixes #4019. Use saved Xacro mappings only when the caller passes None, preserving an explicitly supplied empty dictionary.

Checklist

  • Formatting and pre-commit checks
  • Regression tests for omitted, empty and nonempty mappings
  • Tutorials, migration and GUI screenshots (not applicable)
  • Review another open PR

Validation: the empty-mapping regression fails before the fix; all 6 targeted Python tests pass afterward. Full ROS integration remains pending CI.

Summary by CodeRabbit

  • Bug Fixes
    • Robot descriptions now use mappings saved by the setup assistant when no mappings are specified. Explicitly providing an empty mapping preserves the Xacro defaults, while providing mappings continues to override them.
    • Added coverage for omitted, empty, and explicitly supplied mappings to verify the resulting robot description.

Signed-off-by: Sylvester Kaczmarek <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

MoveItConfigsBuilder.robot_description now uses saved mappings only when mappings is None. An empty mapping is passed through, allowing Xacro defaults to apply. A parametrized test checks omitted, empty, and explicit mappings.

Changes: Xacro Mapping Selection

Layer / File(s) Summary
Mapping selection and validation
moveit_configs_utils/moveit_configs_utils/moveit_configs_builder.py, moveit_configs_utils/test/test_empty_xacro_mappings.py
The builder documentation and logic distinguish None from an explicit empty mapping. The test checks the resulting link name for omitted, empty, and explicit mappings.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: abake48

Merge Risk: Minimal · up to 6be64

robot_description() now honors an explicitly empty mappings dictionary and uses saved setup-assistant mappings only when mappings are omitted. The change is small and covered by a targeted test. Merge readiness is good, subject to CI passing.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Honor explicitly empty Xacro mappings" matches the main change. The builder now passes saved URDF mappings only when mappings is None, so an explicitly supplied empty mapping is preserved. …
Linked Issues check Passed Issue #4019 requires that only mappings=None use the saved .setup_assistant Xacro mappings, and that an explicitly supplied dictionary, including {}, be honored. At the reviewed head, moveit_configs_b…
Out of Scope Changes check Passed The whole-PR diff against the merge base 5399d29 changes two files. moveit_configs_builder.py contains the one-expression behavior fix and a docstring clarification for the mappings parameter. test_em…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "Honor explicitly empty Xacro mappings" matches the main change. The builder now passes saved URDF mappings only when mappings is None, so an explicitly supplied empty mapping is preserved. The PR objectives and linked issue #4019 describe the same behavior. The title is short, specific, and states the primary behavior change.

Full details: Linked Issues check

Explanation

Issue #4019 requires that only mappings=None use the saved .setup_assistant Xacro mappings, and that an explicitly supplied dictionary, including {}, be honored. At the reviewed head, moveit_configs_builder.py line 237 passes self.__urdf_xacro_args if mappings is None else mappings to load_xacro. The previous mappings or self.__urdf_xacro_args expression, which replaced {} with the saved mappings, is removed. The added docstring line states that None selects the saved mappings. The new test test_empty_xacro_mappings.py parametrizes None (expects saved value 'saved'), {} (expects Xacro default 'default'), and a nonempty dictionary (expects 'explicit'). This covers the reproduction in the issue. The test was not executed in this review. Its result rests on the author's report and the source diff.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base 5399d29 changes two files. moveit_configs_builder.py contains the one-expression behavior fix and a docstring clarification for the mappings parameter. test_empty_xacro_mappings.py is a new regression test for the same behavior. Both changes connect directly to issue #4019. No unrelated changes are present.

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5399d29 and 6be64ea.

Files selected for processing: 2

  • moveit_configs_utils/moveit_configs_utils/moveit_configs_builder.py
  • moveit_configs_utils/test/test_empty_xacro_mappings.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 remain after this review.

@mergify

mergify Bot commented Nov 29, 2026

Copy link
Copy Markdown

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

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.

Explicit empty Xacro mappings are replaced by saved arguments

1 participant