Re: [ros-users] calling a service in rospy without a type

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Ken Conley
Date:  
To: ros-users
Subject: Re: [ros-users] calling a service in rospy without a type
This is something that is being tested/prototyped in rosh right now to
see what the implications are for rospy. Both services and topics are
being tested in this manner and are much like "rostopic echo" and
"rosservice call".

As for the other benefits that you mention, they aren't really there,
per se -- your code still implicitly loads all of the code. By
removing the explicit imports, all you're doing is increasing the
potential fragility of your script, plus potentially overlooking
package dependencies that are important for building.

- Ken

On Fri, Jun 18, 2010 at 3:57 PM, Rosen Diankov <> wrote:
> Because service types are passed when the hand shacking between two
> clients occurs, it seems that it would, theoretically, be possible to
> call a service from rospy without specifying the topic name:
>
> rospy.ServiceProxy('myservice')(myparam=1)
>
> The internal rospy mechanics could import the correct service
> depending on the type.
>
> In fact, is it really necessary to specify the python service class if
> a user doesn't particularly care what the service type is? Not having
> to declare a service type could reduce the number of explicit imports
> in a python code, and potentially make python code independent of the
> types.
>
> I guess this argument would also apply to the subscribers of topics..
>
> rosen,
> _______________________________________________
> ros-users mailing list
>
> https://code.ros.org/mailman/listinfo/ros-users
>