91 while not ser.in_waiting:
continue
94 if values_read < VALUES_SENT:
100 elif values_read>=VALUES_SENT:
106 if values_read==2*VALUES_SENT:
111 plotData(times, data, thead, dhead,
"Left")
112 plotData(times2, data2, thead, dhead,
"Right")
113 timestamp=datetime.now().strftime(
"%Y-%m-%d_%H-%M-%S")
114 pyplot.title(f
"Velocity_{timestamp}")
116 pyplot.xlim(0,VALUES_SENT)
118 pyplot.savefig(f
'Velocity_{timestamp}.svg')
168 user_input = input(
"Send a command: s=full motor step response, t=test, 0=stop romi, 1=straight, 2=Arc turn, 3= pivot, q=quit: ")
171 print(
'exiting test loop')
172 ser.write(str(0).encode())
176 ser.write(str(user_input).encode())
179 ser.write(str(user_input).encode())
181 test_input=input(
"Send a command: 0=stop romi, 1=straight, 2=Arc turn, 3= pivot: ")
183 test_input=int(test_input)
188 ser.write(str(test_input).encode())
190 j=input(f
"please select a velocity in mm/s from {-velo_lim} to {velo_lim}: ")
193 if j>=-velo_lim
and j<=velo_lim
and j!=0:
195 ser.write(str(j).encode())
206 ser.write(str(test_input).encode())
208 j = input(f
"Please enter a non zero integer arc radius in mm from {-arc_lim} to {arc_lim}: ")
211 if j>=-arc_lim
and j<= arc_lim
and j!=0:
212 ser.write(str(j).encode())
222 ser.write(str(test_input).encode())
224 j = input(f
"Please enter an integer arc radius in mm from {-angular_lim} to {angular_lim}: ")
227 if j>=-angular_lim
and j<= angular_lim
and j!=0:
228 ser.write(str(j).encode())
238 ser.write(str(test_input).encode())
242 user_input= int(user_input)
247 ser.write(str(user_input).encode())
249 n=input(f
"please select a velocity in mm/s from {-velo_lim} to {velo_lim}: ")
252 if n>=-velo_lim
and n<=velo_lim
and n!=0:
253 ser.write(str(n).encode())
262 ser.write(str(user_input).encode())
264 n = input(f
"Please enter a non zero integer arc radius in mm from {-arc_lim} to {arc_lim}: ")
267 if n>=-arc_lim
and n<= arc_lim
and n!=0:
268 ser.write(str(n).encode())
277 ser.write(str(user_input).encode())
279 n = input(f
"Please enter an integer arc radius in mm from {-angular_lim} to {angular_lim}: ")
282 if n>=-angular_lim
and n<= angular_lim
and n!=0:
283 ser.write(str(n).encode())
292 ser.write(str(user_input).encode())