Package controller_manager_msgs :: Module utils
[frames] | no frames]

Module utils

source code

Classes
  ControllerLister
Convenience functor for querying loaded controller data.
  ControllerManagerLister
Convenience functor for querying the list of active controller managers.
Functions
[controller_manager_msgs/ControllerState]
filter_by_hardware_interface(ctrl_list, hardware_interface, match_substring=False)
Filter controller state list by controller hardware interface.
source code
[controller_manager_msgs/ControllerState]
filter_by_name(ctrl_list, ctrl_name, match_substring=False)
Filter controller state list by controller name.
source code
[controller_manager_msgs/ControllerState]
filter_by_resources(ctrl_list, resources, hardware_interface=None, match_any=False)
Filter controller state list by claimed resources.
source code
[controller_manager_msgs/ControllerState]
filter_by_state(ctrl_list, ctrl_state, match_substring=False)
Filter controller state list by controller state.
source code
[controller_manager_msgs/ControllerState]
filter_by_type(ctrl_list, ctrl_type, match_substring=False)
Filter controller state list by controller type.
source code
[str]
get_controller_managers(namespace='/', initial_guess=None)
Get list of active controller manager namespaces.
source code
[str]
get_rosparam_controller_names(namespace='/')
Get list of ROS parameter names that potentially represent a controller configuration.
source code
bool
is_controller_manager(namespace)
Check if the input namespace exposes the controller_manager ROS interface.
source code
Variables
  __package__ = 'controller_manager_msgs'
  cm_services = {'list_controller_types': 'controller_manager_ms...
  python3 = False
Function Details

filter_by_hardware_interface(ctrl_list, hardware_interface, match_substring=False)

source code 

Filter controller state list by controller hardware interface.

Parameters:
  • ctrl_list ([controller_manager_msgs/ControllerState]) - Controller state list
  • hardware_interface (str) - Controller hardware interface
  • match_substring (bool) - Set to True to allow substring matching
Returns: [controller_manager_msgs/ControllerState]
Controllers matching the specified hardware interface

filter_by_name(ctrl_list, ctrl_name, match_substring=False)

source code 

Filter controller state list by controller name.

Parameters:
  • ctrl_list ([controller_manager_msgs/ControllerState]) - Controller state list
  • ctrl_name (str) - Controller name
  • match_substring (bool) - Set to True to allow substring matching
Returns: [controller_manager_msgs/ControllerState]
Controllers matching the specified name

filter_by_resources(ctrl_list, resources, hardware_interface=None, match_any=False)

source code 

Filter controller state list by claimed resources.

Parameters:
  • ctrl_list ([controller_manager_msgs/ControllerState]) - Controller state list
  • resources ([str] @param hardware_interface Controller hardware interface where to look for resources. If specified, the requested resources will only be searched for in this interface. If unspecified, all controller hardware interfaces will be searched for; i.e., if a controller claims resources from multiple interfaces, the method will succeed if _any_ interface contains the requested resources (any or all, depending on the value of match_any). Specifying this parameter allows finer control over determining which interfaces claim specific resources.) - Controller resources
  • match_any (bool) - If set to False, all elements in resources must be claimed by the interface specified in hardware_interface (or _any_ interface, if hardware_interface is unspecified) for a positive match. Note that a controller's resources can contain additional entries than those in resources). If set to True, at least one element in resources must be claimed by the interface specified in hardware_interface (or _any_ interface, if hardware_interface is unspecified) for a positive match.
Returns: [controller_manager_msgs/ControllerState]
Controllers matching the specified hardware interface

filter_by_state(ctrl_list, ctrl_state, match_substring=False)

source code 

Filter controller state list by controller state.

Parameters:
  • ctrl_list ([controller_manager_msgs/ControllerState]) - Controller state list
  • ctrl_state (str) - Controller state
  • match_substring (bool) - Set to True to allow substring matching
Returns: [controller_manager_msgs/ControllerState]
Controllers matching the specified state

filter_by_type(ctrl_list, ctrl_type, match_substring=False)

source code 

Filter controller state list by controller type.

Parameters:
  • ctrl_list ([controller_manager_msgs/ControllerState]) - Controller state list
  • ctrl_type (str) - Controller type
  • match_substring (bool) - Set to True to allow substring matching
Returns: [controller_manager_msgs/ControllerState]
Controllers matching the specified type

get_controller_managers(namespace='/', initial_guess=None)

source code 

Get list of active controller manager namespaces.

Parameters:
  • namespace (str) - Namespace where to look for controller managers.
  • initial_guess ([str]) - Initial guess of the active controller managers. Typically c{initial_guess} is the output of a previous call to this method, and is useful when periodically checking for changes in the list of active controller managers. Elements in this list will go through a lazy validity check (as opposed to a full name+type API verification), so providing a good estimate can significantly reduce the number of ROS master queries incurred by this method.
Returns: [str]
Sorted list of active controller manager namespaces.

get_rosparam_controller_names(namespace='/')

source code 

Get list of ROS parameter names that potentially represent a controller configuration.

Example usage:

  • Assume the following parameters exist in the ROS parameter: server:
    • /foo/type
    • /xxx/type/xxx
    • /ns/bar/type
    • /ns/yyy/type/yyy
  • The potential controllers found by this method are:
    >>> names    = get_rosparam_controller_names()      # returns ['foo']
    >>> names_ns = get_rosparam_controller_names('/ns') # returns ['bar']
Parameters:
  • namespace (str) - Namespace where to look for controllers.
Returns: [str]
Sorted list of ROS parameter names.

is_controller_manager(namespace)

source code 

Check if the input namespace exposes the controller_manager ROS interface.

This method has the overhead of several ROS master queries (one per ROS API member).

Parameters:
  • namespace (str) - Namespace to check
Returns: bool
True if namespace exposes the controller_manager ROS interface

Variables Details

cm_services

Value:
{'list_controller_types': 'controller_manager_msgs/ListControllerTypes\
',
 'list_controllers': 'controller_manager_msgs/ListControllers',
 'load_controller': 'controller_manager_msgs/LoadController',
 'reload_controller_libraries': 'controller_manager_msgs/ReloadControl\
lerLibraries',
 'switch_controller': 'controller_manager_msgs/SwitchController',
 'unload_controller': 'controller_manager_msgs/UnloadController'}