Cheetah Software  1.0
plot_spline_opt Namespace Reference

Functions

def create_figures (subfigure_width=480, subfigure_height=600, starting_figure_no=1, starting_col_index=0, starting_row_index=0, plot_configuration=PLOT_HORIZONTALLY)
 

Variables

int PLOT_VERTICALLY = 0
 
int PLOT_HORIZONTALLY = 1
 
int num_figures = 5
 

Function Documentation

def plot_spline_opt.create_figures (   subfigure_width = 480,
  subfigure_height = 600,
  starting_figure_no = 1,
  starting_col_index = 0,
  starting_row_index = 0,
  plot_configuration = PLOT_HORIZONTALLY 
)

Definition at line 14 of file plot_spline_opt.py.

14 def create_figures(subfigure_width=480, subfigure_height=600, starting_figure_no=1, starting_col_index = 0, starting_row_index=0, plot_configuration=PLOT_HORIZONTALLY):
15  figure_number = starting_figure_no
16  col_index = starting_col_index
17  row_index = starting_row_index
18 
19  file_path = os.getcwd() + "/../test_data/"
20 
21  ## read files
22  dim = 2
23  pos = np.genfromtxt(file_path+'opt_spline_pos.txt', delimiter=None, dtype=(float))
24  vel = np.genfromtxt(file_path+'opt_spline_vel.txt', delimiter=None, dtype=(float))
25  acc = np.genfromtxt(file_path+'opt_spline_acc.txt', delimiter=None, dtype=(float))
26  t = np.genfromtxt(file_path+'opt_spline_time.txt', delimiter='\n', dtype=(float))
27 
28  ## plot bspline
29  fig = plt.figure(figure_number)
30  plt.get_current_fig_manager().window.wm_geometry(str(subfigure_width) + "x" + str(subfigure_height) + "+" + str(subfigure_width*col_index) + "+" + str(subfigure_height*row_index))
31  fig.canvas.set_window_title('pos')
32  for i in range(dim):
33  ax1 = plt.subplot(dim, 1, i+1)
34  plt.plot(t, pos[:,i], "b-")
35  plt.grid(True)
36  plt.xlabel('time (sec)')
37  ## increment figure number and index
38  figure_number += 1
39  if plot_configuration == PLOT_HORIZONTALLY:
40  col_index += 1
41  elif plot_configuration == PLOT_VERTICALLY:
42  row_index +=1
43 
44  ## plot vel
45  fig = plt.figure(figure_number)
46  plt.get_current_fig_manager().window.wm_geometry(str(subfigure_width) + "x" + str(subfigure_height) + "+" + str(subfigure_width*col_index) + "+" + str(subfigure_height*row_index))
47  fig.canvas.set_window_title('vel')
48  for i in range(dim):
49  ax1 = plt.subplot(dim, 1, i+1)
50  plt.plot(t, vel[:,i], "b-")
51  plt.grid(True)
52  plt.xlabel('time (sec)')
53  ## increment figure number and index
54  figure_number += 1
55  if plot_configuration == PLOT_HORIZONTALLY:
56  col_index += 1
57  elif plot_configuration == PLOT_VERTICALLY:
58  row_index +=1
59 
60  ## plot bspline
61  fig = plt.figure(figure_number)
62  plt.get_current_fig_manager().window.wm_geometry(str(subfigure_width) + "x" + str(subfigure_height) + "+" + str(subfigure_width*col_index) + "+" + str(subfigure_height*row_index))
63  fig.canvas.set_window_title('acc')
64  for i in range(dim):
65  ax1 = plt.subplot(dim, 1, i+1)
66  plt.plot(t, acc[:,i], "b-")
67  plt.grid(True)
68  plt.xlabel('time (sec)')
69  ## increment figure number and index
70  figure_number += 1
71  if plot_configuration == PLOT_HORIZONTALLY:
72  col_index += 1
73  elif plot_configuration == PLOT_VERTICALLY:
74  row_index +=1
75 
def create_figures(subfigure_width=480, subfigure_height=600, starting_figure_no=1, starting_col_index=0, starting_row_index=0, plot_configuration=PLOT_HORIZONTALLY)

Variable Documentation

int plot_spline_opt.num_figures = 5

Definition at line 12 of file plot_spline_opt.py.

int plot_spline_opt.PLOT_HORIZONTALLY = 1

Definition at line 9 of file plot_spline_opt.py.

int plot_spline_opt.PLOT_VERTICALLY = 0

Definition at line 8 of file plot_spline_opt.py.