Commit 78c0240e authored by Lorenz Halt's avatar Lorenz Halt 🔀
Browse files

Less verbose

parent fb4a7266
......@@ -39,7 +39,7 @@ def resample(data, delta_ms):
def write(file, data, header):
print("Writing to file: '%s'"%(file))
#print("Writing to file: '%s'"%(file))
# Test if header fits
if not len(header.split(',')) == data.shape[1]:
raise ValueError("header and data does not fit!\nheader: '{}'\ndata[0]: '{}'".format(header, data[0,:]))
......@@ -51,7 +51,7 @@ def write(file, data, header):
delimiter =",")
def read(file):
print("Reading from file: '%s'"%(file))
#print("Reading from file: '%s'"%(file))
with open(file, 'r') as f:
header_str = f.readline().strip()
data = np.genfromtxt(file,
......
......@@ -50,7 +50,7 @@ class Ilc_serviceproxy:
rospack = rospkg.RosPack()
name = name.replace(matchObj.group(), "{}".format(rospack.get_path(matchObj.group(2))))
print("Decoded Name: {} -> {}".format(filename, name))
#print("Decoded Name: {} -> {}".format(filename, name))
return name
......@@ -64,7 +64,7 @@ class Ilc_serviceproxy:
def callback_ilc_calc_meas(self, req):
try:
print
#print
path = self.decode_filename(req.filename_error)
### Read measurement data
......@@ -163,7 +163,7 @@ class Ilc_serviceproxy:
if req.reuse_scheme != 0:
self.reshape = True
print("Retiming Service received:\n{}".format(req))
#print("Retiming Service received:\n{}".format(req))
return RetimeILCResponse(success=True, message="done")
def reshape_ff(self, last_ff, last_decay_time, new_decay_time):
......@@ -174,8 +174,9 @@ class Ilc_serviceproxy:
def callback_ilc_retime_if(self, req):
#print("Retiming Service received:\n{}".format(req))
try:
print("Convergence: {} > {}".format(np.max(ilc_lib.error_convergence(self.data_diff)), req.convergence_threshold))
if (np.max(ilc_lib.error_convergence(self.data_diff)) < req.convergence_threshold):
print("Reducing trajectory time to {}".format(self.decay_time))
#print("Reducing trajectory time to {}".format(self.decay_time))
self.last_decay_time = self.decay_time
self.decay_time = self.decay_time * req.retime_factor
self.initialized = req.reuse_ff
......@@ -184,7 +185,7 @@ class Ilc_serviceproxy:
self.reshape = True
# Call service to setpoint_ilc (retime factor is start parameter, not in service but must be in sync!)
print(req)
#print(req)
resp = rospy.ServiceProxy(req.retime_srv, Empty)()
print("-------------------------------------------")
print("Retimed from {}ms to {}ms".format(self.last_decay_time, self.decay_time))
......@@ -192,7 +193,6 @@ class Ilc_serviceproxy:
return RetimeIfILCResponse(success=True, message="reshaped")
else:
print("Convergence: {} > {}".format(np.max(ilc_lib.error_convergence(self.data_diff)), req.convergence_threshold))
return RetimeIfILCResponse(success=True, message="skipped")
except Exception as e:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment