Function franka::robot::low_pass_filter::low_pass_filter[][src]

pub fn low_pass_filter(
    sample_time: f64,
    y: f64,
    y_last: f64,
    cutoff_frequency: f64
) -> f64

Applies a first-order low-pass filter

Arguments

  • sample_time - Sample time constant
  • y - Current value of the signal to be filtered
  • y_last - Value of the signal to be filtered in the previous time step
  • cutoff_frequency -Cutoff frequency of the low-pass filter

Panics

This function panics if:

  • y is infinite or NaN.
  • y_last is infinite or NaN.
  • cutoff_frequency is zero, negative, infinite or NaN.
  • sample_time is negative, infinite or NaN.

Return

Filtered value.