pattern_manager package

Submodules

pattern_manager.plugin module

class pattern_manager.plugin.Plugin

Bases: object

This class is the base class for plugins

process()

This method is implemented in each Plugin subclass

class pattern_manager.plugin.PluginLoader(package)

Bases: object

This class is responsible for loading plugins from a specified package

Parameters:package (str) – The name of the package to load plugins from
load_plugins()

This function walks a package’s modules to find and load plugins

pattern_manager.util module

pattern_manager.util.broadcast_transforms(br, xfs)

This function is responsible for broadcasting the XForms translation and rotation via tf

Parameters:
  • br (tf.TransformBroadcaster) – The transform broadcaster
  • xfs (list) – A list of XForms to broadcast
pattern_manager.util.handle_input_1d(number_of_points=0, step_size=0, line_length=0)

Generates 1D spatial information from 3 inputs.

If any pair of inputs is specified, caluclates the third corresponding parameter. If 3 or a single input is specified, throws an error.

Parameters:
  • number_of_points (float, optional) – Number of points along the 1D axis, defaults to 0
  • step_size (float, optional) – Step size between points on the axis, defaults to 0
  • line_length (float, optional) – Length of the axis, between first and last point, defaults to 0
Returns:

3-tuple of number of points, step size between points, and distance from first to last point.

Return type:

tuple

pattern_manager.util.is_zero_element(rot)
pattern_manager.util.matrix_to_tf(matrix)

Convert a 3x4 numpy transformation matrix to a geometry_msgs.Transform.

Parameters:matrix (numpy.ndarray) – 3x4 Transformation matrix to convert
Returns:Converted Transform
Return type:geometry_msgs.Transform
pattern_manager.util.publish_markers(pub, xfs, root)

This function is responsible for publishing markers for each XForm

Parameters:
  • pub (rospy.Publisher) – The ROS publisher object which publishes each marker in a marker array
  • xfs (list) – A list of XForms to create markers for

pattern_manager.xform module

class pattern_manager.xform.XForm(parent, name, ref_frame=None)

Bases: geometry_msgs.msg._Transform.Transform

This class describes a tree of transforms and each nodes relation to other nodes

Parameters:
  • parent (XForm, None) – The parent XForm of this XForm object
  • name (str) – The name of this XForm
  • ref_frame (str, optional) – The name of the reference frame of the XForm
add_node(chld)

This function adds a child to the XForm and assigns itself as the childs parent

Parameters:chld (XForm) – The child object to be added
clear()

This function resets the tree from this node, effectively removin all descendant nodes

count = 0

The number of XForms created

from_dict(dict_, root=None)

This function creates a XForm tree from a dictionary object

Parameters:
  • dict (dict) – The dictionary to create the XForm tree from
  • root (XForm) – The current root XForm of the tree
get_active_nodes(root=None)

This function retrieves all nodes which are set active

Parameters:root (XForm, optional) – The XForm to begin the tree-search from
Returns:Returns all XForms which are currently set to active within the tree
Return type:list
get_current_node(root=None)

This function retrieves the currently first active XForm in the tree

Returns:Returns the first active XForm in the tree
Return type:XForm
get_node(id_, root=None)

This function returns an XForm if one matches the ID

Parameters:
  • id (int) – The ID of the XForm object to be retrieved
  • root (XForm, optional) – The XForm to begin the tree-search from
Returns:

Returns the requested XForm if there is a match, else None

Return type:

XForm

get_nodes(root=None)

This function retrieves all XForm objects of the tree

Parameters:root (XForm, optional) – The XForm to begin the tree-search from
Returns:Returns all XForms within the tree
Return type:list
iterate()

This function iterates the list of active XForms, setting the current XForm inactive

Returns:True if successful, else False
Return type:bool
recursive_remove_node(id_, root=None)

This function initiates the removal of an XForm (tree-node) and all of its descendants

Parameters:id (int) – The ID of the XForm to begin the recursive removal from
set_active(actv)

This function sets the XForm and all of its descendants active/inactive

Parameters:actv (bool) – This value determines whether to set the XForms active or inactive
to_dict(root=None, dict_=None)

This function creates a dictionary object from the XForm tree

Parameters:
  • root (XForm, optional) – The XForm to begin the dictionary from
  • dict (dict, optional) – The dictionary object to populate
Returns:

Returns a dictionary of the XForm tree

Return type:

dict

Module contents