roslua: ROS client library for Lua

Module roslua.slave_api

Slave API implementation. This module provides the slave API to be called by other nodes. It uses the Xavante HTTP server with the WSAPI interface to process XML-RPC requests. The server is bound to a random port on startup.

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

Release: Released under BSD license

Functions

init () Init slave API.
slave_uri () Get slave URI.
spin () Process requests.
wsapi_handler (wsapi_env) XML-RPC WSAPI handler
xmlrpc_exports.getBusInfo (caller_id) Get bus info.
xmlrpc_exports.getBusStats (caller_id) Get bus stats.
xmlrpc_exports.getMasterUri (caller_id) Get master URI.
xmlrpc_exports.getPid (caller_id) Get process ID of node.
xmlrpc_exports.getPublications (caller_id) Get publications of node.
xmlrpc_exports.getSubscriptions (caller_id) Get subscriptions of node.
xmlrpc_exports.paramUpdate (caller_id, param_key, param_value) Parameter update notification.
xmlrpc_exports.publisherUpdate (caller_id, topic, publishers) Publisher update.
xmlrpc_exports.requestTopic (caller_id, topic, protocols) Topic connection request.
xmlrpc_exports.shutdown (caller_id, msg) Shutdown this node
xmlrpc_exports.system.listMethods () List available methods.


Functions

init ()
Init slave API. This configures and starts the HTTP server and XML-RPC API.
slave_uri ()
Get slave URI.

Return value:

URI for this slave
spin ()
Process requests. This processes XML-RPC API calls.
wsapi_handler (wsapi_env)
XML-RPC WSAPI handler

Parameters

  • wsapi_env: WSAPI environment
xmlrpc_exports.getBusInfo (caller_id)
Get bus info.

Parameters

  • caller_id: ID of the calling node

Return value:

bus info
xmlrpc_exports.getBusStats (caller_id)
Get bus stats.

Parameters

  • caller_id: ID of the calling node

Return value:

bus stats
xmlrpc_exports.getMasterUri (caller_id)
Get master URI.

Parameters

  • caller_id: ID of the calling node

Return value:

Master URI this node is connected to
xmlrpc_exports.getPid (caller_id)
Get process ID of node.

Parameters

  • caller_id: ID of the calling node

Return value:

PID
xmlrpc_exports.getPublications (caller_id)
Get publications of node.

Parameters

  • caller_id: ID of the calling node

Return value:

list of publications
xmlrpc_exports.getSubscriptions (caller_id)
Get subscriptions of node.

Parameters

  • caller_id: ID of the calling node

Return value:

list of subscriptions
xmlrpc_exports.paramUpdate (caller_id, param_key, param_value)
Parameter update notification. Called by the parameter server if a subscribed value has changed.

Parameters

  • caller_id: ID of the calling node
  • param_key: key of parameter
  • param_value: value of parameter
xmlrpc_exports.publisherUpdate (caller_id, topic, publishers)
Publisher update. Called when the list of available publishers for a topic changes.

Parameters

  • caller_id: ID of the calling node
  • topic: topic for which the list changed
  • publishers: array of currently available slave URIs
xmlrpc_exports.requestTopic (caller_id, topic, protocols)
Topic connection request.

Parameters

  • caller_id: ID of the calling node
  • topic: requested topic
  • protocols: list of supported protocols

Return value:

TCPROS connection configuration if topic is published
xmlrpc_exports.shutdown (caller_id, msg)
Shutdown this node

Parameters

  • caller_id: ID of the calling node
  • msg: shutdown message

Return value:

bus stats
xmlrpc_exports.system.listMethods ()
List available methods.

Return value:

list of available methods

Valid XHTML 1.0!