Package rospy :: Module core

Module core

source code

rospy internal core implementation library

Classes
  NullHandler
Functions
 
deprecated(func)
This is a decorator which can be used to mark functions as deprecated.
source code
(str, int)
parse_rosrpc_uri(uri)
utility function for parsing ROS-RPC URIs
source code
 
rospydebug(msg, *args)
Internal rospy client library debug logging
source code
 
rospyerr(msg, *args)
Internal rospy client library error logging
source code
 
rospywarn(msg, *args)
Internal rospy client library warn logging
source code
 
add_log_handler(level, h)
Add handler for specified level
source code
 
logdebug(msg, *args)
Log a debug message to the /rosout topic
source code
 
logwarn(msg, *args)
Log a warning message to the /rosout topic
source code
 
loginfo(msg, *args)
Log an info message to the /rosout topic
source code
 
logout(msg, *args)
Log an info message to the /rosout topic
source code
 
logerr(msg, *args)
Log an error message to the /rosout topic
source code
 
logerror(msg, *args)
Log an error message to the /rosout topic
source code
 
logfatal(msg, *args)
Log an error message to the /rosout topic
source code
str
get_ros_root(required=False, env=None)
Get the value of ROS_ROOT.
source code
str
get_node_uri()
Get this Node's URI.
source code
 
set_node_uri(uri)
set the URI of the local node.
source code
 
configure_logging(node_name, level=20)
Setup filesystem logging for this node
source code
bool
is_initialized()
Get the initialization state of the local node.
source code
 
set_initialized(initialized)
set the initialization state of the local node
source code
bool
is_shutdown()
Returns: True if shutdown flag has been set
source code
bool
is_shutdown_requested()
is_shutdown_requested is a state that occurs just before is_shutdown.
source code
 
add_client_shutdown_hook(h)
Add client method to invoke when system shuts down.
source code
 
add_preshutdown_hook(h)
Add method to invoke when system shuts down.
source code
 
add_shutdown_hook(h)
Add method to invoke when system shuts down.
source code
 
signal_shutdown(reason)
Initiates shutdown process by signaling objects waiting on _shutdown_lock.
source code
 
register_signals()
register system signal handlers for SIGTERM and SIGINT
source code
 
is_topic(param_name)
Validator that checks that parameter is a valid ROS topic name
source code
xmlrpclib.ServerProxy
xmlrpcapi(uri)
Returns: instance for calling remote server or None if not a valid URI
source code
Variables
  ROSRPC = 'rosrpc://'
  MASTER_NAME = 'master'
  __package__ = 'rospy'
Function Details

deprecated(func)

source code 

This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emmitted when the function is used.

parse_rosrpc_uri(uri)

source code 

utility function for parsing ROS-RPC URIs

Parameters:
  • uri (str) - ROSRPC URI
Returns: (str, int)
address, port
Raises:

add_log_handler(level, h)

source code 

Add handler for specified level

Parameters:
  • level (int) - log level (use constants from Log)
  • h (fn) - log message handler
Raises:

logdebug(msg, *args)

source code 

Log a debug message to the /rosout topic

Parameters:
  • msg (str) - message to log, may include formatting arguments
  • args - format-string arguments, if necessary

logwarn(msg, *args)

source code 

Log a warning message to the /rosout topic

Parameters:
  • msg (str) - message to log, may include formatting arguments
  • args - format-string arguments, if necessary

loginfo(msg, *args)

source code 

Log an info message to the /rosout topic

Parameters:
  • msg (str) - message to log, may include formatting arguments
  • args - format-string arguments, if necessary

logout(msg, *args)

source code 

Log an info message to the /rosout topic

Parameters:
  • msg (str) - message to log, may include formatting arguments
  • args - format-string arguments, if necessary

logerr(msg, *args)

source code 

Log an error message to the /rosout topic

Parameters:
  • msg (str) - message to log, may include formatting arguments
  • args - format-string arguments, if necessary

logerror(msg, *args)

source code 

Log an error message to the /rosout topic

Parameters:
  • msg (str) - message to log, may include formatting arguments
  • args - format-string arguments, if necessary

logfatal(msg, *args)

source code 

Log an error message to the /rosout topic

Parameters:
  • msg (str) - message to log, may include formatting arguments
  • args - format-string arguments, if necessary

get_ros_root(required=False, env=None)

source code 

Get the value of ROS_ROOT.

Parameters:
  • env (dict) - override environment dictionary
  • required - if True, fails with ROSException
Returns: str
Value of ROS_ROOT environment
Raises:

get_node_uri()

source code 

Get this Node's URI.

Returns: str
this Node's XMLRPC URI

set_node_uri(uri)

source code 

set the URI of the local node. This is an internal API method, it does not actually affect the XMLRPC URI of the Node.

configure_logging(node_name, level=20)

source code 

Setup filesystem logging for this node

Parameters:
  • node_name - Node's name @type node_name str
  • level (int) - (optional) Python logging level (INFO, DEBUG, etc...). (Default: logging.INFO)

is_initialized()

source code 

Get the initialization state of the local node. If True, node has been configured.

Returns: bool
True if local node initialized

set_initialized(initialized)

source code 

set the initialization state of the local node

Parameters:
  • initialized (bool) - True if node initialized

is_shutdown()

source code 
Returns: bool
True if shutdown flag has been set

is_shutdown_requested()

source code 

is_shutdown_requested is a state that occurs just before is_shutdown. It is initiated when a shutdown requested is received and continues until client shutdown handlers have been called. After client shutdown handlers have been serviced, the is_shutdown state becomes true.

Returns: bool
True if shutdown has been requested (but possibly not yet initiated)

add_client_shutdown_hook(h)

source code 

Add client method to invoke when system shuts down. Unlike add_shutdown_hook and add_preshutdown_hooks, these methods will be called before any rospy internal shutdown code.

Parameters:
  • h (fn(str)) - function that takes in a single string argument (shutdown reason)

add_preshutdown_hook(h)

source code 

Add method to invoke when system shuts down. Unlike add_shutdown_hook, these methods will be called before any other shutdown hooks.

Parameters:
  • h (fn(str)) - function that takes in a single string argument (shutdown reason)

add_shutdown_hook(h)

source code 

Add method to invoke when system shuts down.

Shutdown hooks are called in the order that they are registered. This is an internal API method that is used to cleanup. See the client on_shutdown() method if you wish to register client hooks.

Parameters:
  • h (fn(str)) - function that takes in a single string argument (shutdown reason)

signal_shutdown(reason)

source code 

Initiates shutdown process by signaling objects waiting on _shutdown_lock. Shutdown and pre-shutdown hooks are invoked.

Parameters:
  • reason (str) - human-readable shutdown reason, if applicable

xmlrpcapi(uri)

source code 
Returns: xmlrpclib.ServerProxy
instance for calling remote server or None if not a valid URI