Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using substitution args without ROS #340

Merged
merged 3 commits into from
Mar 21, 2024
Merged

Using substitution args without ROS #340

merged 3 commits into from
Mar 21, 2024

Conversation

c-rizz
Copy link

@c-rizz c-rizz commented Mar 20, 2024

Hi, I have been trying to use xacro without ROS, installing directly via pip, as was discussed in issue 329. However, the current solution still does not allow to use substitution args when it is possible.
Conditionally importing substitution_args at line 288 only allows to use xacro without ROS if no substitution args are used at all. This because ament_index_python fails to import.
Moving the import of ament_index_python in _eval_find() at line 140 would allow to use all substitution args except for find, which I believe is quite reasonable in a situation in which ros is not available.
I implemented this and it seems to work nice.

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. But there is a small nitpick.

xacro/substitution_args.py Outdated Show resolved Hide resolved
Co-authored-by: Robert Haschke <[email protected]>
@c-rizz
Copy link
Author

c-rizz commented Mar 21, 2024

Sure, I didn't notice. I committed the changes.

xacro/__init__.py Outdated Show resolved Hide resolved
@rhaschke rhaschke merged commit 9d05b0e into ros:ros2 Mar 21, 2024
5 checks passed
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