Functions | Variables
analyse_logs Namespace Reference

Functions

def angle_between_hooktip_mechanism_radial_vectors
def check_time_sync
 plot to ensure that the time stamps in the different logs are reasonable.
def compare_tip_mechanism_trajectories
 sanity check - fitting circle to mechanism and hook tip trajectories, computing the angle between the initial radial direction of the mechanism and the radial directions for the hook tip.
def compute_hook_tip_trajectory
def compute_mech_angle_1
 use method 1 to compute the mechanism angle from combined dict.
def compute_mech_angle_2
 use method 2 to compute the mechanism angle from combined dict.
def compute_mech_rot_list
def compute_mechanism_properties
def ft_to_camera
 transform forces to camera coord frame.
def ft_to_camera_3
 transform force to camera coord frame.
def fts_to_camera
 returns force and moment at the tip of the hook in camera coordinates.
def plot
def plot_forces
def plot_hooktip_trajectory_and_force
def plot_radial_tangential
def plot_trajectories
def project_points_plane
def split_forces_hooktip_test
def split_open_close
 take the open + close trajectory and split it into two separate trajectories and save them as pkls.
def synchronize

Variables

tuple ang = np.array(ang)
 bias_ft = True,tuptup,
tuple cd = ut.load_pickle(glob.glob(opt.dir + '/combined_log*.pkl')[0])
 cd_pkl_name = pkl_name)
string color = 'b'
tuple d = synchronize(ft_dict, mechanism_dict, hand_dict)
string dest = 'mech_prop_ros'
tuple end_idx = np.argmax(mech_angle_l)
tuple fig1 = mpu.figure()
tuple fmag = np.linalg.norm(f)
list force_mat = ft_mat[0:3, :]
tuple ft_dict = ut.load_pickle(ft_pkl)
tuple ft_mat = np.matrix(cd['ft_list'])
tuple ft_pkl = glob.glob(opt.dir + '/ft_log*.pkl')
list ft_time_list = ft_dict['time_list']
list hand_dict = poses_dict['hand']
tuple hand_mat = np.column_stack(hook_tip_l)
list hand_time_list = hand_dict['time_list']
string help = 'plot to check the consistency of time stamps'
list hook_rot_l = cd['hand_rot_list']
tuple hook_tip_l = compute_hook_tip_trajectory(cd)
list incr = ang[1:]
string lab1 = 'orientation only'
string lab2 = 'checker origin position + circle fit'
string lab3 = 'checker origin position + PCA projection + circle fit'
int label = 1
int linewidth = 1
tuple ma1 = compute_mech_angle_1(cd)
tuple ma2 = compute_mech_angle_2(cd, tup, project_plane=False)
tuple ma3 = compute_mech_angle_2(cd, tup, project_plane=True)
tuple mag = abs(incr[i] - incr[i+1])
tuple max_idx = np.argmax(ang)
tuple md = ut.load_pickle(mech_pkl_name)
tuple mech_angle_l = compute_mech_angle_2(cd, tup, project_plane=False)
tuple mech_mat = np.column_stack(cd['mech_pos_list'])
tuple mech_pkl_name = glob.glob(opt.dir + '/open_mechanism_trajectories_*.pkl')
list mechanism_dict = poses_dict['mechanism']
list mechanism_time_list = mechanism_dict['time_list']
tuple moment_axis = np.array(moment_axis[:max_idx+1])
list moment_mat = ft_mat[3:6, :]
tuple moment_tip = np.array(moment_tip[:max_idx+1])
list n_pts = ang.shape[0]
tuple p = optparse.OptionParser()
tuple pkl_name = glob.glob(opt.dir + '/combined_log*.pkl')
tuple poses_dict = ut.load_pickle(poses_pkl)
tuple poses_pkl = glob.glob(opt.dir + '/poses_dict*.pkl')
tuple rad = np.array(rad[:max_idx+1])
list sgn = incr[i]
tuple tan = np.array(tan[:max_idx+1])
tuple tup = ke.init_ros_node()
string type = 'string'
tuple vel1 = ma.compute_velocity(ma1, cd['time_list'], 1)
tuple vel2 = ma.compute_velocity(ma2, cd['time_list'], 1)
tuple vel3 = ma.compute_velocity(ma3, cd['time_list'], 1)

Function Documentation

Definition at line 666 of file analyse_logs.py.

def analyse_logs.check_time_sync (   ft_time_list,
  mechanism_time_list,
  hand_time_list 
)

