ros_comm: cpp_common | message_filters | perf_roscpp | rosbag | rosbagmigration | rosconsole | roscore_migration_rules | roscpp | roscpp_serialization | roscpp_traits | rosgraph | rosgraph_msgs | roslaunch | roslisp | rosmaster | rosmsg | rosnode | rosout | rosparam | rospy | rosservice | rostest | rostime | rostopic | roswtf | std_msgs | std_srvs | topic_tools | xmlrpcpp
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.
- Author: Ken Conley/ email@example.com
- License: BSD
- Repository: ros_comm
- Source: svn https://code.ros.org/svn/ros/stacks/ros_comm/tags/electric/tools/rosservice
rosservice command-line tool
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 call call the service with the provided args rosservice find find services by service type rosservice info print information about service rosservice list list active services rosservice type print service type rosservice uri print service ROSRPC uri
Print the arguments to a service.
$ rosservice args /service_name
call <service-name> [service-args]
Call a service from the command line.
$ rosservice call /service_name service-args
$ rosservice call /add_two_ints 1 2
--wait (New in ROS 1.1)
- Wait until service is advertised before calling.
Please see YAML command line for a detailed description and examples of how to specify service arguments to call.
Please see YAML command line for a detailed description and examples of how to call rosservice with negative-number arguments.
Display all services of a particular type.
$ rosservice find rospy_tutorials/AddTwoInts
List all the services that are currently available.
$ rosservice list
list <namespace> (ROS 0.11)
List all services in the specified namespace.
$ rosservice list /rosout
Include the name of the node that implements the service.
$ rosservice list -n
rosservice info (ROS 0.11)
Print information about specified service.
$ rosservice info /rosout
Display the name of the node that provides a particular service.
$ rosservice node /service_name
Display the type of a service.
$ rosservice type /service_name
$ rossrv show `rosservice type /service_name`
or with a shell pipe:
$ rosservice type add_two_ints | rossrv show int64 a int64 b --- int64 sum
Display the URI of a service. This is useful, for example, if you wish to know what address a service is using.
$ rosservice uri /service_name
rosservice is a stable command-line tool within the ROS core toolchain. It's currently feature set is not expected expand much. Currently, the only major feature planned is the ability to use YAML text files as well as piped YAML input with the rosservice call command. This feature is currently not scheduled.