itersolve: Support setting the stepper position via a cartesian coordinate
Add support for an itersolve_set_position() function that sets a stepper position from a cartesian coordinate. This eliminates the need for both the python and C code to be able to translate from a cartesian coordinate to a stepper position. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -215,6 +215,16 @@ itersolve_set_stepcompress(struct stepper_kinematics *sk
|
||||
sk->step_dist = step_dist;
|
||||
}
|
||||
|
||||
void __visible
|
||||
itersolve_set_position(struct stepper_kinematics *sk
|
||||
, double x, double y, double z)
|
||||
{
|
||||
struct move m;
|
||||
memset(&m, 0, sizeof(m));
|
||||
move_fill(&m, 0., 0., 1., 0., x, y, z, 0., 1., 0., 0., 1., 0.);
|
||||
sk->commanded_pos = sk->calc_position(sk, &m, 0.);
|
||||
}
|
||||
|
||||
void __visible
|
||||
itersolve_set_commanded_pos(struct stepper_kinematics *sk, double pos)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user