Call a service in Python code

Hello, I know how to create service server, service client and call them in terminal through roslaunch or rosrun. BUT !!

How to call service who is already created by robot manufacturers in python code ?

You could find out from the manufacturer how to call this service. Or you might simply need to check the services running and find the service name and parameters.

I don’t know whether this is ros 1 or 2, but the following information must be present:

  1. How to start the service if it’s not running already.
  2. The name of the service (should be present is the list of services when running)
  3. Any parameters that needs to be passed to the service (use the command to get the service info).

Then you can create a Python service client with the information above.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.