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

handle idl files correctly #145

Merged
merged 1 commit into from
Nov 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions ros1_bridge/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,12 @@ def get_ros2_messages():
pkgs.append(package_name)
resource, _ = ament_index_python.get_resource(resource_type, package_name)
interfaces = resource.splitlines()
message_names = \
[i[4:-4] for i in interfaces if i.startswith('msg/') and i.endswith('.msg')]
message_names = {
i[4:-4]
for i in interfaces
if i.startswith('msg/') and i[-4:] in ('.idl', '.msg')}

for message_name in message_names:
for message_name in sorted(message_names):
msgs.append(Message(package_name, message_name, prefix_path))
# check package manifest for mapping rules
package_path = os.path.join(prefix_path, 'share', package_name)
Expand Down Expand Up @@ -254,10 +256,12 @@ def get_ros2_services():
pkgs.append(package_name)
resource, _ = ament_index_python.get_resource(resource_type, package_name)
interfaces = resource.splitlines()
service_names = \
[i[4:-4] for i in interfaces if i.startswith('srv/') and i.endswith('.srv')]
service_names = {
i[4:-4]
for i in interfaces
if i.startswith('srv/') and i[-4:] in ('.idl', '.srv')}

for service_name in service_names:
for service_name in sorted(service_names):
srvs.append(Message(package_name, service_name, prefix_path))
# check package manifest for mapping rules
package_path = os.path.join(prefix_path, 'share', package_name)
Expand Down