ros2_control - humble
Public Member Functions | List of all members
control_toolbox::SineSweep Class Reference

Generates a sine sweep for frequency analysis of a joint. More...

#include <sine_sweep.hpp>

Public Member Functions

 SineSweep ()
 Constructor.
 
double update (rclcpp::Duration dt)
 Update the SineSweep loop with nonuniform time step size. More...
 
bool init (double start_freq, double end_freq, double duration, double amplitude)
 Initializes everything and calculates the constants for the sweep. More...
 

Detailed Description

Generates a sine sweep for frequency analysis of a joint.

This class basically calculates the output for a sine sweep. Where the signal is a sine wave, whose frequency is exponentially increased from \(\omega_1\) to \(\omega_2\) over \(T\) seconds.

\(s(n) = A \sin [ K(e^{\delta t/L} - 1) ]\)

where:
\(K = \frac{\omega_1T}{\ln \frac{\omega_2}{\omega_1} }\)
\(L = \frac{T}{\ln \frac{\omega_2}{\omega_1} }\).

Member Function Documentation

◆ init()

bool control_toolbox::SineSweep::init ( double  start_freq,
double  end_freq,
double  duration,
double  amplitude 
)

Initializes everything and calculates the constants for the sweep.

Parameters
start_freqStart frequency of the sweep, \(\omega_1\) .
end_freqEnd frequency of the sweep, \(\omega_2\).
durationThe duration of the sweep, \(T\).
amplitudeThe amplitude of the sweep, \(A\).

◆ update()

double control_toolbox::SineSweep::update ( rclcpp::Duration  dt)

Update the SineSweep loop with nonuniform time step size.

Parameters
dtChange in time since last call

The documentation for this class was generated from the following files: