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

Add get_package_share_path method #73

Merged
merged 2 commits into from
May 27, 2021
Merged

Add get_package_share_path method #73

merged 2 commits into from
May 27, 2021

Conversation

DLu
Copy link
Contributor

@DLu DLu commented May 5, 2021

Rather than all the ugliness of os.path.join I would much rather write simpler python in my launch files, so rather than

import os
from ament_index_python.packages import get_package_share_directory
...
bringup_dir = get_package_share_directory('testpkg')
urdf_path = os.path.join(bringup_dir, 'urdf', 'doggo.urdf')

you could just write

from ament_index_python.packages import get_package_share_path
...
urdf_path = get_package_share_path('testpkg') / 'urdf/doggo.urdf'

Signed-off-by: David V. Lu <davidvlu@gmail.com>
Copy link
Contributor

@audrow audrow left a comment

Choose a reason for hiding this comment

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

This looks like a good addition to me. Can you write a test for the new function and make the linter happy?

@audrow audrow self-assigned this May 7, 2021
@DLu DLu force-pushed the pathlib branch 2 times, most recently from ba8f309 to 1902978 Compare May 8, 2021 03:19
Signed-off-by: David V. Lu <davidvlu@gmail.com>
@DLu
Copy link
Contributor Author

DLu commented May 27, 2021

@audrow Linter is happy and now there's a test.

@audrow audrow self-requested a review May 27, 2021 16:07
Copy link
Contributor

@audrow audrow 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 to me, I'll run CI.

@audrow
Copy link
Contributor

audrow commented May 27, 2021

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@audrow audrow merged commit 028080c into ament:master May 27, 2021
@audrow
Copy link
Contributor

audrow commented May 27, 2021

Thanks for the PR @DLu!

@DLu DLu deleted the pathlib branch May 27, 2021 17:12
DLu added a commit to DLu/ament_index that referenced this pull request May 27, 2021
* Add get_package_share_path method

Signed-off-by: David V. Lu <davidvlu@gmail.com>

* PR Feedback

Signed-off-by: David V. Lu <davidvlu@gmail.com>
DLu added a commit to DLu/ament_index that referenced this pull request May 27, 2021
* Add get_package_share_path method

Signed-off-by: David V. Lu <davidvlu@gmail.com>

* PR Feedback

Signed-off-by: David V. Lu <davidvlu@gmail.com>
audrow pushed a commit that referenced this pull request May 27, 2021
* Add get_package_share_path method

Signed-off-by: David V. Lu <davidvlu@gmail.com>

* PR Feedback

Signed-off-by: David V. Lu <davidvlu@gmail.com>
audrow pushed a commit that referenced this pull request May 27, 2021
* Add get_package_share_path method

Signed-off-by: David V. Lu <davidvlu@gmail.com>

* PR Feedback

Signed-off-by: David V. Lu <davidvlu@gmail.com>
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.

None yet

2 participants