ROS client library for Python. See U{http://ros.org/wiki/rospy} @author: Ken Conley (kwc)
Module | client |
Additional ROS client API methods. |
Module | core |
rospy internal core implementation library |
Module | exceptions |
rospy exception types |
Package | impl |
No package docstring; 12/14 modules documented |
Module | logger |
No module docstring; 1/1 exception, 1/1 class documented |
Module | msg |
Internal use: Support for ROS messages, including network serialization routines |
Module | msproxy |
Master/Slave XML-RPC Wrappers. |
Module | names |
Support for ROS Names |
Module | numpy |
Support for using numpy with rospy messages. |
Module | rosconsole |
Undocumented |
Module | rostime |
ROS time and duration representations, as well as internal routines for managing wallclock versus a simulated clock. The important data classes are L{Time} and L{Duration}, which represent the ROS 'time' and 'duration' primitives, respectively. |
Module | service |
Base-classes and management of ROS services. See L{rospy.tcpros_service} for actual implementation. |
Module | timer |
No module docstring; 2/2 classes documented |
Module | topics |
rospy implementation of topics. |
From __init__.py
:
Class |
|
Message class to use for subscribing to any topic regardless of type. Incoming messages are not deserialized. Instead, the raw serialized data can be accssed via the buff property. |
Class |
|
Duration represents the ROS 'duration' primitive type, which consists of two integers: seconds and nanoseconds. The Duration class allows you to add and subtract Duration instances, including adding and subtracting from L{Time} instances. |
Class |
|
Convenience wrapper for ROS master API and XML-RPC implementation. The Master API methods can be invoked on this object and will be forwarded appropriately. Names in arguments will be remapped according to current node settings... |
Class |
|
Class for registering as a publisher of a ROS topic. |
Class |
|
Convenience class for sleeping in a loop at a specified rate |
Class |
|
Declare a ROS service. Service requests are passed to the specified handler. |
Class |
|
Create a handle to a ROS service for invoking calls. |
Class |
|
Callback API to receive notifications when new subscribers connect and disconnect. |
Class |
|
Class for registering as a subscriber to a specified topic, where the messages are of a given type. |
Class |
|
Time represents the ROS 'time' primitive type, which consists of two integers: seconds since epoch and nanoseconds since seconds. Time instances are mutable. |
Exception |
|
Base exception class for ROS clients |
Exception |
|
Exception for errors initializing ROS state |
Exception |
|
Base class for exceptions that are internal to the ROS system |
Exception |
|
Exception for operations that interrupted, e.g. due to shutdown. |
Exception |
|
Exception for message serialization errors |
Exception |
|
Exception class for service-related errors |
Exception |
|
Base class for transport-related exceptions |
Exception |
|
Internal exception for representing exceptions that occur establishing transports |
Exception |
|
Internal class for representing broken connections |
Function | delete |
Delete a parameter on the param server |
Function | get |
Get a remote handle to the ROS Master. This method can be called independent of running a ROS node, though the ROS_MASTER_URI must be declared in the environment. |
Function | get |
Get fully resolved name of local node. If this is not a node, use empty string @return: fully-qualified name of local node or '' if not applicable @rtype: str |
Function | get |
Get namespace of local node. @return: fully-qualified name of local node or '' if not applicable @rtype: str |
Function | get |
Get this Node's URI. @return: this Node's XMLRPC URI @rtype: str |
Function | get |
Retrieve a parameter from the param server |
Function | get |
Retrieve a parameter from the param server with local caching |
Function | get |
Retrieve list of parameter names. |
Function | get |
Retrieve list of topics that the master is reporting as being published. |
Function | get |
Get the value of ROS_ROOT. @param env: override environment dictionary @type env: dict @param required: if True, fails with ROSException @return: Value of ROS_ROOT environment @rtype: str @raise ROSException: if require is True and ROS_ROOT is not set... |
Function | get |
Get the current time as a L{Time} object @return: current time as a L{rospy.Time} object @rtype: L{Time} |
Function | get |
Get the current time as float secs (time.time() format) @return: time in secs (time.time() format) @rtype: float |
Function | has |
Test if parameter exists on the param server |
Function | init |
Register client node with the master under the specified name. This MUST be called from the main Python thread unless disable_signals is set to True. Duplicate calls to init_node are only allowed if the arguments are identical as the side-effects of this method are not reversible. |
Function | is |
@return: True if shutdown flag has been set @rtype: bool |
Function | logdebug |
Undocumented |
Function | logdebug |
Undocumented |
Function | logdebug |
Undocumented |
Function | logerr |
Undocumented |
Function | logerr |
Undocumented |
Function | logerr |
Undocumented |
Function | logfatal |
Undocumented |
Function | logfatal |
Undocumented |
Function | logfatal |
Undocumented |
Function | loginfo |
Undocumented |
Function | loginfo |
Undocumented |
Function | loginfo |
Undocumented |
Function | logwarn |
Undocumented |
Function | logwarn |
Undocumented |
Function | logwarn |
Undocumented |
Function | myargv |
Remove ROS remapping arguments from sys.argv arguments. @return: copy of sys.argv with ROS remapping arguments removed @rtype: [str] |
Function | on |
Register function to be called on shutdown. This function will be called before Node begins teardown. @param h: Function with zero args to be called on shutdown. @type h: fn() |
Function | parse |
utility function for parsing ROS-RPC URIs @param uri: ROSRPC URI @type uri: str @return: address, port @rtype: (str, int) @raise ParameterInvalid: if uri is not a valid ROSRPC URI |
Function | remap |
Remap a ROS name. This API should be used to instead of resolve_name for APIs in which you don't wish to resolve the name unless it is remapped. @param name: name to remap @type name: str |
Function | resolve |
Resolve a ROS name to its global, canonical form. Private ~names are resolved relative to the node name. |
Function | search |
Search for a parameter on the param server |
Function | set |
Set a parameter on the param server |
Function | signal |
Initiates shutdown process by signaling objects waiting on _shutdown_lock. Shutdown and pre-shutdown hooks are invoked. @param reason: human-readable shutdown reason, if applicable @type reason: str |
Function | sleep |
sleep for the specified duration in ROS time. If duration is negative, sleep immediately returns. |
Function | spin |
Blocks until ROS node is shutdown. Yields activity to other threads. @raise ROSInitException: if node is not in a properly initialized state |
Function | wait |
Blocks until service is available. Use this in initialization code if your program depends on a service already running. @param service: name of service @type service: str @param timeout: timeout time in seconds or Duration, None for no timeout... |
Blocks until ROS node is shutdown. Yields activity to other threads. @raise ROSInitException: if node is not in a properly initialized state
Remove ROS remapping arguments from sys.argv arguments. @return: copy of sys.argv with ROS remapping arguments removed @rtype: [str]
Register client node with the master under the specified name. This MUST be called from the main Python thread unless disable_signals is set to True. Duplicate calls to init_node are only allowed if the arguments are identical as the side-effects of this method are not reversible.
- @param name: Node's name. This parameter must be a base name,
- meaning that it cannot contain namespaces (i.e. '/')
@type name: str
- @param argv: Command line arguments to this program, including
- remapping arguments (default: sys.argv). If you provide argv to init_node(), any previously created rospy data structure (Publisher, Subscriber, Service) will have invalid mappings. It is important that you call init_node() first if you wish to provide your own argv.
@type argv: [str]
- @param anonymous: if True, a name will be auto-generated for the
- node using name as the base. This is useful when you wish to have multiple instances of the same node and don't care about their actual names (e.g. tools, guis). name will be used as the stem of the auto-generated name. NOTE: you cannot remap the name of an anonymous node.
@type anonymous: bool
- @param log_level: log level for sending message to /rosout and log
- file, which is INFO by default. For convenience, you may use rospy.DEBUG, rospy.INFO, rospy.ERROR, rospy.WARN, rospy.FATAL
@type log_level: int
- @param disable_signals: If True, rospy will not register its own
signal handlers. You must set this flag if (a) you are unable to call init_node from the main thread and/or you are using rospy in an environment where you need to control your own signal handling (e.g. WX). If you set this to True, you should call rospy.signal_shutdown(reason) to initiate clean shutdown.
NOTE: disable_signals is overridden to True if roslib.is_interactive() is True.
@type disable_signals: bool
- @param disable_rostime: for internal testing only: suppresses
- automatic subscription to rostime
@type disable_rostime: bool
- @param disable_rosout: for internal testing only: suppress
- auto-publication of rosout
@type disable_rostime: bool
- @param xmlrpc_port: If provided, it will use this port number for the client
- XMLRPC node.
@type xmlrpc_port: int
- @param tcpros_port: If provided, the TCPROS server will listen for
- connections on this port
@type tcpros_port: int
@raise ROSInitException: if initialization/registration fails @raise ValueError: if parameters are invalid (e.g. name contains a namespace or is otherwise illegal)
Retrieve list of topics that the master is reporting as being published.
@return: List of topic names and types: [[topic1, type1]...[topicN, typeN]] @rtype: [[str, str]]
Get a remote handle to the ROS Master. This method can be called independent of running a ROS node, though the ROS_MASTER_URI must be declared in the environment.
@return: ROS Master remote object @rtype: L{rospy.MasterProxy} @raise Exception: if server cannot be located or system cannot be initialized
Register function to be called on shutdown. This function will be called before Node begins teardown. @param h: Function with zero args to be called on shutdown. @type h: fn()
Retrieve a parameter from the param server
NOTE: this method is thread-safe.
@param default: (optional) default value to return if key is not set @type default: any @return: parameter value @rtype: XmlRpcLegalValue @raise ROSException: if parameter server reports an error @raise KeyError: if value not set and default is not given
Retrieve a parameter from the param server with local caching
NOTE: this method is thread-safe.
@param default: (optional) default value to return if key is not set @type default: any @return: parameter value @rtype: XmlRpcLegalValue @raise ROSException: if parameter server reports an error @raise KeyError: if value not set and default is not given
Retrieve list of parameter names.
NOTE: this method is thread-safe.
@return: parameter names @rtype: [str] @raise ROSException: if parameter server reports an error
Set a parameter on the param server
NOTE: this method is thread-safe. If param_value is a dictionary it will be treated as a parameter tree, where param_name is the namespace. For example::
{'x':1,'y':2,'sub':{'z':3}}
will set param_name/x=1, param_name/y=2, and param_name/sub/z=3. Furthermore, it will replace all existing parameters in the param_name namespace with the parameters in param_value. You must set parameters individually if you wish to perform a union update.
@param param_name: parameter name @type param_name: str @param param_value: parameter value @type param_value: XmlRpcLegalValue @raise ROSException: if parameter server reports an error
Delete a parameter on the param server
NOTE: this method is thread-safe.
@param param_name: parameter name @type param_name: str @raise KeyError: if parameter is not set @raise ROSException: if parameter server reports an error
Test if parameter exists on the param server
NOTE: this method is thread-safe.
@param param_name: parameter name @type param_name: str @raise ROSException: if parameter server reports an error
Search for a parameter on the param server
NOTE: this method is thread-safe.
@param param_name: parameter name @type param_name: str @return: key of matching parameter or None if no matching parameter. @rtype: str @raise ROSException: if parameter server reports an error
sleep for the specified duration in ROS time. If duration is negative, sleep immediately returns.
@param duration: seconds (or rospy.Duration) to sleep @type duration: float or Duration @raise ROSInterruptException: if ROS shutdown occurs before sleep completes @raise ROSTimeMovedBackwardsException: if ROS time is set backwards
Initiates shutdown process by signaling objects waiting on _shutdown_lock. Shutdown and pre-shutdown hooks are invoked. @param reason: human-readable shutdown reason, if applicable @type reason: str
Get the value of ROS_ROOT. @param env: override environment dictionary @type env: dict @param required: if True, fails with ROSException @return: Value of ROS_ROOT environment @rtype: str @raise ROSException: if require is True and ROS_ROOT is not set
utility function for parsing ROS-RPC URIs @param uri: ROSRPC URI @type uri: str @return: address, port @rtype: (str, int) @raise ParameterInvalid: if uri is not a valid ROSRPC URI
Get fully resolved name of local node. If this is not a node, use empty string @return: fully-qualified name of local node or '' if not applicable @rtype: str
Get namespace of local node. @return: fully-qualified name of local node or '' if not applicable @rtype: str
Resolve a ROS name to its global, canonical form. Private ~names are resolved relative to the node name.
@param name: name to resolve. @type name: str @param caller_id: node name to resolve relative to. To resolve to local namespace, omit this parameter (or use None) @type caller_id: str @return: Resolved name. If name is empty/None, resolve_name returns parent namespace. If namespace is empty/None, @rtype: str
Remap a ROS name. This API should be used to instead of resolve_name for APIs in which you don't wish to resolve the name unless it is remapped. @param name: name to remap @type name: str
@param resolved: if True (default), use resolved names in remappings, which is the standard for ROS. @type resolved: bool
@return: Remapped name @rtype: str
Get the current time as a L{Time} object @return: current time as a L{rospy.Time} object @rtype: L{Time}
Get the current time as float secs (time.time() format) @return: time in secs (time.time() format) @rtype: float
Blocks until service is available. Use this in initialization code if your program depends on a service already running. @param service: name of service @type service: str @param timeout: timeout time in seconds or Duration, None for no timeout. NOTE: timeout=0 is invalid as wait_for_service actually contacts the service, so non-blocking behavior is not possible. For timeout=0 uses cases, just call the service without waiting. @type timeout: double|rospy.Duration @note roscpp waitForService() has timeout specified in millisecs. @raise ROSException: if specified timeout is exceeded @raise ROSInterruptException: if shutdown interrupts wait