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

Module stacks

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
  ROSStackException
  InvalidROSStackException
Functions
str
stack_of(pkg, env=None)
Returns: name of stack that pkg is in, or None if pkg is not part of a stack
source code
str
get_stack_dir(stack, env=None)
Get the directory of a ROS stack.
source code
[str]
list_stacks(env=None)
Get list of all ROS stacks.
source code
[str]
list_stacks_by_path(path, stacks=None, cache=None)
List ROS stacks within the specified path.
source code
([str], [str])
expand_to_packages(names, env=None)
Expand names into a list of packages.
source code
str
get_stack_version(stack, env=None)
Returns: version number of stack, or None if stack is unversioned.
source code
str
get_stack_version_by_dir(stack_dir)
Get stack version where stack_dir points to root directory of stack.
source code
Variables
  ROS_ROOT = 'ROS_ROOT'
  ROS_PACKAGE_PATH = 'ROS_PACKAGE_PATH'
  STACK_FILE = 'stack.xml'
  ROS_STACK = 'ros'
  __package__ = 'roslib'
Function Details

stack_of(pkg, env=None)

source code 
Parameters:
  • env ({str: str}) - override environment variables
Returns: str
name of stack that pkg is in, or None if pkg is not part of a stack
Raises:

get_stack_dir(stack, env=None)

source code 

Get the directory of a ROS stack. This will initialize an internal cache and return cached results if possible.

This routine is not thread-safe to os.environ changes.

Parameters:
  • env ({str: str}) - override environment variables
  • stack (str) - name of ROS stack to locate on disk
Returns: str
directory of stack.
Raises:

list_stacks(env=None)

source code 

Get list of all ROS stacks. This uses an internal cache.

This routine is not thread-safe to os.environ changes.

Parameters:
  • env ({str: str}) - override environment variables
Returns: [str]
complete list of stacks names in ROS environment

list_stacks_by_path(path, stacks=None, cache=None)

source code 

List ROS stacks within the specified path.

Optionally, a cache dictionary can be provided, which will be updated with the stack->path mappings. list_stacks_by_path() does NOT returned cached results -- it only updates the cache.

Parameters:
  • path (str) - path to list stacks in
  • stacks ([str]) - list of stacks to append to. If stack is already present in stacks, it will be ignored.
  • cache ({str: str}) - (optional) stack path cache to update. Maps stack name to directory path.
Returns: [str]
complete list of stack names in ROS environment. Same as stacks parameter.

expand_to_packages(names, env=None)

source code 

Expand names into a list of packages. Names can either be of packages or stacks.

Parameters:
  • names ([str]) - names of stacks or packages
Returns: ([str], [str])
([packages], [not_found]). expand_packages() returns two lists. The first is of packages names. The second is a list of names for which no matching stack or package was found. Lists may have duplicates.

get_stack_version(stack, env=None)

source code 
Parameters:
  • env ({str: str}) - override environment variables
Returns: str
version number of stack, or None if stack is unversioned.

get_stack_version_by_dir(stack_dir)

source code 

Get stack version where stack_dir points to root directory of stack.

Parameters:
  • env ({str: str}) - override environment variables
Returns: str
version number of stack, or None if stack is unversioned.