|
Hormodular 1.0
Locomotion gait discovery by using digital hormones on modular robots
|
00001 //------------------------------------------------------------------------------ 00002 //-- SinusoidalOscillator 00003 //------------------------------------------------------------------------------ 00004 //-- 00005 //-- Sinusoidal oscillator 00006 //-- 00007 //------------------------------------------------------------------------------ 00008 //-- 00009 //-- This file belongs to the Hormodular project 00010 //-- (https://github.com/David-Estevez/hormodular.git) 00011 //-- 00012 //------------------------------------------------------------------------------ 00013 //-- Author: David Estevez-Fernandez 00014 //-- 00015 //-- Released under the GPL license (more info on LICENSE.txt file) 00016 //------------------------------------------------------------------------------ 00017 00024 #ifndef SINUSOIDAL_OSCILLATOR_H 00025 #define SINUSOIDAL_OSCILLATOR_H 00026 00027 #include <stdint.h> 00028 #include <cmath> 00029 #include <iostream> 00030 00031 #include "Oscillator.h" 00032 00033 namespace hormodular { 00034 00038 class SinusoidalOscillator: public Oscillator 00039 { 00040 public: 00041 SinusoidalOscillator(); 00042 SinusoidalOscillator( float amplitude, float offset, float phase, int period_ms = 4000); 00043 00044 virtual float calculatePos( unsigned long time ); 00045 00046 private: 00047 float deg2rad( float angle_deg); 00048 }; 00049 } 00050 #endif
1.7.4