roslua: ROS client library for Lua

Module roslua.service

Service provider. This module contains the Service class to provide services to other ROS nodes. It is created using the function roslua.service().

The service needs a handler to which incoming requests are dispatched. A handler is either a function or a class instance with a service_call() method. On a connection, the request message is called with the fields of the message passed as positional arguments. Sub-messages (i.e. non-builtin complex types) are themselves passed as arrays with the entries being the sub-message fields. This is done recursively for larger hierarchies of parameters.

Copyright© Tim Niemueller, Carnegie Mellon University, Intel Research Pittsburgh

Release: Released under BSD license

Functions

Service:dispatch (client) Dispatch incoming service requests from client.
Service:finalize () Finalize instance.
Service:get_stats () Get stats.
Service:new (service, srvtype, handler, type) Constructor.
Service:spin () Spin service provider.
Service:start_server () Start the internal TCP server to accept ROS RPC connections.
Service:uri () Get the URI for this service.


Functions

Service:dispatch (client)
Dispatch incoming service requests from client.

Parameters

  • client: client whose requests to process
Service:finalize ()
Finalize instance.
Service:get_stats ()
Get stats.

Return value:

currently empty array until this is fixed in the XML-RPC specification.
Service:new (service, srvtype, handler, type)
Constructor. Create a new service provider instance.

Parameters

  • service: name of the provided service
  • srvtype:
  • handler: handler function or class instance
  • type: type of the service
Service:spin ()
Spin service provider. This will accept new connections to the service and dispatch incoming service requests.
Service:start_server ()
Start the internal TCP server to accept ROS RPC connections.
Service:uri ()
Get the URI for this service.

Return value:

rosrpc URI

Valid XHTML 1.0!