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 functions for getting interface names and paths #3

Merged
merged 3 commits into from
Oct 19, 2019

Conversation

jacobperron
Copy link
Member

@jacobperron jacobperron commented Oct 18, 2019

The implementation was copied from ros2/ros2cli (0de8f53) and then refactored (1ce5a76).

Since these functions are specific to rosidl, this package seems like a more appropriate place for them to live.
This will also let them be easier reused by several of the ros2cli packages (and potentially elsewhere in the future).

I'll follow-up shortly with a PR to ros2/ros2cli to make use of the implementation in this package.

I'm opening for visibility and early review while I add unit tests. (unit tests added)

I should add that this should resolve many TODOs in the ros2cli repository, for example:

https://github.com/ros2/ros2cli/blob/80921ce1577277ef4a68184d6c2cba7d63c74b95/ros2topic/ros2topic/api/__init__.py#L60

https://github.com/ros2/ros2cli/blob/80921ce1577277ef4a68184d6c2cba7d63c74b95/ros2interface/ros2interface/api/__init__.py#L99

https://github.com/ros2/ros2cli/blob/80921ce1577277ef4a68184d6c2cba7d63c74b95/ros2interface/ros2interface/api/__init__.py#L124

https://github.com/ros2/ros2cli/blob/80921ce1577277ef4a68184d6c2cba7d63c74b95/ros2interface/ros2interface/api/__init__.py#L149

https://github.com/ros2/ros2cli/blob/80921ce1577277ef4a68184d6c2cba7d63c74b95/ros2interface/ros2interface/api/__init__.py#L162

This is a direct copy of the definitions found in the ros2interface package:

https://github.com/ros2/ros2cli/blob/8ece0f10feba00f596514185a02cc293266e3e20/ros2interface/ros2interface/api/__init__.py

Since these functions are specific to rosidl, this package seems like a more appropriate place for them to live.
This will also let them be easier reused by several of the ros2cli packages (and potentially elsewhere in the future).

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
* Renamed functions and variables for consistency 'types' -> 'interfaces'
* Consolidated implementation for get_*interfaces() functions.
  They call a common implementation and filter the results for the type.
* Always returns the fully-qualified name of the type (e.g. no implicit 'msg/' prefix).
* Update get_interface_path() to try appending a suffix based on namespace.
  This will make usage nicer for the user, notably in the CLI tools when they are updated
  to use the new implementation.
* Added docstrings and type annotations.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron jacobperron added this to In progress in Eloquent via automation Oct 18, 2019
@jacobperron jacobperron self-assigned this Oct 18, 2019
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron
Copy link
Member Author

Ready for review.

@jacobperron
Copy link
Member Author

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

@jacobperron jacobperron moved this from In progress to Review in progress in Eloquent Oct 18, 2019
jacobperron added a commit to ros2/ros2cli that referenced this pull request Oct 19, 2019
This resolves several TODOs.

Here is the PR moving the related functions to their new home: ros2/rosidl_runtime_py#3

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Copy link
Member

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

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

So many closed out TODOs! 🎊

Eloquent automation moved this from Review in progress to Reviewer approved Oct 19, 2019
@jacobperron jacobperron merged commit 5572358 into master Oct 19, 2019
Eloquent automation moved this from Reviewer approved to Done Oct 19, 2019
@delete-merged-branch delete-merged-branch bot deleted the jacob/get_interfaces branch October 19, 2019 02:27
jacobperron added a commit to ros2/ros2cli that referenced this pull request Oct 19, 2019
* Move rosidl implementation details to rosidl_runtime_py

This resolves several TODOs.

Here is the PR moving the related functions to their new home: ros2/rosidl_runtime_py#3

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove dependencies on deprecated packages

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove obsolete test

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* make linters happy :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Eloquent
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants