Ask Your Question
1

rossrv vs rosservice

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

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

Comments

Could you please mark the question as answered by ticking the checkmark (✓) to the left of the answer if you feel it has been answered? Thanks.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-03 14:42:15 -0500 )edit

1 Answer

Sort by » oldest newest most voted
4

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

gvdhoorn gravatar image

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

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

1

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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 137 times

Last updated: Apr 11