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

URDF relative paths that don't start with "./" #1747

Closed
stephane-caron opened this issue Sep 15, 2022 · 5 comments
Closed

URDF relative paths that don't start with "./" #1747

stephane-caron opened this issue Sep 15, 2022 · 5 comments

Comments

@stephane-caron
Copy link
Collaborator

The update from #1742 addressed #1741, but people are inventive and there is another relative-path syntax out there 😉

There are currently 5 / 45 descriptions configured in robot_descriptions.py that use relative paths:

Description Pinocchio 2.6.4 Pinocchio 2.6.10
cf2_description ✔️
laikago_description ✔️
mini_cheetah_description
minitaur_description
pr2_description

#1742 solved descriptions that do <mesh filename="./foo/bar">, but it doesn't work on the remaining 3 because they do <mesh filename="foo/bar">.

@jcarpent
Copy link
Contributor

@fabinsch COuld you handle it?

@stephane-caron
Copy link
Collaborator Author

I don't have a Pinocchio build environment to test it right now, but the fix may be simple.

In:

          if ( bf::exists( bf::path(package_dirs[i] + "/" + string.substr(2))))
          {
            result_path = std::string( package_dirs[i] + "/" + string.substr(2));
            break;
          }

Can the calls to substr(2) be removed? Substrings like "/./" (or "/./.././../") shouldn't hurt the path.

Also note that a URDF may do <mesh filename="../foo/bar">.

@fabinsch
Copy link
Contributor

Hey @stephane-caron , thanks for raising the issue. You are right, and the solution that you're proposing works. I created a PR #1748 which should fix your loading issues in robot-descriptions/robot_descriptions.py#6.

@jcarpent
Copy link
Contributor

@stephane-caron I have merged #1748. Could you check if it is now working well on your side?

@stephane-caron
Copy link
Collaborator Author

Could you check if it is now working well on your side?

Sorry this one went out of my radar. I've opened a follow up at #1786

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

3 participants