design icon indicating copy to clipboard operation
design copied to clipboard

Add section on uniquely identifier interface definitions

Open jacobperron opened this issue 5 years ago • 7 comments

Follow up from https://github.com/ros2/rmw_opensplice/pull/263#discussion_r267590563

This is a proposal for uniquely identifying ROS interfaces that does not make any assumptions about the subfolder(s) where the interface definitions are found.

jacobperron avatar Mar 25 '19 17:03 jacobperron

Can we do better than relying on file system layout to uniquely identify a message? What about using package name and a hash generated from the comment-less version of the message definition?

gbiggs avatar Mar 26 '19 03:03 gbiggs

What about using package name and a hash generated from the comment-less version of the message definition?

That doesn't seem practical if the user has to specify a message type on the command line.

dirk-thomas avatar Mar 26 '19 17:03 dirk-thomas

That doesn't seem practical if the user has to specify a message type on the command line.

True. I was thinking only in terms of automated tools, but the usability aspect for the user/programmer is probably more important.

gbiggs avatar Mar 27 '19 00:03 gbiggs

After an offline discussion, I've updated this PR attempting to address the problem of identifying interfaces in general (pure IDL).

jacobperron avatar Mar 29 '19 18:03 jacobperron

Considering a command line tool like ros2 msg I would expect it to take a URN as an argument. The problem I see is that it doesn't know what the correct URL is in order to import the module containing the type.

Is it possible for typesupport to provide the URL? I.e. provide a mapping from a types URN to the URL.

jacobperron avatar Mar 29 '19 21:03 jacobperron

Is it possible for typesupport to provide the URL? I.e. provide a mapping from a types URN to the URL.

Maybe that information could be put into the resource index. Currently each URN has a marker file in the resource index. Instead of using an empty file it could contain the URL.

dirk-thomas avatar Mar 29 '19 22:03 dirk-thomas

Maybe that information could be put into the resource index. Currently each URN has a marker file in the resource index. Instead of using an empty file it could contain the URL.

That might work. But is it the case that there is a marker file for each URN? It looks like there is a single marker file for the package containing relative paths to the resource files (not necessarily URNs). For example, there's a file install/test_msgs/share/ament_index/resource_index/rosidl_interfaces/test_msgs containing:

content

action/Fibonacci.action
action/Fibonacci.idl
action/NestedMessage.action
action/NestedMessage.idl
msg/BoundedArrayNested.idl
msg/BoundedArrayNested.msg
msg/BoundedArrayPrimitives.idl
msg/BoundedArrayPrimitives.msg
msg/BoundedArrayPrimitivesNested.idl
msg/BoundedArrayPrimitivesNested.msg
msg/Builtins.idl
msg/Builtins.msg
msg/DynamicArrayNested.idl
msg/DynamicArrayNested.msg
msg/DynamicArrayPrimitives.idl
msg/DynamicArrayPrimitives.msg
msg/DynamicArrayPrimitivesNested.idl
msg/DynamicArrayPrimitivesNested.msg
msg/DynamicArrayStaticArrayPrimitivesNested.idl
msg/DynamicArrayStaticArrayPrimitivesNested.msg
msg/Empty.idl
msg/Empty.msg
msg/Nested.idl
msg/Nested.msg
msg/Primitives.idl
msg/Primitives.msg
msg/StaticArrayNested.idl
msg/StaticArrayNested.msg
msg/StaticArrayPrimitives.idl
msg/StaticArrayPrimitives.msg
msg/StaticArrayPrimitivesNested.idl
msg/StaticArrayPrimitivesNested.msg
srv/Empty.idl
srv/Empty.srv
srv/Empty_Request.msg
srv/Empty_Response.msg
srv/Primitives.idl
srv/Primitives.srv
srv/Primitives_Request.msg
srv/Primitives_Response.msg

jacobperron avatar Apr 02 '19 19:04 jacobperron