Size: 2274
Comment: converted to 1.6 markup
|
Size: 2064
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
<<RosdocHeader(rosservice)>> | <<Package(rosservice)>> |
Line 4: | Line 4: |
== Package Summary == | == See also == |
Line 6: | Line 6: |
rosservice contains the `rosservice` command-line tool for listing and querying ROS [[Services]]. It also contains a Python library for retrieving information about Services and dynamically invoking them. The Python library is experimental and is for internal-use only. See also: [[rossrv]] |
The [[rossrv]] tool provides information about [[srv|Service definitions]] (i.e. `.srv` files). |
<<Package(rosservice)>>
See also
The rossrv tool provides information about Service definitions (i.e. .srv files).
Command-line Tools
rosservice
The rosservice command implements a variety of commands that let you discover which services are currently online from which nodes and further drill down to get specific information about a service, such as its type, URI, and arguments. You can also call a service directly from the command line.
The currently supported commands are:
rosservice list print information about active topics rosservice call call the service with the provided args rosservice type print service type rosservice uri print service ROSRPC uri
Usage
To list the Services that are currently available:
$ rosservice list [options] [/node]
To include the name of the node that implements the Service, use -n:
$ rosservice list -n
Or, to find out the name of the node that provides a particular Service:
$ rosservice node /service_name
To call a Service from the command line:
$ rosservice call /service_name service-args
e.g.
$ rosservice call /add_two_ints 1 2
Argument are interpreted using YAML-syntax.
To list the arguments to a Service:
$ rosservice args /service_name
To get the type of a Service:
$ rosservice type /service_name
This is useful in combination with rossrv. For example, to show the .srv file that defines a service:
$ rossrv show `rosservice type /service_name`
To get the URI of a service:
$ rosservice uri /service_name
Examples
rosservice can be piped to rossrv to display the Service type:
$ rosservice type add_two_ints | rossrv show int64 a int64 b --- int64 sum