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

FindResourcePath("drake/examples/...") does not work in drake-shambhala #7809

Closed
EricCousineau-TRI opened this issue Jan 19, 2018 · 3 comments

Comments

@EricCousineau-TRI
Copy link
Contributor

I tried adding a downstream find_resource Python test in Drake Shambhala, but the resource path for atlas_convex_hull.urdf is broken:
RobotLocomotion/drake-external-examples#85

Presently, //examples data files are installed to ${drake_install}/share/drake/examples, but the resource path is implicitly defined as ${drake_install}/share/drake (and I believe it remains this even if I try to append ${drake_install}/share to the search paths).

Because drake/ is appended to the search path, I cannot do FindResourcePath("examples/...") because it requires that paths start with drake.

If I have drake::(anonymous namespace)::FileExists print out the path, my ctest output looks like this:

$ ctest -V -R test_find_resource_py
...
1: Test command: /usr/bin/python2.7 "${drake_shambhala}/drake_cmake_installed/src/find_resource/test_find_resource.py"
1: Environment variables: 
1:  PYTHONPATH=${drake_install}/lib/python2.7/site-packages:${orig_pythonpath}
1: Test timeout computed to be: 1500
1: file path: ${drake_install}/lib/python2.7/site-packages/pydrake/../../../../share/drake/drake/examples/atlas/urdf/atlas_convex_hull.urdf
1: Currently not working
1: Error: could not find resource: drake/examples/atlas/urdf/atlas_convex_hull.urdf
1/1 Test #1: test_find_resource_py ............   Passed    0.21 sec

The file ${drake_install}/lib/python2.7/site-packages/pydrake/../../../../share/drake/examples/atlas/urdf/atlas_convex_hull.urdf does exist.

While the fix seems simple (install "examples" to ${drake_install}/share/drake/drake/examples}), debugging this was rather confusing, and it'd be nice this logic were simplified to avoid this confusion in the future.

@fbudin69500 or @jwnimmer-tri, may I ask if either of you could weigh in on this?
(I can make the change if you like.)

@jwnimmer-tri
Copy link
Collaborator

Maybe #7774 is what you're getting at?

@EricCousineau-TRI
Copy link
Contributor Author

Yup, seems so!
Would this simplify the logic in find_resource.cc?

@EricCousineau-TRI
Copy link
Contributor Author

Will move my questions to #7774.

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

2 participants