Skip to content

Commit

Permalink
debug out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
misko committed Dec 20, 2023
1 parent 6281401 commit 0813747
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spf/grbl/grbl_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@


def a_to_b_in_stepsize(a, b, step_size):
if np.isclose(a,b).all():
return [b]
# move by step_size from where we are now to the target position
points = [a]
direction = (b - a) / np.linalg.norm(b - a)
Expand Down Expand Up @@ -100,8 +102,9 @@ def from_steps(self, a_motor_steps, b_motor_steps):

def to_steps(self, p):
if (self.polygon is not None) and not self.polygon.contains_point(
p, radius=0.001
p, radius=0.01
): # todo a bit hacky but works
print("OUT OF BOUNDS",p)
raise ValueError
# motor_steps = ( distance_between_pivot and point ) - (distance between pivot and calibration point)
a_motor_steps = np.linalg.norm(self.pA - p) - np.linalg.norm(
Expand Down

0 comments on commit 0813747

Please sign in to comment.