mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-18 20:28:10 -06:00
stepper: Add get/set_tag_position() and convert calc_position()
Rename calc_position() to calc_tag_position() and have it calculate the value of the position from the last stepper set_tag_position() call. This enables the calc_tag_position() code to be more flexible as it can be run with arbitrary positions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
e0e2f15498
commit
224574da4a
11 changed files with 56 additions and 40 deletions
|
@ -31,9 +31,9 @@ class WinchKinematics:
|
|||
self.set_position([0., 0., 0.], ())
|
||||
def get_steppers(self, flags=""):
|
||||
return list(self.steppers)
|
||||
def calc_position(self):
|
||||
def calc_tag_position(self):
|
||||
# Use only first three steppers to calculate cartesian position
|
||||
spos = [s.get_commanded_position() for s in self.steppers[:3]]
|
||||
spos = [s.get_tag_position() for s in self.steppers[:3]]
|
||||
return mathutil.trilateration(self.anchors[:3], [sp*sp for sp in spos])
|
||||
def set_position(self, newpos, homing_axes):
|
||||
for s in self.steppers:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue