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

Installation and setup without ROS #329

Merged
merged 3 commits into from
Feb 2, 2024
Merged

Installation and setup without ROS #329

merged 3 commits into from
Feb 2, 2024

Conversation

hubernikus
Copy link

I added a pyproject.toml and a requirements.txt file which enable ROS independent installation. I required this on my system to get it working, and use the xacro library to create URDF-models of robots.

Installation can then be done with:

pip install git+https://github.com/hubernikus/xacro.git@ros2

@c-rizz
Copy link

c-rizz commented Jan 11, 2024

Hi, I was dealing with the same problem and tried your fork, however it still fails because of the ament_index_python import in xacro/substitution_args.py, which I think is not available on pypi. This could be mostly solved by moving the import inside _eval_find() at line 141. Then it would only fail if the import is actually needed.

@hubernikus
Copy link
Author

Interesting that did not trigger for me.

But yes either moving it in the _eval_find() or put it in a try / except statement would resolve it.

@rhaschke
Copy link
Contributor

rhaschke commented Feb 2, 2024

substitution_args and thus ament_index_python are imported conditionally only when using substitution args:

xacro/xacro/__init__.py

Lines 287 to 292 in 7231b8b

try:
from .substitution_args import resolve_args, ArgException, PackageNotFoundError
return resolve_args(s, context=substitution_args_context)
except ImportError as e:
raise XacroException("substitution args not supported: ", exc=e)
except ArgException as e:

@rhaschke
Copy link
Contributor

rhaschke commented Feb 2, 2024

I cleaned your PR a little bit:

  • requirements.txt is not needed as you already specify dependencies in pyproject.toml.
  • fixed version information
  • added console script generation

@rhaschke rhaschke merged commit c16d1e3 into ros:ros2 Feb 2, 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.

3 participants