Public Member Functions | Private Attributes | List of all members
control_toolbox::SineSweep Class Reference

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

#include <sine_sweep.h>

Public Member Functions

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

Private Attributes

double amplitude_
 
double cmd_
 
ros::Duration duration_
 
double end_angular_freq_
 
double K_
 
double L_
 
double start_angular_freq_
 

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} }$.

Definition at line 92 of file sine_sweep.h.

Constructor & Destructor Documentation

◆ SineSweep()

control_toolbox::SineSweep::SineSweep ( )

Constructor.

Definition at line 74 of file sine_sweep.cpp.

◆ ~SineSweep()

control_toolbox::SineSweep::~SineSweep ( )

Destructor.

Definition at line 83 of file sine_sweep.cpp.

Member Function Documentation

◆ init()

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

Intializes 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$.

Definition at line 87 of file sine_sweep.cpp.

◆ update()

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

Update the SineSweep loop with nonuniform time step size.

Parameters
dtChange in time since last call

Definition at line 110 of file sine_sweep.cpp.

Member Data Documentation

◆ amplitude_

double control_toolbox::SineSweep::amplitude_
private

Amplitude of the sweep.

Definition at line 124 of file sine_sweep.h.

◆ cmd_

double control_toolbox::SineSweep::cmd_
private

Command to send.

Definition at line 130 of file sine_sweep.h.

◆ duration_

ros::Duration control_toolbox::SineSweep::duration_
private

Duration of the sweep.

Definition at line 125 of file sine_sweep.h.

◆ end_angular_freq_

double control_toolbox::SineSweep::end_angular_freq_
private

End angular frequency of the sweep.

Definition at line 127 of file sine_sweep.h.

◆ K_

double control_toolbox::SineSweep::K_
private

Constant $K$.

Definition at line 128 of file sine_sweep.h.

◆ L_

double control_toolbox::SineSweep::L_
private

Constant $L$.

Definition at line 129 of file sine_sweep.h.

◆ start_angular_freq_

double control_toolbox::SineSweep::start_angular_freq_
private

Start angular frequency of the sweep.

Definition at line 126 of file sine_sweep.h.


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


control_toolbox
Author(s): Melonee Wise, Sachin Chitta, John Hsu
autogenerated on Wed May 11 2022 02:09:47