Classes | Functions | Variables
mechanism_analyse Namespace Reference

Classes

class  pca_plot_gui

Functions

def bin
 take max force magnitude within a bin size
def clean_data_forces
 remove pkls in which the forces are unreasonable large or small
def compare_tangential_total_magnitude
 plot errorbars showing 1 sigma for tangential component of the force and the total magnitude of the force.
def compute_average_velocity
 compute the average velocity = total angle / total time.
def compute_trajectory_velocity
 mech_x must be in RADIANS.
def compute_velocity
 returns the median of the velocity.
def correlate_trials
 l list of trials with which to correlate c1 trial is a list of forces (each element is the max force or some other representative value for a given angle) lab_list - list of labels
def different_classes_rotary
 one of the figures for the paper.
def dimen_reduction_mechanisms
def distance_of_handle_from_edges
def errorbar_one_mechanism
def errorbar_one_mechanism_max
def extract_pkls
 get all the information from all the pkls in one directory.
def filter_dir_list
def get_mech_name
 get mechanism name from the directory name.
def handle_height_histogram
def input_mechanism_list
 list all the mechanisms in dir_list and allow user to type the numbers of the desired mechanisms.
def make_vector
def make_vector_mechanism
def max_force_hist
 makes a scatter plot with the radius along the x axis and the max force along the y-axis.
def max_force_radius_scatter
 makes a scatter plot with the radius along the x axis and the max force along the y-axis.
def max_force_vs_velocity
def mechanism_radius_histogram
def plot_handle_height
def plot_handle_height_no_fridge_no_freezer
def plot_handle_height_no_office
def plot_opening_distances_drawers
def plot_tangential_force
def plot_velocity
def radial_tangential_ratio

Variables

tuple aarr = np.matrix(np.array(acc)[idxs])
list aarr_l = []
list acc_arr = states[2,:]
tuple bar1 = mechanism_radius_histogram(filter_dir_list(dir_list, name=None))
tuple bar2 = mechanism_radius_histogram(l1+l2, color='y')
tuple ch_list = input_mechanism_list(dir_list)
list cl = []
tuple d = extract_pkls(dir, True)
tuple d_list = input_mechanism_list(dir_list)
string dest = 'max_force_hist'
tuple di = extract_pkls(d, open)
tuple dir
tuple dir_list = commands.getoutput('ls -d %s/*/'%(opt.dir))
tuple door_smd = mfd.DoorMassDamper(radius)
 farr = forces.A1
tuple forces = np.matrix(d['ftan_l_l'][i])
list forces_l = []
list frad_l_l = di['frad_l_l']
list ftan_l_l = di['ftan_l_l']
string help = 'count the number of trajectories for each mechanism'
tuple idxs = np.where(np.logical_and(xarr > math.radians(1), xarr < math.radians(15)))
tuple l = glob.glob(d+'/*'+trial+'*mechanism_trajectories*.pkl')
tuple l1 = filter_dir_list(dir_list, name='ree')
tuple l2 = filter_dir_list(dir_list, name='ge')
list lab_list = []
list labels = ['Other', 'Freezers and Refrigerators']
tuple mass = np.mean(np.divide(farr, acc_arr))
list mech = t[-1]
list mech_list = []
list mech_name_list = []
list mech_nm = mech_list[i]
list mechx_l = d['mechx_l_l']
list mechx_l_l = di['mechx_l_l']
string nm = '_'
tuple ones = np.ones(xarr.shape[1])
tuple p = optparse.OptionParser()
tuple pkl_list = commands.getoutput('ls %s/*.pkl'%(opt.dir))
string plot_title = 'Freezers'
tuple predicted_forces = door_smd.predict(states_l[i][[1,2],:])
list predicted_forces_mass = mass*states_l[i]
list rad = di['rad']
list radius = d['rad']
tuple states = np.column_stack(states_l)
list states_l = []
tuple t = m.split('/')
list time_l_l = di['time_l_l']
list time_list = d['time_l_l']
tuple traj_vel = compute_trajectory_velocity(mechx_l_l[j],time_l_l[j],1)
list traj_vel_l = []
list trial_num_list = d['trial_num_l']
list typ = di['typ']
string type = 'string'
tuple varr = np.matrix(np.array(vel)[idxs])
list varr_l = []
int window_len = 15
tuple xarr = np.array(mechx_l)
list xarr_l = []

Function Documentation

def mechanism_analyse.bin (   poses_list,
  ftan_list,
  bin_size,
  fn,
  ignore_empty,
  max_pose = None,
  empty_value = None 
)

take max force magnitude within a bin size

Parameters:
bin_size- depends on the units of poses_list
fn- function to apply to the binned force values (e.g. max, min)
ignore_empty- if True then empty bins are ignored. Else the value of an empty bin is set to None.
max_pose- maximum value of pose to use if None then derived from poses_list
empty_value- what to fill in an empty bin (None, np.nan etc.)

