On 11/02/2011 05:28 PM, Ken Conley wrote:
>
> I'm definitely for such a feature, though, like Felix, I'm not sure
> they belong with rosmsg/rossrv as there is a bit of a abstraction loss
> there; either that, or rosmsg/srv need a first-class notion of the
> YAML form of messages. Right now the YAML form is implicit and the
> code APIs are generally marked for internal use only.
I am dispassionate about where the code goes. It is 2 python functions
we talk about, with dependencies to roslib, and only trivial
dependencies to
small rosmsg functions.
I put the patch to rosmsg only because of the seeming similarity to rosmsg
show, thinking if there were such a function, that's where I'd look for
it, and
initially hoping there'd be enough support for it there.
I split the functions out into a separate python file, and attached it
to the ticket.
> Also, personally I use the multi-line input for command-line args,
> which greatly simplifies the YAML, and perhaps the 'prototype' feature
> could educate users about that as well.
I had some problems with the YAML multiline initially. But using your
trick I
found that the cause was me adding \ symbols at then end of lines
unnecessarily.
So my patch is quickly transformed to offer both multiline and flow syntax.
example:
$ python rosmsgproto.py msg tf/tfMessage
"transforms:
- child_frame_id: ''
header:
frame_id: ''
seq: 0
stamp:
nsecs: 0
secs: 0
transform:
rotation:
w: 0.0
x: 0.0
y: 0.0
z: 0.0
translation:
x: 0.0
y: 0.0
z: 0.0"
> Basically, you can use the
> 'rostopic echo' output form as a prototype of a 'rostopic pub'
Sounds like hen and egg.