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

Revision history [back]

As @yzheng0310 said, you must use the class that defines your service.

Let's suppose that the service used by /camera/start_capture is a StartCatpure that is defined in your package, and let's suppose that your package is named my_package.

In this case you would do the following:

import rospy

from my_package.srv import StartCatpure

start_capture = rospy.ServiceProxy('start_capture_node', StartCatpure)

Now, let's call the service. In this case, supposing that the service doesn't accept parameters:

start_capture()

As @yzheng0310 said, you must use the class that defines your service.

Let's suppose that the service used by /camera/start_capture is a StartCatpure that is defined in your package, and let's suppose that your package is named my_package.

In this case you would do the following:

import rospy

from my_package.srv import StartCatpure

start_capture = rospy.ServiceProxy('start_capture_node', StartCatpure)

Now, let's call the service. In this case, supposing that the service doesn't accept parameters:

start_capture()

You can check the ROS Tutorial Writing a SImple Publisher and Subscriber in Python.

As @yzheng0310 said, you must use the class that defines your service.

Let's suppose that the service used by /camera/start_capture is a StartCatpure that is defined in your package, and let's suppose that your package is named my_package.

In this case you would do the following:

import rospy

from my_package.srv import StartCatpure

start_capture = rospy.ServiceProxy('start_capture_node', StartCatpure)

Now, let's call the service. In this case, supposing that the service doesn't accept parameters:

start_capture()

You can check the ROS Tutorial Writing a SImple Publisher and Subscriber in Python. that explains step by step.

click to hide/show revision 4
No.4 Revision

As @yzheng0310 said, you must use the class that defines your service.

Let's suppose that the service used by /camera/start_capture is a StartCatpure that is defined in your package, and let's suppose that your package is named my_package.

In this case you would do the following:

import rospy

rospy

from my_package.srv import StartCatpure

StartCatpure start_capture = rospy.ServiceProxy('start_capture_node', StartCatpure)StartCapture)

Now, let's call the service. In this case, supposing that the service doesn't accept parameters:

start_capture()

You can check the ROS Tutorial Writing a SImple Publisher and Subscriber in Python that explains step by step.