Skip to main content

limit_rate_torques

Function limit_rate_torques 

Source
pub fn limit_rate_torques(
    max_derivatives: &[f64; 7],
    commanded_values: &[f64; 7],
    last_commanded_values: &[f64; 7],
) -> FrankaResult<[f64; 7]>
Expand description

Limits the rate of an input vector of per-joint commands considering the maximum allowed time derivatives.

Port of franka::limitRate(const std::array<double, 7>& max_derivatives, ...), used for torque commands.

§Errors

FrankaError::InvalidArgument if commanded_values are infinite or NaN.

§Note

FCI filters must be deactivated to work properly.

§float32 quantisation

last_commanded_values is normally RobotState::tau_J_d, which the robot publishes as a float32 while judging our command’s rate against the double it last received. Saturating this function against the quantised value can therefore read as up to ≈ 1000.0028 Nm/s at the robot for |τ| ≥ 64 Nm — libfranka has the identical exposure, and this function stays an exact port of franka::limitRate. The control loop compensates by shrinking max_derivatives per cycle; see crate::robot::control_loop::torque::torque_rate_margin.