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

Added ros2interface to replace ros2 msg/srv #288

Merged
merged 34 commits into from
Jun 27, 2019
Merged

Conversation

skucheria
Copy link
Member

Addressing #223

@skucheria skucheria marked this pull request as ready for review June 24, 2019 23:33
Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

There can be some refactoring done. Most of the functions should work for generic IDL files, and don't need to make the distinction between "msg", "srv", and "action". For options like --msg-only, we can filter the list based on the second namespace.

This might be a good time to move some of the rosidl-specific logic to another package. Perhaps as a follow-up once we have the functionality working here.

ros2interface/package.xml Outdated Show resolved Hide resolved
ros2interface/package.xml Outdated Show resolved Hide resolved
ros2interface/package.xml Outdated Show resolved Hide resolved
ros2interface/package.xml Outdated Show resolved Hide resolved
ros2interface/package.xml Outdated Show resolved Hide resolved
ros2interface/ros2interface/verb/show.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/verb/show.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/verb/show.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/verb/show.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/verb/show.py Show resolved Hide resolved
@skucheria
Copy link
Member Author

skucheria commented Jun 26, 2019

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

Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

Looking good. In addition to addressing the comments below, I think it would be nice to add some unit tests for the functions in ros2interface/api.

ros2interface/ros2interface/api/__init__.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/api/__init__.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/api/__init__.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/api/__init__.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/api/__init__.py Show resolved Hide resolved
ros2interface/ros2interface/verb/list.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/verb/package.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/verb/packages.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/verb/packages.py Show resolved Hide resolved
ros2interface/ros2interface/verb/packages.py Outdated Show resolved Hide resolved
Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

To improve test coverage, it would be nice to add more API tests for the remaining functions.

ros2interface/ros2interface/api/__init__.py Outdated Show resolved Hide resolved
ros2interface/test/test_api.py Outdated Show resolved Hide resolved
ros2interface/test/test_api.py Outdated Show resolved Hide resolved
ros2interface/test/test_api.py Show resolved Hide resolved
ros2interface/test/test_api.py Outdated Show resolved Hide resolved
ros2interface/test/test_api.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/verb/packages.py Outdated Show resolved Hide resolved
Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

LGTM, just some nitpicks and small fixes.

ros2interface/test/test_api.py Show resolved Hide resolved
ros2interface/ros2interface/verb/package.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/verb/packages.py Outdated Show resolved Hide resolved
ros2interface/package.xml Show resolved Hide resolved
ros2interface/package.xml Outdated Show resolved Hide resolved
ros2interface/ros2interface/verb/list.py Outdated Show resolved Hide resolved
ros2interface/ros2interface/verb/show.py Outdated Show resolved Hide resolved
skucheria and others added 4 commits June 27, 2019 14:00
Co-Authored-By: Jacob Perron <jacob@openrobotics.org>
Co-Authored-By: Jacob Perron <jacob@openrobotics.org>
Co-Authored-By: Jacob Perron <jacob@openrobotics.org>
@skucheria
Copy link
Member Author

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

@skucheria skucheria merged commit dec900e into master Jun 27, 2019
@delete-merged-branch delete-merged-branch bot deleted the kucheria/interface branch June 27, 2019 22:24
@artivis artivis mentioned this pull request Jun 28, 2019
ros2interface/ros2interface/api/__init__.py Show resolved Hide resolved

def get_interface_path(parts):
prefix_path = has_resource('packages', parts[0])
joined = '/'.join(parts)
Copy link
Member

Choose a reason for hiding this comment

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

This should be a platform specific separator.

ros2interface/ros2interface/api/__init__.py Show resolved Hide resolved
return list(sorted({
n[4:-4]
for n in interface_names
if n.startswith('srv/') and n[-4:] in ('.idl', '.srv')}))
Copy link
Member

Choose a reason for hiding this comment

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

Several of these function look like copy-n-paste with only minimal differences. Please refactor to avoid the duplication. Also we do have a rosidl_runtime_py now so all the TODOs can be addressed.

ros2interface/ros2interface/verb/list.py Show resolved Hide resolved
ros2interface/ros2interface/verb/list.py Show resolved Hide resolved
ros2interface/ros2interface/verb/list.py Show resolved Hide resolved
ros2interface/ros2interface/verb/list.py Show resolved Hide resolved
ros2interface/ros2interface/verb/show.py Show resolved Hide resolved
ros2interface/setup.py Show resolved Hide resolved
@wjwwood wjwwood mentioned this pull request Sep 18, 2019
34 tasks
esteve pushed a commit to esteve/ros2cli that referenced this pull request Dec 16, 2022
Signed-off-by: Aditya <aditya050995@gmail.com>

Co-authored-by: Aditya <aditya050995@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

3 participants