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

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

Detailed Description

A basic sine class.

This class calculates the output for a sine wave and its derivatives, given the amplitude, phase, frequency and offset.

Constructor & Destructor Documentation

◆ Sinusoid()

control_toolbox::Sinusoid::Sinusoid ( double  offset,
double  amplitude,
double  frequency,
double  phase 
)

Constructor which initializes values.

Parameters
offsetA DC offset to be added to the sine wave
amplitudeAmplitude of the sine wave
frequencyFrequency of the sine wave
phasePhase (in radians) of the sine wave at t=0

◆ ~Sinusoid()

control_toolbox::Sinusoid::~Sinusoid ( )
virtual

Destructor

Member Function Documentation

◆ debug()

void control_toolbox::Sinusoid::debug ( )

Prints the parameters of the sine wave to stdout (for debugging)

◆ update()

double control_toolbox::Sinusoid::update ( double  time,
double &  qd,
double &  qdd 
)

Gets the value and derivatives of the sinusoid at a given time.

Parameters
timeTime at which to sample the sine wave
qd(output) The derivative of the sine wave
qdd(output) Second derivative of the sine wave
Returns
The sampled value of the sine wave

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