Definition at line 395 of file mechanism_analyse.py.

remove pkls in which the forces are unreasonable large or small

Definition at line 88 of file mechanism_analyse.py.

plot errorbars showing 1 sigma for tangential component of the force and the total magnitude of the force.

(Trying to verify that what we are capturing using our setup is consistent across people)

Definition at line 837 of file mechanism_analyse.py.

def mechanism_analyse.compute_average_velocity (   mech_x,
  time_list,
  max_angle,
  type 
)

compute the average velocity = total angle / total time.

Definition at line 747 of file mechanism_analyse.py.

def mechanism_analyse.compute_trajectory_velocity (   mech_x,
  time_list,
  smooth_window 
)

mech_x must be in RADIANS.

Definition at line 739 of file mechanism_analyse.py.

def mechanism_analyse.compute_velocity (   mech_x,
  time_list,
  smooth_window 
)

returns the median of the velocity.

Definition at line 729 of file mechanism_analyse.py.

def mechanism_analyse.correlate_trials (   c1,
  l,
  lab_list 
)

l list of trials with which to correlate c1 trial is a list of forces (each element is the max force or some other representative value for a given angle) lab_list - list of labels

Definition at line 809 of file mechanism_analyse.py.

one of the figures for the paper.

showing that different classes have different clusters.

Definition at line 1015 of file mechanism_analyse.py.

def mechanism_analyse.dimen_reduction_mechanisms (   dir_list,
  dimen = 2 
)

Definition at line 1239 of file mechanism_analyse.py.

Definition at line 704 of file mechanism_analyse.py.

def mechanism_analyse.errorbar_one_mechanism (   dir_name,
  open = True,
  new_figure = True,
  filter_speed = math.radians(100),
  plot_type = 'tangential',
  color = None,
  label = None 
)

Definition at line 456 of file mechanism_analyse.py.

def mechanism_analyse.errorbar_one_mechanism_max (   dir_name,
  open = True,
  filter_speed = math.radians(100.) 
)

Definition at line 557 of file mechanism_analyse.py.

def mechanism_analyse.extract_pkls (   d,
  open = True,
  quiet = False,
  ignore_moment_list = False 
)

get all the information from all the pkls in one directory.

ASSUMES - all pkls are of the same mechanism (same radius, type ...)

Parameters:
open- extract info for opening trials

Definition at line 319 of file mechanism_analyse.py.

def mechanism_analyse.filter_dir_list (   dir_list,
  typ = 'rotary',
  name = None 
)

Definition at line 1308 of file mechanism_analyse.py.

get mechanism name from the directory name.

Definition at line 308 of file mechanism_analyse.py.

def mechanism_analyse.handle_height_histogram (   dir_name_list,
  plot_title = '' 
)

Definition at line 646 of file mechanism_analyse.py.

list all the mechanisms in dir_list and allow user to type the numbers of the desired mechanisms.

Returns:
list of paths to the selected mechanisms.

Definition at line 67 of file mechanism_analyse.py.

def mechanism_analyse.make_vector (   mechx,
  ftan_l,
  lim,
  bin_size 
)

Definition at line 919 of file mechanism_analyse.py.

def mechanism_analyse.make_vector_mechanism (   dir,
  use_moment = False 
)

Definition at line 941 of file mechanism_analyse.py.

def mechanism_analyse.max_force_hist (   dir_name_list,
  open = True,
  type = '' 
)

makes a scatter plot with the radius along the x axis and the max force along the y-axis.

different color for each mechanism

Parameters:
dir_name- directory containing the pkls.

Definition at line 1109 of file mechanism_analyse.py.

def mechanism_analyse.max_force_radius_scatter (   dir_name_list,
  open = True 
)

makes a scatter plot with the radius along the x axis and the max force along the y-axis.

different color for each mechanism

Parameters:
dir_name- directory containing the pkls.

Definition at line 425 of file mechanism_analyse.py.

Definition at line 851 of file mechanism_analyse.py.

def mechanism_analyse.mechanism_radius_histogram (   dir_list,
  color = 'b' 
)

Definition at line 891 of file mechanism_analyse.py.

def mechanism_analyse.plot_handle_height (   dir_name_list,
  plot_title 
)

Definition at line 669 of file mechanism_analyse.py.

Definition at line 717 of file mechanism_analyse.py.

Definition at line 707 of file mechanism_analyse.py.

Definition at line 626 of file mechanism_analyse.py.

def mechanism_analyse.plot_tangential_force (   dir_name,
  all_trials,
  open = True,
  filter_speed = math.radians(100) 
)
Parameters:
dir_name- directory containing the pkls.
all_trials- plot force for all the trials.
open- Boolean (open or close trial)
filter_speed- mech vel above this will be ignored. for ROTARY joints only, radians/sec

Definition at line 143 of file mechanism_analyse.py.

