Skip to content

Make compiled descriptions relocatable#215

Draft
nickswalker wants to merge 3 commits intorobot-descriptions:mainfrom
nickswalker:enhancement/relocatable-xacro
Draft

Make compiled descriptions relocatable#215
nickswalker wants to merge 3 commits intorobot-descriptions:mainfrom
nickswalker:enhancement/relocatable-xacro

Conversation

@nickswalker
Copy link
Contributor

Make xacro-generated URDFs relocatable by rewriting repo-local file://... asset references into stable package://... URIs.

  • bump xacrodoc to >=2.0.0, which fixes behavior that would always resolve package:// to absolute file:// paths
  • rewrite repo-local filename= entries from absolute file://... paths to package://... URIs
  • leave existing package://... references and external absolute paths unchanged
  • add PACKAGE_URI_ROOT support for descriptions with nested package layouts
  • set PACKAGE_URI_ROOT = REPOSITORY_PATH for stretch_se3_description

Motivation

Some xacro-backed descriptions can emit absolute cache paths in generated URDFs, which makes the output dependent on the local clone location. This change normalizes those paths after expansion so generated URDFs stay portable across machines and cache directories.

Stretch SE3 needs one extra override because it's not a proper resolvable package with a package.xml. We manually set it's package root to simply be the root of the cloned repo.

render xacro output to a string and rewrite filenames in memory
preserve existing package:// URIs from source descriptions
convert repo-local file:// asset paths to package:// URIs
add PACKAGE_URI_ROOT to control how package-relative paths are formed
update Stretch SE3 to export package URIs from the repository root
refresh xacro tests to cover nested package layouts
@nickswalker nickswalker marked this pull request as draft March 19, 2026 21:18
@nickswalker
Copy link
Contributor Author

The package:// paths resolve fine with e.g. uv run python examples/show_in_pybullet.py gen3_lite , but not in the tests. Will have to better understand how pybullet resolves packages...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant