Allow to set axis acceleration with AxisUnit and physical units

pull/93/head
Yuri D'Elia 2021-08-29 14:31:41 +02:00 committed by DRracer
parent 563c8192cd
commit 60c83b0af2
1 changed files with 17 additions and 0 deletions

View File

@ -185,6 +185,23 @@ public:
axisData[axis].ctrl.SetAcceleration(accel);
}
/// Set acceleration for the selected axis, but using AxisUnit. The Axis needs to
/// be supplied as the first template argument: SetAcceleration<axis>(accel).
/// @see SetAcceleration, unitToSteps
template <Axis A>
void SetAcceleration(AxisUnit<steps_t, A, Accel> accel) {
SetAcceleration(A, accel.v);
}
/// Set acceleration for the selected axis, but using physical units. The Axis needs to
/// be supplied as the first template argument: SetAcceleration<axis>(accel).
/// @param axis axis affected
/// @param accel acceleration
template <Axis A, config::UnitBase B>
void SetAcceleration(config::Unit<long double, B, Accel> accel) {
SetAcceleration<A>(unitToAxisUnit<AxisUnit<steps_t, A, Accel>>(accel));
}
/// Get current jerk for the selected axis
/// @param axis axis affected
/// @returns jerk