control_toolbox::Sinusoid Class Reference

A basic sine class. More...

#include <sinusoid.h>

List of all members.

Public Member Functions

void debug ()
bool initXml (TiXmlElement *ti_xml_element)
 Initializes the parameters of the sine wave from the given xml element.
 Sinusoid (double offset, double amplitude, double frequency, double phase)
 Constructor which intializes values.
 Sinusoid ()
 Constructor.
double update (double time, double &qd, double &qdd)
 Gets the value and derivatives of the sinusoid at a given time.
virtual ~Sinusoid ()

Private Attributes

double amplitude_
double frequency_
double offset_
double phase_

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.

Definition at line 52 of file sinusoid.h.


Constructor & Destructor Documentation

control_toolbox::Sinusoid::Sinusoid (  ) 

Constructor.

Definition at line 72 of file sinusoid.cpp.

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

Constructor which intializes values.

Parameters:
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

Definition at line 46 of file sinusoid.cpp.

control_toolbox::Sinusoid::~Sinusoid (  )  [virtual]

Destructor

Definition at line 68 of file sinusoid.cpp.


Member Function Documentation

void control_toolbox::Sinusoid::debug (  ) 

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

Definition at line 88 of file sinusoid.cpp.

bool control_toolbox::Sinusoid::initXml ( TiXmlElement *  ti_xml_element  ) 

Initializes the parameters of the sine wave from the given xml element.

Parameters:
ti_xml_element This XML element needs to contain the following attributes: offset, amplitude, frequency, phase
Returns:
true if successful, false if not

Definition at line 54 of file sinusoid.cpp.

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

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

Parameters:
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
Returns:
The sampled value of the sine wave

Definition at line 76 of file sinusoid.cpp.


Member Data Documentation

Amplitude of the sine wave.

Definition at line 100 of file sinusoid.h.

Frequency of the sine wave.

Definition at line 101 of file sinusoid.h.

DC offset of the sine wave.

Definition at line 99 of file sinusoid.h.

Phase of the sine wave at t=0.

Definition at line 102 of file sinusoid.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Defines


control_toolbox
Author(s): Melonee Wise, Sachin Chitta, John Hsu
autogenerated on Fri Jan 11 10:00:57 2013