You can get the .idl
files that we generate for a .msg
file if you build from source and copy them out of the installation folder. However, you need to build with an rmw implementation that actually uses the .idl
files for them to be generated. The reason you don't see them, probably, is that you're using our default rmw implementation of Fast-RTPS which does not generate or consume .idl
files currently.
However, if you build, for example, with Connext it will generate and install the files to the install folder, in the case of std_msgs
it would be in path/to/install/share/std_msgs/msg/dds_connext
. The reason you have to use Connext (or an rmw implementation like it) is that the generated .idl
files are specific to the underlying vendor. Despite being a standard there are small variations in the use of the .idl
files between vendors. For example, the way in which you specify a "key field" in the .idl
file differs between vendors, I believe it is different for Connext and OpenSplice at least.
So the easiest way would be to use Connext or OpenSplice and build from source. Then the .idl
files will be generated for you and installed. No matter which you use the .idl
file produced would be a good starting place as the differences between them are small.
You should also be able to use the generator directly to generate generic .idl
files from our .msg
files (all the code and tools are there), but you might have a hard time right now since we don't do that ourselves. If you find a change that would make that easier then let us know, we'd be happy to make that use case better even though we don't need it ourselves.
Are you trying to do this to use the IDL outside ROS2, or are you trying to generate msgs for your ROS2 package?
yes, i'm trying to use that idl with plain rti dds on a non ros machine
i feel like i'm just missing a small step or so. there is a rosidl_generator_dds_idl__arguments.json file generated in the build folder.. seems like the python script is not called correctly or so
Are you getting an error message?
Also, you should be able to get the idl files out from a normal ROS 2 build. They will have been installed I believe.
i do get an error message from the install target which is looking for /ros2_ws/build/std_msgs/rosidl_generator_dds_idl/std_msgs/msg/idl/Bool_.idl" and does not find the file. I do not see the .idl files installed somewhere. that would be the easiest thing of course :-)