0
$\begingroup$

Rosanswers logo

Hi all,

I'm trying to create .idl descriptions from the ros message description format.

There is the rosidl_generate_dds_interfaces package and cmake macro.

How would I use this for instance for the std_msgs or trajectory_msgs package? I'm currently trying

rosidl_generate_dds_interfaces(std_msgs_idl IDL_FILES ${msg_files}OUTPUT_SUBFOLDERS "idl")

In std_msgs/CMakeLists.txt

Thanks Jochen


Originally posted by jochen.mueck on ROS Answers with karma: 48 on 2017-08-09

Post score: 0


Original comments

Comment by gvdhoorn on 2017-08-09:
Are you trying to do this to use the IDL outside ROS2, or are you trying to generate msgs for your ROS2 package?

Comment by jochen.mueck on 2017-08-09:
yes, i'm trying to use that idl with plain rti dds on a non ros machine

Comment by jochen.mueck on 2017-08-09:
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

Comment by William on 2017-08-09:
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.

Comment by jochen.mueck on 2017-08-09:
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 :-)

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by William with karma: 17335 on 2017-08-09

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by jochen.mueck on 2017-08-10:
works like a charm, thanks a lot ! since i want to use rti dds anyways on the other machine it's the best solution

Comment by aks on 2018-06-04:
@william @jochen.mueck How can i access the published and subscribed data by accessing the idl files ?

Comment by tfoote on 2018-06-04:
@aakash_sehgal please don't ask questions in comments. This is a solved question from close to a year ago people won't be reviewing this question.. Also you already asked this question [here](https://answers.ros.org/question/293158/how-can-i-use-the-ros2-idl-files-to-connect-with-a-non-ros-machine/

Comment by aks on 2018-06-05:
@tfoote : noted for future and deleted the redundant question

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.