Contents

  1. API Listing

See also:

API Listing

Language-specific client APIs as well as tools may define convenience methods that make it unnecessary to call these APIs directly.

getBusStats(caller_id)

  • Retrieve transport/topic statistics.


    Parameters

    • caller_id (str)

      • ROS caller ID.

    Returns (int, str, [XMLRPCLegalValue*])

    • (code, statusMessage, stats)


      stats is of the form [publishStats, subscribeStats, serviceStats] where

      publishStats: [[topicName, messageDataSent, pubConnectionData]...]
      subscribeStats: [[topicName, subConnectionData]...]
      serviceStats: (proposed) [numRequests, bytesReceived, bytesSent]
      
      pubConnectionData: [connectionId, bytesSent, numSent, connected]* 
      subConnectionData: [connectionId, bytesReceived, dropEstimate, connected]*
      
      dropEstimate: -1 if no estimate. 

getBusInfo(caller_id)

  • Retrieve transport/topic connection information.


    Parameters

    • caller_id (str)

      • ROS caller ID.

    Returns (int, str, [XMLRPCLegalValue*])

    • (code, statusMessage, busInfo)


      busInfo is of the form:

      • [[connectionId1, destinationId1, direction1, transport1, topic1, connected1]... ]

        connectionId is defined by the node and is opaque.

        destinationId is the XMLRPC URI of the destination.

        direction is one of 'i', 'o', or 'b' (in, out, both).

        transport is the transport type (e.g. 'TCPROS').

        topic is the topic name.

        connected1 indicates connection status. Note that this field is only provided by slaves written in Python at the moment (cf. rospy/masterslave.py in _TopicImpl.get_stats_info() vs. roscpp/publication.cpp in Publication::getInfo()).

getMasterUri(caller_id)

  • Get the URI of the master node.


    Parameters

    • caller_id (str)

      • ROS caller ID.

    Returns (int, str, str)

    • (code, statusMessage, masterURI)

shutdown(caller_id, msg='')

  • Stop this server.


    Parameters

    • caller_id (str)

      • ROS caller ID.

      msg (str)

      • A message describing why the node is being shutdown.

    Returns (int, str, int)

    • (code, statusMessage, ignore)

getPid(caller_id)

  • Get the PID of this server.


    Parameters

    • caller_id (str)

      • ROS caller ID.

    Returns (int, str, int)

    • (code, statusMessage, serverProcessPID)

getSubscriptions(caller_id)

  • Retrieve a list of topics that this node subscribes to


    Parameters

    • caller_id (str)

      • ROS caller ID.

    Returns (int, str, [ [str, str] ])

    • (code, statusMessage, topicList)


      topicList is a list of topics this node subscribes to and is of the form

      [ [topic1, topicType1]...[topicN, topicTypeN] ]

getPublications(caller_id)

  • Retrieve a list of topics that this node publishes.


    Parameters

    • caller_id (str)

      • ROS caller ID.

    Returns (int, str, [ [str, str] ])

    • (code, statusMessage, topicList)


      topicList is a list of topics published by this node and is of the form

      [ [topic1, topicType1]...[topicN, topicTypeN] ]

paramUpdate(caller_id, parameter_key, parameter_value)

  • Callback from master with updated value of subscribed parameter.


    Parameters

    • caller_id (str)

      • ROS caller ID.

      parameter_key (str)

      • Parameter name, globally resolved.

      parameter_value (!XMLRPCLegalValue)

      • New parameter value.

    Returns (int, str, int)

    • (code, statusMessage, ignore)

publisherUpdate(caller_id, topic, publishers)

  • Callback from master of current publisher list for specified topic.


    Parameters

    • caller_id (str)

      • ROS caller ID.

      topic (str)

      • Topic name.

      publishers ([str])

      • List of current publishers for topic in the form of XMLRPC URIs

    Returns (int, str, int)

    • (code, statusMessage, ignore)

requestTopic(caller_id, topic, protocols)

  • Publisher node API method called by a subscriber node. This requests that source allocate a channel for communication. Subscriber provides a list of desired protocols for communication. Publisher returns the selected protocol along with any additional params required for establishing connection. For example, for a TCP/IP-based connection, the source node may return a port number of TCP/IP server.


    Parameters

    • caller_id (str)

      • ROS caller ID.

      topic (str)

      • Topic name.

      protocols ([ [str, !XMLRPCLegalValue*] ])

      • List of desired protocols for communication in order of preference. Each protocol is a list of the form

        [ProtocolName, ProtocolParam1, ProtocolParam2...N]

    Returns (int, str, [str, !XMLRPCLegalValue*] )

    • (code, statusMessage, protocolParams)


      protocolParams may be an empty list if there are no compatible protocols.

Wiki: ROS/Slave_API (last edited 2014-03-19 16:02:41 by Gudjon Magnusson)