Services

Client

class rclpy.client.Client(node_handle, context, client_handle, client_pointer, srv_type, srv_name, qos_profile, callback_group)
call(req)

Make a service request and wait for the result.

Do not call this method in a callback or a deadlock may occur.

Parameters:req – The service request
Returns:The service response
call_async(req)

Make a service request and asyncronously get the result.

Returns:a Future instance that completes when the request does
Return type:rclpy.task.Future instance
remove_pending_request(future)

Remove a future from the list of pending requests.

This prevents a future from receiving a request and executing its done callbacks. :param future: a future returned from call_async() :type future: rclpy.task.Future

service_is_ready()
wait_for_service(timeout_sec=None)

Service

class rclpy.service.Service(node_handle, service_handle, service_pointer, srv_type, srv_name, callback, callback_group, qos_profile)
send_response(response, header)