ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The former (ie: rossrv) is a tool to display ROS service definitions (ie: the files which define them, ending in .srv).

The latter (ie: rosservice) is a tool to interact with ROS service servers. It allows you to call services in nodes, display the returned result, find out about their types and find all service servers which offer services of a specific type (see rosservice --help for all supported operations).

So rossrv is an "off-line" tool, while rosservice is a tool you use with a live, running ROS node graph.

I have catkin_ws/src/simple_arm/srv/GoToPosition.srv that I see when I run rossrv list as simple_arm/GoToPosition

However, my request handler is in catkin_ws/src/simple_arm/src/arm_mover.cpp and I only see it in rosservice list as /arm_mover/safe_move. Why can't I see /arm_mover/safe_move under rossrv list if it is a service? And the inverse with simple_arm/GoToPosition

This should now be clear: rossrv would only show you information on (and contents of) the GoToPosition.srv file, while rosservice will show you information about /arm_mover/safe_move (which is apparently the name you've given to the service server.

The former (ie: rossrv) is a tool to display ROS service definitions (ie: the files which define them, ending in .srv).

The latter (ie: rosservice) is a tool to interact with ROS service servers. (ie: those running as part of your ROS node). It allows you to call services in nodes, display the returned result, find out about their types and find all service servers which offer services of a specific type (see rosservice --help for all supported operations).

So rossrv is an "off-line" tool, while rosservice is a tool you use with a live, running ROS node graph.

I have catkin_ws/src/simple_arm/srv/GoToPosition.srv that I see when I run rossrv list as simple_arm/GoToPosition

However, my request handler is in catkin_ws/src/simple_arm/src/arm_mover.cpp and I only see it in rosservice list as /arm_mover/safe_move. Why can't I see /arm_mover/safe_move under rossrv list if it is a service? And the inverse with simple_arm/GoToPosition

This should now be clear: rossrv would only show you information on (and contents of) the GoToPosition.srv file, while rosservice will show you information about /arm_mover/safe_move (which is apparently the name you've given to the service server.