bed_mesh: round x and y positions received via the finalize callback

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>

Update bed_mesh.py
This commit is contained in:
Arksine 2020-07-05 14:19:43 -04:00 committed by KevinOConnor
parent 6458def588
commit 7c8b60b40e
1 changed files with 2 additions and 0 deletions

View File

@ -504,6 +504,8 @@ class BedMeshCalibrate:
print_func("bed_mesh: bed has not been probed") print_func("bed_mesh: bed has not been probed")
def probe_finalize(self, offsets, positions): def probe_finalize(self, offsets, positions):
x_offset, y_offset, z_offset = offsets x_offset, y_offset, z_offset = offsets
positions = [(round(p[0], 2), round(p[1], 2), p[2])
for p in positions]
params = self.mesh_params params = self.mesh_params
params['min_x'] = min(positions, key=lambda p: p[0])[0] + x_offset params['min_x'] = min(positions, key=lambda p: p[0])[0] + x_offset
params['max_x'] = max(positions, key=lambda p: p[0])[0] + x_offset params['max_x'] = max(positions, key=lambda p: p[0])[0] + x_offset