-
Notifications
You must be signed in to change notification settings - Fork 127
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
msg2idl.py generates incorrect idl #706
Comments
The IDL that it generates is what is used by the ROS 2 tooling. So it is performing as expected currently. Why do you think it should be generating something different? Can you explain more about your use case? |
OK, my use case is that I am trying to connect my ros2 application to a native DDS application. I need the IDL that is used on the wire so I can compile that IDL in my native DDS application. At least, on the wire, the data looks like what I indicated in the expected behavior IDL above i.e. the additional nesting of dds_ and the type has an underscore after it: module my_interfaces { This problem has been seen earlier by others both in CycloneDDS and ConnextDDS where people have to "massage" the IDL to get it to work. |
OK, yeah, that's kind of what I expected. This is indeed currently a problem, which will require changing both what rosidl generates and what the rest of the ROS 2 tooling consumes. Note that this is not the only problem with making ROS 2 interoperate with native DDS; see my joint talk at ROSCon 2021 about some of the other issues. If you'd like to take a stab at fixing it, we'd be happy to review some patches. But we aren't likely to be spending much time on it in the near future. |
@clalancette Thanks for the response. Yes, I had listened to your joint talk at ROSCon 2021 earlier and understand the limitations in interfacing to native DDS including keyed fields as well as the conventions that ROS 2 follows. Since we have control over our native DDS application, we can modify it to follow the ROS 2 conventions, at least the parts that interface to ROS 2. The problem I see is that we need the correct IDL to start with in our native DDS application. BTW, I have been able to communicate natively to a ConnextDDS application as long as I manually "fix" the generated IDL and use compatible QoS settings. I just don't want to manually fix the IDL every time. Even in your talk, you mention that ROS 2 types are formatted as ::msg::dds_::. But this is not the IDL that msg2idl.py generates. Is there a different IDL used for tooling versus what's generated for the middleware? I understand the goal was to support non-DDS middleware as well, so does the DDS middleware add this additional dds nesting? I wouldn't mind taking a stab at fixing this, but I wouldn't know where to start and what parts are affected. |
Ah, now I see what you mean. It looks like this changed between when I wrote my talk a year ago and in Humble (and now Rolling). You are right that it no longer has the
No, it's the same. Just for whatever reason, it has changed since my talk. Probably the first part here would be to figure out when that changed, and what the reason for changing it was. I would probably poke around in the history of this repository to start with to see if I could find that. |
When did the idl change to remove the When I try to interface to ConnextDDS, the Connext tools show that the I did check and my version of rosidl-adapter is 3.2.1 dated 7/11/22. It is not that recent but it's what was released in the latest sync. |
Just updated to latest rolling sync from 2022-09-29 and the rosidl-adapter version is now updated to latest 3.3.0 but still the same behavior. |
@clalancette Wondering if you can point me to where the disconnect is between what is on the wire(with the additional dds_ component) and what msg2idl.py generates which is ::msg:: instead of::msg::dds_? I would have assumed msg2idl is what is used by the rmw and the tooling but that doesn't seem to be the case. I'll be glad to look at the code if I knew where to look e.g. where is the idl generated that is used by the rmw. |
I'm working with @bijoua29 on this problem and have a related question. Please let me know if this isn't the right location to ask this. Update on attempt to solve the original problem: I'm running into difficulty trying to use these modifications as part of our colcon build process, to automatically generate IDL files when building packages that contain .msg files. Currently, we're using the Related problem: Does the build environment have a different python search path than the shell used to initiate the build? It seems that the -m option is not finding our local version of rosidl_adapter and instead using the ROS default version. Update (problem fixed) |
Bug report
Required Info:
Steps to reproduce issue
Run msg2idl on following msg file: ros2 run rosidl_adapter msg2idl.py State.msg
State.msg:
bool enabled
Expected behavior
Expected output is:
module my_interfaces {
module msg {
module dds_ {
struct State_ {
boolean enabled;
};
};
};
};
Actual behavior
Actual output is:
module my_interfaces {
module msg {
struct State {
boolean enabled;
};
};
};
Additional information
The actual output looks like any older format and doesn't have the additional nesting and underscores.
The text was updated successfully, but these errors were encountered: