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

is that possible to write nested msg in one file?

asked 2022-12-19 21:52:09 -0600

fury.nerd gravatar image

hi, as the below example:


float32 x
float32 y


Child[2] child

is that possible to use only one .msg file to implement? thanks

edit retag flag offensive close merge delete


I don't know the definitive answer if its possible, but I've never seen such a thing done and would be exceptionally unusual. Its best not. But you could consult the idl generators if its even feasibly possible, but I doubt that it is.

stevemacenski gravatar image stevemacenski  ( 2022-12-19 23:57:53 -0600 )edit

well, thanks for the comment, it is indeed some kind of "idle curiosity", but somehow i just dont want to create too many msg files only use once, as exampled, if the Child.msg is only used by Parent.msg, it looks a little bit of wasting of managing/orginazing files...anyway, thanks for the comfirmation (negative comfirmation is also quit help for me)

fury.nerd gravatar image fury.nerd  ( 2022-12-20 04:16:00 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-12-20 02:33:45 -0600

tfoote gravatar image

No you cannot have more than one message per msg file. The filename is the name of the message and everything inside of the file is the contents of the message.

This sounds a bit like an XY problem. I would suggest that you consider asking a new question with more context if this is something beyond an idle curiosity about the design.

For reference the format is defined here:

edit flag offensive delete link more


thanks for the explaination, as commented above, it is indeed some kind of "idle curiosity", and this confirmation though is not happy to know but quite clear, i dont need to do more investigations.

fury.nerd gravatar image fury.nerd  ( 2022-12-20 04:18:57 -0600 )edit

Question Tools



Asked: 2022-12-19 21:52:09 -0600

Seen: 166 times

Last updated: Dec 20 '22