plot to ensure that the time stamps in the different logs are reasonable.

TODO - check for the rates too.

Definition at line 21 of file analyse_logs.py.

def analyse_logs.compare_tip_mechanism_trajectories (   mech_mat,
  hand_mat 
)

sanity check - fitting circle to mechanism and hook tip trajectories, computing the angle between the initial radial direction of the mechanism and the radial directions for the hook tip.

This angle starts out at a slightly positive angle. I'm assuming that this corresponds to the fact that the handle sticks out from the cabinet door. What makes me nervous is that I am still fitting two different circles to the mechanism and hook trajectories.

Definition at line 617 of file analyse_logs.py.

Returns:
list of hook tip coodinates in camera coordinate frame.

Definition at line 527 of file analyse_logs.py.

def analyse_logs.compute_mech_angle_1 (   cd,
  axis_direc = None 
)

use method 1 to compute the mechanism angle from combined dict.

method 1 - angle between the x axis of checkerboard coord frame.

Returns:
list of mechanism angles.

Definition at line 232 of file analyse_logs.py.

def analyse_logs.compute_mech_angle_2 (   cd,
  tup,
  project_plane = False 
)

use method 2 to compute the mechanism angle from combined dict.

method 2 - fit a circle to estimate location of axis of rotation and radius. Then use that to compute the angle of the mechanism.

Returns:
list of mechanism angles.

Definition at line 248 of file analyse_logs.py.

def analyse_logs.compute_mech_rot_list (   cd,
  tup,
  project_plane = False 
)

Definition at line 267 of file analyse_logs.py.

def analyse_logs.compute_mechanism_properties (   combined_dict,
  bias_ft = False,
  tup = None,
  cd_pkl_name = None 
)
Parameters:
tup- if None then use method 1 else use method 2 to compute mech angle.
Returns:
1d array (radial force), 1d array (tangential force), list of mechanism angles, type ('rotary' or 'prismatic')

Definition at line 311 of file analyse_logs.py.

def analyse_logs.ft_to_camera (   force_tool,
  hand_rot_matrix,
  hand_pos_matrix,
  mech_pos_matrix,
  number 
)

transform forces to camera coord frame.

Parameters:
hand_rot_matrix- rotation matrix for camera to hand checker.
hand_pos_matrix- position of hand checkerboard in camera coord frame.
mech_pos_matrix- position of mechanism checkerboard in camera coord frame.
number- checkerboard number (1, 2, 3 or 4)

Definition at line 137 of file analyse_logs.py.

def analyse_logs.ft_to_camera_3 (   force_tool,
  moment_tool,
  hand_rot_matrix,
  number,
  return_moment_cam = False 
)

transform force to camera coord frame.

Definition at line 160 of file analyse_logs.py.

def analyse_logs.fts_to_camera (   combined_dict)

returns force and moment at the tip of the hook in camera coordinates.

Definition at line 445 of file analyse_logs.py.

def analyse_logs.plot (   combined_dict,
  savefig 
)

Definition at line 188 of file analyse_logs.py.

def analyse_logs.plot_forces (   combined_dict)

Definition at line 469 of file analyse_logs.py.

Definition at line 591 of file analyse_logs.py.

def analyse_logs.plot_radial_tangential (   mech_dict,
  savefig,
  fig_name = '' 
)

Definition at line 405 of file analyse_logs.py.

def analyse_logs.plot_trajectories (   combined_dict)

Definition at line 485 of file analyse_logs.py.

Parameters:
pts- 3xN np matrix

Definition at line 211 of file analyse_logs.py.

Definition at line 690 of file analyse_logs.py.

def analyse_logs.split_open_close (   rad,
  tan,
  ang,
  typ,
  mech_radius,
  time_list,
  moment_axis,
  moment_tip 
)

take the open + close trajectory and split it into two separate trajectories and save them as pkls.

Definition at line 547 of file analyse_logs.py.

def analyse_logs.synchronize (   ft_dict,
  mechanism_dict,
  hand_dict 
)
Returns:
single dict with ft_list, mech_pose_lists, hand_pose_lists and ONE time_list

Definition at line 39 of file analyse_logs.py.


Variable Documentation

Definition at line 910 of file analyse_logs.py.

Definition at line 893 of file analyse_logs.py.

tuple analyse_logs::cd = ut.load_pickle(glob.glob(opt.dir + '/combined_log*.pkl')[0])

Definition at line 833 of file analyse_logs.py.

