|
rosros 0.2.5
Simple unified interface to ROS1 / ROS2 Python API
|
Stand-in for `rospy.Service`, wrapping the creation of ROS2 service. More...

Public Member Functions | |
| __new__ (cls, name, service_class, handler, buff_size=None, error_handler=None) | |
| Returns rclpy.service.Service instance. | |
| __subclasshook__ (cls, C) | |
| Returns true if C is a ROS2 service server class, else `NotImplemented`. | |
Stand-in for `rospy.Service`, wrapping the creation of ROS2 service.
Definition at line 89 of file service.py.
| rosros.rospify.service.Service.__new__ | ( | cls, | |
| name, | |||
| service_class, | |||
| handler, | |||
buff_size = None, |
|||
error_handler = None |
|||
| ) |
Returns rclpy.service.Service instance.
| name | service name, absolute or relative |
| service_class | service definition class |
| handler | callback function for processing service request. Function takes in a ServiceRequest and returns a ServiceResponse of the appropriate type. Function may also return a list, tuple, or dictionary with arguments to initialize a ServiceResponse instance of the correct type. If handler cannot process request, it may either return None, to indicate failure, or it may raise a rospify.ServiceException to send a specific error message to the client. Returning None is always considered a failure. |
| buff_size | ignored (ROS1 compatibility stand-in) |
| error_handler | callback function for handling errors raised in the service code, as fn(exception, exception_type, exception_value, traceback) |
Definition at line 109 of file service.py.
| rosros.rospify.service.Service.__subclasshook__ | ( | cls, | |
| C | |||
| ) |
Returns true if C is a ROS2 service server class, else `NotImplemented`.
Definition at line 124 of file service.py.