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

rossrv vs rosservice

asked 2020-04-11 14:09:34 -0600

here2infinity gravatar image

What's the difference? I see my service in rossrv list but not with rosservice list.

From ROS wiki

• rossrv: displays information about .srv data structures.

• rosservice: lists and queries ROS Services

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?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
8

answered 2020-04-11 15:08:13 -0600

gvdhoorn gravatar image

updated 2020-04-11 15:10:06 -0600

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.

edit flag offensive delete link more

Comments

3

PS: perhaps also helpful:

  • rossrv is the service counterpart to rosmsg
  • rosservice is the counterpart to rostopic
gvdhoorn gravatar image gvdhoorn  ( 2020-04-11 15:10:43 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-04-11 14:09:34 -0600

Seen: 3,186 times

Last updated: Apr 11 '20