ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

[ROS2] generating DDS .idl files from .msg ROS Message Format

asked 2017-08-09 10:26:31 -0600

jochen.mueck gravatar image

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

edit retag flag offensive close merge delete

Comments

Are you trying to do this to use the IDL outside ROS2, or are you trying to generate msgs for your ROS2 package?

gvdhoorn gravatar image gvdhoorn  ( 2017-08-09 10:37:44 -0600 )edit

yes, i'm trying to use that idl with plain rti dds on a non ros machine

jochen.mueck gravatar image jochen.mueck  ( 2017-08-09 10:49:25 -0600 )edit

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

jochen.mueck gravatar image jochen.mueck  ( 2017-08-09 11:02:56 -0600 )edit

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.

William gravatar image William  ( 2017-08-09 11:13:12 -0600 )edit

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 :-)

jochen.mueck gravatar image jochen.mueck  ( 2017-08-09 11:16:39 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-08-09 11:28:56 -0600

William gravatar image

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.

edit flag offensive delete link more

Comments

works like a charm, thanks a lot ! since i want to use rti dds anyways on the other machine it's the best solution

jochen.mueck gravatar image jochen.mueck  ( 2017-08-10 01:04:57 -0600 )edit

@William@jochen.mueck How can i access the published and subscribed data by accessing the idl files ?

aks gravatar image aks  ( 2018-06-04 06:13:32 -0600 )edit

@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/

tfoote gravatar image tfoote  ( 2018-06-04 12:37:02 -0600 )edit

@tfoote : noted for future and deleted the redundant question

aks gravatar image aks  ( 2018-06-05 09:27:51 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2017-08-09 10:26:31 -0600

Seen: 1,993 times

Last updated: Aug 09 '17