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

Xacro unable to dynamically parse file paths #488

Open
jjluhilson opened this issue Mar 26, 2025 · 0 comments
Open

Xacro unable to dynamically parse file paths #488

jjluhilson opened this issue Mar 26, 2025 · 0 comments

Comments

@jjluhilson
Copy link

Describe the bug
When describing a robot via the URDF format in a Xacro file, file paths are unable to be dynamically formed. Paths such as "$(find franka_description)/robots/frankie_arm.xacro" do not actually evaluate the find argument, instead this evaluates to the working directory with no text appended. This can also be seen when trying to run $(pwd) which returns nothing.

Version information

Did you install from PyPI or GitHub?
If PyPI what version number? 1.1.0
If GitHub what commit hash?

Robotics Toolbox depends heavily on two other packages: Swift (3D graphics) and SpatialMath toolbox (underpinning maths utilities). If you think your issue is related to these, then please answer the questions above for them.

To Reproduce
Steps to reproduce the behavior:
This can be demonstrated by breaking the frankie robot description.

  1. Go to the install location of the rtbdata package/xacro/franka_description/robots/frankie_arm_hand.urdf.xacro.
  2. Replace the line <xacro:include filename="$(find franka_description)/robots/frankie_arm.xacro"/> with <xacro:include filename="$(find franka_description)/test/robots/frankie_arm.xacro"/>
  3. This will break the file path and it can be seen that this actually evaluates this string with the directory that the URDF_read function is looking in with ../ appended
  4. It can be seen that commands do not work by replacing this line with <xacro:include filename="$(find franka_description)/test/$(pwd)/robots/frankie_arm.xacro"/> as the /$(pwd)/ section evaluates to //
  5. This is an issue when importing custom robots in xacros as the same line gets evaluated in multiple places (once relative to where it is defined, and once relative to where the xacro is called from), preventing robot definitions from correctly evaluating.
  6. Error message: No such file or directory: C:\Users\user\AppData\Local\Programs\Python\Python39\Lib\site-packages\rtbdata\xacro\franka_description\robots..//test/robots/frankie_arm.xacro when evaluating the "$(find franka_description)/test/$(pwd)/robots/frankie_arm.xacro" string

Expected behavior
This should evaluate the find commands correctly rather than using a workaround to just add ../

Environment (please complete the following information):

  • Your OS (MacOS, Linux, Windows). Windows 11
  • Your Python version. 3.9.13

Additional context
I am trying to bring in the UR10e robot description from https://github.com/ros-industrial/universal_robot

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

No branches or pull requests

1 participant