Functions
hrl_lib::util Namespace Reference

Functions

def _choose_without_replacement
def approx_equal
def bound
 Bound the value of a number to be above lower, and lower than upper.
def cart_of_pol
def cartesian_product
 cartesian product of list of lists.
def choose_without_replacement
 choose n elements from list without replacement.
def formatted_time
 returns current time as a string: year|month|date_hours|min|sec.
def get_bash_command_output
 execute a bash command and get its output as a list of strings.
def get_keystroke
 raw_input + matplotlib + ROS == strangeness.
def getTime
 Returns a string that can be used as a timestamp (hours and minutes) in logfiles.
def list_mat_to_mat
 Converts a list of numpy matrices to one large matrix.
def load_pickle
 read a pickle and return the object.
def matrixrank
 compute rank of a matrix.
def norm
 Calculate L2 norm for column vectors in a matrix.
def pol_of_cart
def quat_angle
def save_pickle
 Pickle an object.
def say
 use festival text to speech to make a soud.
def standard_rad
def unipolar_limit
def unwrap_np_array
 convert hrl's ros wrapped numpy array to a numpy array
def weighted_avg_and_std
 Returns the weighted average and standard deviation.
def wrap_np_array
 wraps a numpy array into hrl's datatype for sending np arrays over ros.

Function Documentation

def hrl_lib.util._choose_without_replacement (   lists,
  previous_elements = [],
  ignore_count = 0 
) [private]

Definition at line 174 of file util.py.

def hrl_lib.util.approx_equal (   a,
  b,
  epsilon = .001 
)

Definition at line 83 of file util.py.

def hrl_lib.util.bound (   value,
  lower,
  upper 
)

Bound the value of a number to be above lower, and lower than upper.

Returns:
a number

Definition at line 115 of file util.py.

Finds cartesian coordinates of polar points [r, t]' 

Definition at line 98 of file util.py.

def hrl_lib.util.cartesian_product (   lists,
  previous_elements = [] 
)

cartesian product of list of lists.

code copied from: http://automatthias.wordpress.com/2007/04/28/cartesian-product-of-multiple-sets/

Returns:
generator. can loop over it, or list(generator) will give the entire list. NOTE - itertools in python 2.6 provides this functionality. We should switch over to it soon.

Definition at line 158 of file util.py.

def hrl_lib.util.choose_without_replacement (   list,
  n 
)

choose n elements from list without replacement.

adapted code from cartesian_product

Returns:
generator.

Definition at line 170 of file util.py.

returns current time as a string: year|month|date_hours|min|sec.

Returns:
current time as a string: year|month|date_hours|min|sec.

Definition at line 44 of file util.py.

execute a bash command and get its output as a list of strings.

e.g get_bash_command_output('ls -t')

Definition at line 212 of file util.py.

raw_input + matplotlib + ROS == strangeness.

use this function instead.

Definition at line 200 of file util.py.

Returns a string that can be used as a timestamp (hours and minutes) in logfiles.

Returns:
timestamp-string

Definition at line 13 of file util.py.

def hrl_lib.util.list_mat_to_mat (   list_mat,
  axis = 0 
)

Converts a list of numpy matrices to one large matrix.

Parameters:
list_matthe list of little matrices
axisaxis to concatenate little matrices
Returns:
one large numpy matrix

Definition at line 38 of file util.py.

def hrl_lib.util.load_pickle (   filename)

read a pickle and return the object.

Parameters:
filename- name of the pkl
Returns:
- object that had been pickled.

Definition at line 53 of file util.py.

def hrl_lib.util.matrixrank (   A,
  tol = 1e-8 
)

compute rank of a matrix.

code copied from: http://mail.scipy.org/pipermail/numpy-discussion/2008-February/031218.html

Definition at line 193 of file util.py.

def hrl_lib.util.norm (   mat)

Calculate L2 norm for column vectors in a matrix.

Parameters:
mat- numpy matrix

Definition at line 80 of file util.py.

Find polar coordinates of cartesian points [x, y]' 

Definition at line 106 of file util.py.

def hrl_lib.util.quat_angle (   quat1,
  quat2 
)

Definition at line 18 of file util.py.

def hrl_lib.util.save_pickle (   object,
  filename 
)

Pickle an object.

Parameters:
object- object to be pickled
filename- name of the pkl file

Definition at line 73 of file util.py.

def hrl_lib.util.say (   text)

use festival text to speech to make a soud.

Parameters:
text- string to be said.

Definition at line 186 of file util.py.

Definition at line 27 of file util.py.

def hrl_lib.util.unipolar_limit (   x,
  upper 
)
limit the value of x such that
    0 <= x <= upper

Definition at line 86 of file util.py.

def hrl_lib.util.unwrap_np_array (   nparr_ros)

convert hrl's ros wrapped numpy array to a numpy array

Parameters:
NumpyArrayobject (hrl_lib/msg/NumpyArray.msg)
Returns:
np array

Definition at line 145 of file util.py.

def hrl_lib.util.weighted_avg_and_std (   values,
  weights,
  unbiased 
)

Returns the weighted average and standard deviation.

http://stackoverflow.com/questions/2413522/weighted-standard-deviation-in-numpy values - n x m np MATRIX weights - 1D np arrays of length n returns - two 1D np arrays

Definition at line 224 of file util.py.

def hrl_lib.util.wrap_np_array (   nparr)

wraps a numpy array into hrl's datatype for sending np arrays over ros.

Parameters:
nparray
Returns:
NumpyArray object (hrl_lib/msg/NumpyArray.msg)

Definition at line 135 of file util.py.



hrl_lib
Author(s): Cressel Anderson, Travis Deyle, Advait Jain, Hai Nguyen, Advisor: Prof. Charlie Kemp, Lab: Healthcare Robotics Lab at Georgia Tech
autogenerated on Wed Nov 27 2013 11:34:06