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

is that possible to write nested msg in one file?

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

fury.nerd gravatar image

hi, as the below example:

Child.msg:

float32 x
float32 y

Parent.msg:

Child[2] child

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

edit retag flag offensive close merge delete

Comments

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 -0500 )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 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

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: http://wiki.ros.org/msg

edit flag offensive delete link more

Comments

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 -0500 )edit

Question Tools

2 followers

Stats

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

Seen: 190 times

Last updated: Dec 20 '22