Definition at line 894 of file analyse_logs.py.

string analyse_logs::color = 'b'

Definition at line 939 of file analyse_logs.py.

Definition at line 826 of file analyse_logs.py.

string analyse_logs::dest = 'mech_prop_ros'

Definition at line 782 of file analyse_logs.py.

tuple analyse_logs::end_idx = np.argmax(mech_angle_l)

Definition at line 977 of file analyse_logs.py.

Definition at line 937 of file analyse_logs.py.

Definition at line 971 of file analyse_logs.py.

Definition at line 964 of file analyse_logs.py.

Definition at line 807 of file analyse_logs.py.

tuple analyse_logs::ft_mat = np.matrix(cd['ft_list'])

Definition at line 963 of file analyse_logs.py.

tuple analyse_logs::ft_pkl = glob.glob(opt.dir + '/ft_log*.pkl')

Definition at line 804 of file analyse_logs.py.

Definition at line 813 of file analyse_logs.py.

Definition at line 810 of file analyse_logs.py.

Definition at line 961 of file analyse_logs.py.

Definition at line 815 of file analyse_logs.py.

string analyse_logs::help = 'plot to check the consistency of time stamps'

Definition at line 770 of file analyse_logs.py.

list analyse_logs::hook_rot_l = cd['hand_rot_list']

Definition at line 958 of file analyse_logs.py.

Definition at line 957 of file analyse_logs.py.

Definition at line 911 of file analyse_logs.py.

string analyse_logs::lab1 = 'orientation only'

Definition at line 849 of file analyse_logs.py.

string analyse_logs::lab2 = 'checker origin position + circle fit'

Definition at line 850 of file analyse_logs.py.

string analyse_logs::lab3 = 'checker origin position + PCA projection + circle fit'

Definition at line 851 of file analyse_logs.py.

Definition at line 868 of file analyse_logs.py.

Definition at line 856 of file analyse_logs.py.

Definition at line 844 of file analyse_logs.py.

Definition at line 843 of file analyse_logs.py.

tuple analyse_logs::ma3 = compute_mech_angle_2(cd, tup, project_plane=True)

Definition at line 845 of file analyse_logs.py.

tuple analyse_logs::mag = abs(incr[i] - incr[i+1])

Definition at line 917 of file analyse_logs.py.

tuple analyse_logs::max_idx = np.argmax(ang)

Definition at line 930 of file analyse_logs.py.

Definition at line 798 of file analyse_logs.py.

Definition at line 976 of file analyse_logs.py.

list analyse_logs::mech_mat = np.column_stack(cd['mech_pos_list'])

Definition at line 960 of file analyse_logs.py.

tuple analyse_logs::mech_pkl_name = glob.glob(opt.dir + '/open_mechanism_trajectories_*.pkl')

Definition at line 797 of file analyse_logs.py.

Definition at line 809 of file analyse_logs.py.

Definition at line 814 of file analyse_logs.py.

Definition at line 934 of file analyse_logs.py.

Definition at line 967 of file analyse_logs.py.

Definition at line 935 of file analyse_logs.py.

list analyse_logs::n_pts = ang.shape[0]

Definition at line 912 of file analyse_logs.py.

tuple analyse_logs::p = optparse.OptionParser()

Definition at line 766 of file analyse_logs.py.

tuple analyse_logs::pkl_name = glob.glob(opt.dir + '/combined_log*.pkl')

Definition at line 885 of file analyse_logs.py.

Definition at line 808 of file analyse_logs.py.

tuple analyse_logs::poses_pkl = glob.glob(opt.dir + '/poses_dict*.pkl')

Definition at line 805 of file analyse_logs.py.

Definition at line 931 of file analyse_logs.py.

Definition at line 916 of file analyse_logs.py.

Definition at line 932 of file analyse_logs.py.

tuple analyse_logs::tup = ke.init_ros_node()

Definition at line 841 of file analyse_logs.py.

string analyse_logs::type = 'string'

Definition at line 768 of file analyse_logs.py.

tuple analyse_logs::vel1 = ma.compute_velocity(ma1, cd['time_list'], 1)

Definition at line 865 of file analyse_logs.py.

tuple analyse_logs::vel2 = ma.compute_velocity(ma2, cd['time_list'], 1)

Definition at line 864 of file analyse_logs.py.

tuple analyse_logs::vel3 = ma.compute_velocity(ma3, cd['time_list'], 1)

Definition at line 863 of file analyse_logs.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