libfranka  0.8.0
FCI C++ API
Functions | Variables
lowpass_filter.h File Reference

Contains functions for filtering signals with a low-pass filter. More...

#include <array>
#include <cmath>
Include dependency graph for lowpass_filter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double franka::lowpassFilter (double sample_time, double y, double y_last, double cutoff_frequency)
 Applies a first-order low-pass filter. More...
 
std::array< double, 16 > franka::cartesianLowpassFilter (double sample_time, std::array< double, 16 > y, std::array< double, 16 > y_last, double cutoff_frequency)
 Applies a first-order low-pass filter to the translation and spherical linear interpolation to the rotation of a transformation matrix which represents a Cartesian Motion. More...
 

Variables

constexpr double franka::kMaxCutoffFrequency = 1000.0
 Maximum cutoff frequency.
 
constexpr double franka::kDefaultCutoffFrequency = 100.0
 Default cutoff frequency.
 

Detailed Description

Contains functions for filtering signals with a low-pass filter.

Function Documentation

◆ cartesianLowpassFilter()

std::array<double, 16> franka::cartesianLowpassFilter ( double  sample_time,
std::array< double, 16 >  y,
std::array< double, 16 >  y_last,
double  cutoff_frequency 
)

Applies a first-order low-pass filter to the translation and spherical linear interpolation to the rotation of a transformation matrix which represents a Cartesian Motion.

Parameters
[in]sample_timeSample time constant
[in]yCurrent Cartesian transformation matrix to be filtered
[in]y_lastCartesian transformation matrix from the previous time step
[in]cutoff_frequencyCutoff frequency of the low-pass filter
Exceptions
std::invalid_argumentif elements of y is infinite or NaN.
std::invalid_argumentif elements of y_last is infinite or NaN.
std::invalid_argumentif cutoff_frequency is zero, negative, infinite or NaN.
std::invalid_argumentif sample_time is negative, infinite or NaN.
Returns
Filtered Cartesian transformation matrix.

◆ lowpassFilter()

double franka::lowpassFilter ( double  sample_time,
double  y,
double  y_last,
double  cutoff_frequency 
)

Applies a first-order low-pass filter.

Parameters
[in]sample_timeSample time constant
[in]yCurrent value of the signal to be filtered
[in]y_lastValue of the signal to be filtered in the previous time step
[in]cutoff_frequencyCutoff frequency of the low-pass filter
Exceptions
std::invalid_argumentif y is infinite or NaN.
std::invalid_argumentif y_last is infinite or NaN.
std::invalid_argumentif cutoff_frequency is zero, negative, infinite or NaN.
std::invalid_argumentif sample_time is negative, infinite or NaN.
Returns
Filtered value.