def mechanism_analyse.plot_velocity (   dir_name)

Definition at line 776 of file mechanism_analyse.py.

Definition at line 289 of file mechanism_analyse.py.


Variable Documentation

Definition at line 1546 of file mechanism_analyse.py.

Definition at line 1516 of file mechanism_analyse.py.

Definition at line 1561 of file mechanism_analyse.py.

Definition at line 1448 of file mechanism_analyse.py.

Definition at line 1449 of file mechanism_analyse.py.

Definition at line 1468 of file mechanism_analyse.py.

Definition at line 1466 of file mechanism_analyse.py.

Definition at line 1511 of file mechanism_analyse.py.

Definition at line 1596 of file mechanism_analyse.py.

Definition at line 1351 of file mechanism_analyse.py.

Definition at line 1471 of file mechanism_analyse.py.

Initial value:
00001 filter_dir_list(dir_list,
00002                 name='patient_room_door')

Definition at line 1509 of file mechanism_analyse.py.

tuple mechanism_analyse::dir_list = commands.getoutput('ls -d %s/*/'%(opt.dir))

Definition at line 1377 of file mechanism_analyse.py.

tuple mechanism_analyse::door_smd = mfd.DoorMassDamper(radius)

Definition at line 1555 of file mechanism_analyse.py.

Definition at line 1562 of file mechanism_analyse.py.

Definition at line 1526 of file mechanism_analyse.py.

Definition at line 1517 of file mechanism_analyse.py.

Definition at line 1473 of file mechanism_analyse.py.

Definition at line 1472 of file mechanism_analyse.py.

string mechanism_analyse::help = 'count the number of trajectories for each mechanism'

Definition at line 1344 of file mechanism_analyse.py.

tuple mechanism_analyse::idxs = np.where(np.logical_and(xarr > math.radians(1), xarr < math.radians(15)))

Definition at line 1531 of file mechanism_analyse.py.

tuple mechanism_analyse::l = glob.glob(d+'/*'+trial+'*mechanism_trajectories*.pkl')

Definition at line 1429 of file mechanism_analyse.py.

Definition at line 1445 of file mechanism_analyse.py.

Definition at line 1446 of file mechanism_analyse.py.

Definition at line 1467 of file mechanism_analyse.py.

list mechanism_analyse::labels = ['Other', 'Freezers and Refrigerators']

Definition at line 1450 of file mechanism_analyse.py.

Definition at line 1566 of file mechanism_analyse.py.

Definition at line 1418 of file mechanism_analyse.py.

Definition at line 1415 of file mechanism_analyse.py.

Definition at line 1401 of file mechanism_analyse.py.

Definition at line 1425 of file mechanism_analyse.py.

Definition at line 1524 of file mechanism_analyse.py.

Definition at line 1474 of file mechanism_analyse.py.

Definition at line 1403 of file mechanism_analyse.py.

tuple mechanism_analyse::ones = np.ones(xarr.shape[1])

Definition at line 1556 of file mechanism_analyse.py.

tuple mechanism_analyse::p = optparse.OptionParser()

Definition at line 1340 of file mechanism_analyse.py.

tuple mechanism_analyse::pkl_list = commands.getoutput('ls %s/*.pkl'%(opt.dir))

Definition at line 1400 of file mechanism_analyse.py.

string mechanism_analyse::plot_title = 'Freezers'

Definition at line 1463 of file mechanism_analyse.py.

Definition at line 1577 of file mechanism_analyse.py.

Definition at line 1578 of file mechanism_analyse.py.

Definition at line 1477 of file mechanism_analyse.py.

Definition at line 1527 of file mechanism_analyse.py.

tuple mechanism_analyse::states = np.column_stack(states_l)

Definition at line 1559 of file mechanism_analyse.py.

Definition at line 1513 of file mechanism_analyse.py.

Definition at line 1417 of file mechanism_analyse.py.

Definition at line 1475 of file mechanism_analyse.py.

Definition at line 1525 of file mechanism_analyse.py.

Definition at line 1481 of file mechanism_analyse.py.

Definition at line 1599 of file mechanism_analyse.py.

Definition at line 1512 of file mechanism_analyse.py.

Definition at line 1476 of file mechanism_analyse.py.

string mechanism_analyse::type = 'string'

Definition at line 1342 of file mechanism_analyse.py.

Definition at line 1545 of file mechanism_analyse.py.

Definition at line 1515 of file mechanism_analyse.py.

Definition at line 1528 of file mechanism_analyse.py.

Definition at line 1530 of file mechanism_analyse.py.

Definition at line 1514 of file mechanism_analyse.py.



2010_biorob_everyday_mechanics
Author(s): Advait Jain, Hai Nguyen, Charles C. Kemp (Healthcare Robotics Lab, Georgia Tech)
autogenerated on Wed Nov 27 2013 11:58:43