Learning how to use services

Services are another way through which nodes can communicate with each other. Services allow nodes to send a request and receive a response.

The tool that we are going to use to interact with services is called rosservice. The accepted parameters for this command are as follows:

  • rosservice args /service: This prints the service arguments
  • rosservice call /service: This calls the service with the arguments provided
  • rosservice find msg-type: This finds services by their service type
  • rosservice info /service: This prints information about the service
  • rosservice list: This lists the active services
  • rosservice type /service: This prints the service type
  • rosservice uri /service: This prints the ROSRPC URI service

Get ROS Programming: Building Powerful Robots now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.