ros2_control - rolling
|
A basic sine class. More...
#include <sinusoid.hpp>
Public Member Functions | |
Sinusoid () | |
Constructor. | |
Sinusoid (double offset, double amplitude, double frequency, double phase) | |
Constructor which initializes values. More... | |
virtual | ~Sinusoid () |
void | debug () |
double | update (double time, double &qd, double &qdd) |
Gets the value and derivatives of the sinusoid at a given time. More... | |
A basic sine class.
This class calculates the output for a sine wave and its derivatives, given the amplitude, phase, frequency and offset.
control_toolbox::Sinusoid::Sinusoid | ( | double | offset, |
double | amplitude, | ||
double | frequency, | ||
double | phase | ||
) |
Constructor which initializes values.
offset | A DC offset to be added to the sine wave |
amplitude | Amplitude of the sine wave |
frequency | Frequency of the sine wave |
phase | Phase (in radians) of the sine wave at t=0 |
|
virtual |
Destructor
void control_toolbox::Sinusoid::debug | ( | ) |
Prints the parameters of the sine wave to stdout (for debugging)
double control_toolbox::Sinusoid::update | ( | double | time, |
double & | qd, | ||
double & | qdd | ||
) |
Gets the value and derivatives of the sinusoid at a given time.
time | Time at which to sample the sine wave |
qd | (output) The derivative of the sine wave |
qdd | (output) Second derivative of the sine wave |