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

Ken Conley kwc at willowgarage.com
Fri Jun 18 23:58:02 UTC 2010


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 <rosen.diankov at gmail.com> 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
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>



More information about the ros-users mailing list