delta_calibrate: Improve Python3 compatibility

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-06-12 10:04:13 -04:00
parent 8c96e9dd11
commit 4b231470ed
1 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ def measurements_to_distances(measured_params, delta_params):
for od, opw in zip(mp['OUTER_DISTS'], mp['OUTER_PILLAR_WIDTHS']) ] for od, opw in zip(mp['OUTER_DISTS'], mp['OUTER_PILLAR_WIDTHS']) ]
# Convert angles in degrees to an XY multiplier # Convert angles in degrees to an XY multiplier
obj_angles = map(math.radians, MeasureAngles) obj_angles = map(math.radians, MeasureAngles)
xy_angles = zip(map(math.cos, obj_angles), map(math.sin, obj_angles)) xy_angles = list(zip(map(math.cos, obj_angles), map(math.sin, obj_angles)))
# Calculate stable positions for center measurements # Calculate stable positions for center measurements
inner_ridge = MeasureRidgeRadius * scale inner_ridge = MeasureRidgeRadius * scale
inner_pos = [(ax * inner_ridge, ay * inner_ridge, 0.) inner_pos = [(ax * inner_ridge, ay * inner_ridge, 0.)
@ -270,7 +270,7 @@ class DeltaCalibrate:
if data is None: if data is None:
continue continue
try: try:
parts = map(float, data.split(',')) parts = list(map(float, data.split(',')))
except: except:
raise gcmd.error("Unable to parse parameter '%s'" % (name,)) raise gcmd.error("Unable to parse parameter '%s'" % (name,))
if len(parts) != count: if len(parts) != count: