-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify kinematic set_position() and clear_homing_state() calls #6782
Conversation
I cherry-picked and tried to test it:
I got klippy crashed:
|
klippy/extras/force_move.py
Outdated
axes = ['X', 'Y', 'Z'] | ||
clear_axes = [axes.index(a) for a in axes if a in clear] | ||
clear = gcmd.get('CLEAR', '').lower() | ||
clear_axes = "".join([a for a in "xyz" if a in clear]) | ||
logging.info("SET_KINEMATIC_POSITION pos=%.3f,%.3f,%.3f clear=%s", | ||
x, y, z, ','.join((axes[i] for i in clear_axes))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing axes[i]
Possibly there should be:
i for i in clear_axes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! Thanks for testing and reporting. Hopefully should be fixed now.
-Kevin
3e62be4
to
38de633
Compare
Call clear_homing_state() on each motor off event. This simplifies the kinematic classes as they no longer need to register and handle the motor_off event. Signed-off-by: Kevin O'Connor <[email protected]>
Use strings such as "xyz" to specify which axes are to be considered homing during a set_position() call. This makes the parameter a little less cryptic. Signed-off-by: Kevin O'Connor <[email protected]>
Pass a string such as "xyz" to kin.clear_homing_state(). This makes the parameter a little less cryptic. Signed-off-by: Kevin O'Connor <[email protected]>
38de633
to
6ab2533
Compare
Now that clear_homing_state() has been implemented, there is no longer a need for each kinematic class to manually register for the "motor_off" event, as the stepper_enable class can directly call clear_homing_state().
Also this changes the homing_axes and clear_axes parameters of the set_position() and clear_homing_state() to pass strings (eg, "xyz") instead of a list of numbers.
@twelho - fyi.
-Kevin