[ros-users] rosmsg and rossrv prototype

Axelrod, Benjamin baxelrod at irobot.com
Tue Nov 1 15:14:16 UTC 2011


+1

I use command line service calls with long and confusing yaml syntaxes all the time.  What I typically do is figure it out once, then put it as a comment in the message/service file or as a comment at the top of the node that provides it.

Another idea is to generate a text file with the yaml prototype or put it in a comment somewhere when the msg / srv is compiled.

-Ben

-----Original Message-----
From: ros-users-bounces at code.ros.org [mailto:ros-users-bounces at code.ros.org] On Behalf Of Felix Kolbe
Sent: Tuesday, November 01, 2011 9:37 AM
To: User discussions
Subject: Re: [ros-users] rosmsg and rossrv prototype

I would like to vote for it!
Not using rostopic pub every day, I'm confused about lists and tupels and such.

Maybe this can be done without adding another subcommand. If one types:
"rostopic pub /cmd_vel" (as you should know the topic)
and presses either tab, enter or temporarily add "-h" or similar, the
prototype could be shown, so that it can be inserted without modifying
the beginning of line.

regards,
 Felix



2011/11/1 Thibault Kruse <kruset at in.tum.de>:
> Hi,
>
> When using rostopic pub or rosservice call I often find it difficult to get
> the YAML right quickly, and a bit tedious as well.
>
> I therefore implemented a function for
> $ rosmsg prototype
> $ rossrv prototype
>
> that work similar to rosmsg show and rossrv show, except that yaml is
> returned that can be used for rostopic pub / rosservice call.
> Examples:
> $ rosmsg prototype sensor_msgs/PointCloud
> "{channels: [{name: '', values: []}], header: {frame_id: '', seq: 0, stamp:
> {nsecs: 0,\
>      secs: 0}}, points: [{x: 0.0, y: 0.0, z: 0.0}]}"
> $ rossrv prototype gazebo/SetModelConfiguration
> "{joint_names: [''], joint_positions: [0.0], model_name: '',
> test_urdf_param_name: ''}"
> $ rosmsg prototype 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}}}]}"
>
> The key here was that the output can be copy/pasted as input to rostopic and
> rosservice.
>
> I already made a ticket for that enhancement here:
> https://code.ros.org/trac/ros/ticket/3732
>
>
> but given it is an API change I'd first like to know who thinks this would
> be useful. Note that this could then also be used for tab completion.
>
>
>
> My other concern is with the code quality of my patch, attached to the
> ticket at:
> https://code.ros.org/trac/ros/attachment/ticket/3732/0002-protoype-command.patch
> There are a lot of python introspection and roslib.message and yaml dumping
> bits that seem a bit unelegant to me, but I would not know better.
> I marked the spots with TODO comments in the patch.
> I'd be happy if python experts on either of those areas would have a look at
> the patch and improve it if possible.
> I am not sure whether this overlaps with rosh bagy functionality.
>
> Also it is a bit of a pity that some values are not well initialized, in
> particular Qauternions and header times. If anyone has a great idea of how
> to do this cleanly, that could be great.
>
> cheers,
>  Thibault
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
_______________________________________________
ros-users mailing list
ros-users at code.ros.org
https://code.ros.org/mailman/listinfo/ros-users



More information about the ros-users mailing list