rosidl icon indicating copy to clipboard operation
rosidl copied to clipboard

Resulting IDL conflicts with OMG IDL spec

Open adamsj-ros opened this issue 4 years ago • 11 comments

The resulting IDL from the UUID.msg seems to conflict with the IDL spec Section 7.5.3.

I realize there are some expectations from a ROS developer creating MSG files not to have to concern themselves with IDL specs. This is probably the wrong level to deal with this type of conflict. However, I feel it's worth calling this issue out at this level to start the conversation on how to remedy such conflicts since the layers between aren't handling it.

adamsj-ros avatar Jun 19 '20 18:06 adamsj-ros

@adamsj-oci Can you clarify how exactly it conflicts with the spec.

dirk-thomas avatar Jun 22 '20 21:06 dirk-thomas

The resulting IDL from UUID.msg is for some of the type support packages (e.g. Connext):

#ifndef __unique_identifier_msgs__msg__uuid__idl__
#define __unique_identifier_msgs__msg__uuid__idl__


module unique_identifier_msgs {

module msg {

module dds_ {


struct UUID_ {
octet uuid_[16];


};


};  // module dds_

};  // module msg

};  // module unique_identifier_msgs


#endif  // __unique_identifier_msgs__msg__uuid__idl__

From the spec we shouldn't be using identifiers that differ only in case. That is uuid_ and UUID_ in this case.

adamsj-ros avatar Jun 22 '20 21:06 adamsj-ros

Thanks for clarifying.

7.2.3 Identifiers:

IDL identifiers are case insensitive.

together with 7.5.3 Special Scoping Rules for Type Names:

Once a type has been defined anywhere within the scope of a module, interface or value type, it may not be redefined except within the scope of a nested module, interface or value type, or within the scope of a derived interface or value type.

I will move the ticket to ros2/rosidl since ultimately the transformation from .msg should either error out or mangle the name to follow the spec.

(Since it seems to work with various vendors I am not sure how soon this will get any attention though.)

dirk-thomas avatar Jun 22 '20 21:06 dirk-thomas

Makes sense. I suspect some vendors are not properly flagging this as a warning or error. However, with broader adoption means that types could be defined with this issue and then it becomes harder to remove. Still I agree that it's a lower priority.

adamsj-ros avatar Jun 22 '20 22:06 adamsj-ros

This isn't really a "vendor" issue though, is it? If rosidl is responsible for the .msg -> .idl transformation, then the resulting .idl should be valid according to the OMG (and ISO) IDL specification so it can be used with any tool that consumes IDL even if it's not specific to ROS2 (modeling tools, for example).

mitza-oci avatar Jun 22 '20 22:06 mitza-oci

Indeed, but the urgency is determined by the fact that it is / is not affecting used tools. Since afaik all RMW impl. work just fine I consider it a lower priority. If you are aware of a tool which has a problem with it that would probably bump the urgency.

dirk-thomas avatar Jun 22 '20 22:06 dirk-thomas

Right, I think we're not blocked by it, but only by using a switch on the IDL compiler that allows nonconforming input (@adamsj-oci can confirm).

The other point I was trying to make before is that one advantage of using IDL is that it can be processed by tools outside of the ROS2 system. So someone could be having the problem and we wouldn't know. Perhaps they'd file the issue, or perhaps they would just think that ROS2's IDL is a different "dialect" of IDL.

mitza-oci avatar Jun 22 '20 22:06 mitza-oci

only by using a switch on the IDL compiler that allows nonconforming input

Can you please state which concrete IDL compiler you are referring to.

dirk-thomas avatar Jun 24 '20 15:06 dirk-thomas

The tao_idl compiler shows this behavior.

adamsj-ros avatar Jun 26 '20 21:06 adamsj-ros

We actually use two different IDL compilers (tao_idl and opendds_idl) in different phases. The both indicate the problem.

adamsj-ros avatar Jun 29 '20 16:06 adamsj-ros

I would suggest to add a warning about this. It would be great if someone could contribute a pull request for this.

dirk-thomas avatar Jul 23 '20 15:07 dirk-thomas