35 Eigen::Vector<T, 2> x_;
36 Eigen::Matrix<T, 2, 2> A_;
48 : frequency_(frequency)
49 , sample_time_(sample_time)
50 , x_(static_cast<T>(0), static_cast<T>(1))
65 this->frequency_ = frequency;
66 this->sample_time_ = sample_time;
69 Eigen::Matrix<T, 2, 2> A_continuous({
75 Eigen::Matrix<T, 2, 2> ATs = A_continuous * sample_time;
84 T
sin()
const {
return this->x_(0);}
91 T
cos()
const {
return this->x_(1);}
98 Eigen::Vector<T, 2>
next(){
99 Eigen::Vector<T, 2> new_x = this->A_ * this->x_;
109 this->x_(0) =
static_cast<T
>(0);
110 this->x_(1) =
static_cast<T
>(1);
A lite weight incremental sine generator.
Definition Generator.hpp:31
SineGenerator(const T &frequency, const T &sample_time)
Constructs a sine generator.
Definition Generator.hpp:47
T cos() const
Returns the current cosine output.
Definition Generator.hpp:91
void set_frequency_and_sample_time(const T &frequency, const T &sample_time)
Definition Generator.hpp:63
void set_frequency(const T &frequency)
Definition Generator.hpp:55
void reset()
Resets the Sine generator to the initial position.
Definition Generator.hpp:108
Eigen::Vector< T, 2 > next()
calculates the next output
Definition Generator.hpp:98
void set_sample_time(const T &sample_time)
Definition Generator.hpp:59
T sin() const
Returns the current sine output.
Definition Generator.hpp:84
The main namespace for the Control++ library.
Definition Bode.cpp:3
Eigen::Matrix< T, N, N > expm(const Eigen::Matrix< T, N, N, Options, MaxRows, MaxCols > &M)
Calculates the matrix exponent .
Definition expm.hpp:275