[ros-users] rosmsg and rossrv prototype

Thibault Kruse kruset at in.tum.de
Wed Nov 2 20:41:24 UTC 2011

On 11/02/2011 08:29 PM, Ken Conley wrote:
> There is a question I have, which is whether or not arrays of
> messages should be populated with a default instance to make them
> easier to use (those are the hardest case, IMHO, to type).
It could be useful, but indeed my code is inconsistent in that
it does this only for arrays at the root level. It is more of a bug
really, I did not think too much about it then.
>    This may
> or may not be related to your comment re: Quaternions and Headers.
> For Quaternion and Headers, I'll note that we learned the hard way
> that making the core libraries have specific knowledge of messages
> creates annoying future problems, no matter how well intentioned, so
> perhaps a plugin system is in order, as well as possible changes to
> the generated messages themselves.
I think there is nothing wrong with the general idea of defining
defaults for ros message elements, following convention over
configuration. That would be the right fix for Quaternions IMO,
but I guess a lot of work.

I believe the issue of giving initial array elements in the completion
is a separate issue that is only relevant for completion. An option
for the prototype command would do for that, traversing the
message and creating instances in empty arrays.

A plugin system traversing the message and replacing values in
specific message types is thinkable, but I'd say not a priority.

What's more important I think is to manage the order of elements
to match the .msg file definition. I think my code creates them in
arbitrary order, which I find a bit confusing.
> Some union of roslib.messages, rosmsgproto, and rosh bagys seems like
> a good strawman.
Seems like a lot of work, good luck with it.

If you want me to clean up the script given your input and create
  unit tests, I can do so.


More information about the ros-users mailing list