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:
Kevin O'Connor
2018-06-22 13:03:07 -04:00
parent 0216201cb6
commit 890298d34d
9 changed files with 34 additions and 29 deletions

View File

@@ -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)
{