Package roslib :: Module rosenv
[frames] | no frames]

Module rosenv

source code

Warning: do not use this library. It is unstable and most of the routines here have been superceded by other libraries (e.g. rospkg). These routines will likely be *deleted* in future releases.

Classes
  ROSEnvException
Base class of roslib.rosenv errors.
Functions
 
get_ros_root(required=True, env=None) source code
 
get_ros_package_path(required=False, env=None) source code
 
get_master_uri(required=True, env=None, argv=None)
Get the ROS_MASTER_URI setting from the command-line args or environment, command-line args takes precedence.
source code
str
get_ros_home(env=None)
Get directory location of '.ros' directory (aka ROS home).
source code
str
get_log_dir(env=None)
Get directory to use for writing log files.
source code
str
get_test_results_dir(env=None)
Get directory to use for writing test result files.
source code
 
makedirs_with_parent_perms(p)
Create the directory using the permissions of the nearest (existing) parent directory.
source code
Variables
  ROS_ROOT = 'ROS_ROOT'
  ROS_MASTER_URI = 'ROS_MASTER_URI'
  ROS_PACKAGE_PATH = 'ROS_PACKAGE_PATH'
  ROS_HOME = 'ROS_HOME'
  ROS_BINDEPS_PATH = 'ROS_BINDEPS_PATH'
  ROS_BOOST_ROOT = 'ROS_BOOST_ROOT'
  ROS_IP = 'ROS_IP'
  ROS_HOSTNAME = 'ROS_HOSTNAME'
  ROS_NAMESPACE = 'ROS_NAMESPACE'
  ROS_LOG_DIR = 'ROS_LOG_DIR'
  __package__ = 'roslib'
Function Details

get_ros_root(required=True, env=None)

source code 
Parameters:
  • required (bool) - (default True). If True, ROS_ROOT must be set and point to a valid directory.
  • env (dict) - override environment dictionary
Raises:

get_ros_package_path(required=False, env=None)

source code 
Parameters:
  • required (bool) - (default False) if True, ROS_PACKAGE_PATH must be set and point to a valid directory.
Raises:

get_master_uri(required=True, env=None, argv=None)

source code 

Get the ROS_MASTER_URI setting from the command-line args or environment, command-line args takes precedence.

Parameters:
  • required (bool) - if True, enables exception raising
  • env (dict) - override environment dictionary
  • argv ([str]) - override sys.argv
Raises:
  • ROSEnvException - if ROS_MASTER_URI value is invalidly specified or if required and ROS_MASTER_URI is not set

get_ros_home(env=None)

source code 

Get directory location of '.ros' directory (aka ROS home). possible locations for this. The ROS_LOG_DIR environment variable has priority. If that is not set, then ROS_HOME/log is used. If ROS_HOME is not set, $HOME/.ros/log is used.

Parameters:
  • env (dict) - override os.environ dictionary
Returns: str
path to use use for log file directory

get_log_dir(env=None)

source code 

Get directory to use for writing log files. There are multiple possible locations for this. The ROS_LOG_DIR environment variable has priority. If that is not set, then ROS_HOME/log is used. If ROS_HOME is not set, $HOME/.ros/log is used.

Parameters:
  • env (dict) - override os.environ dictionary
Returns: str
path to use use for log file directory

get_test_results_dir(env=None)

source code 

Get directory to use for writing test result files. There are multiple possible locations for this. If ROS_HOME is set ROS_HOME/test_results is used. Otherwise $HOME/.ros/test_results is used.

Parameters:
  • env (dict) - environment dictionary (defaults to os.environ)
Returns: str
path to use use for log file directory

makedirs_with_parent_perms(p)

source code 

Create the directory using the permissions of the nearest (existing) parent directory. This is useful for logging, where a root process sometimes has to log in the user's space.

Parameters:
  • p (str) - directory to create