Changeset 15 in flair-src for trunk/lib/FlairFilter/src/unexported
- Timestamp:
- 04/08/16 15:40:57 (8 years ago)
- Location:
- trunk/lib/FlairFilter/src/unexported
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairFilter/src/unexported/Ahrs_impl.h
r10 r15 17 17 18 18 namespace flair { 19 20 21 22 23 24 25 26 27 28 19 namespace core { 20 class AhrsData; 21 } 22 namespace gui { 23 class Tab; 24 class DataPlot1D; 25 } 26 namespace filter { 27 class Ahrs; 28 } 29 29 } 30 30 … … 37 37 38 38 class Ahrs_impl { 39 public: 40 Ahrs_impl(flair::filter::Ahrs* self); 41 ~Ahrs_impl(); 42 void UseDefaultPlot(void); 43 void AddPlot(const flair::core::AhrsData *ahrsData,flair::gui::DataPlot::Color_t color); 44 flair::gui::DataPlot1D *rollPlot,*pitchPlot,*yawPlot; 45 flair::gui::DataPlot1D *wXPlot,*wYPlot,*wZPlot; 46 flair::gui::DataPlot1D *q0Plot,*q1Plot,*q2Plot,*q3Plot; 47 flair::core::AhrsData *ahrsData; 39 public: 40 Ahrs_impl(flair::filter::Ahrs *self); 41 ~Ahrs_impl(); 42 void UseDefaultPlot(void); 43 void AddPlot(const flair::core::AhrsData *ahrsData, 44 flair::gui::DataPlot::Color_t color); 45 flair::gui::DataPlot1D *rollPlot, *pitchPlot, *yawPlot; 46 flair::gui::DataPlot1D *wXPlot, *wYPlot, *wZPlot; 47 flair::gui::DataPlot1D *q0Plot, *q1Plot, *q2Plot, *q3Plot; 48 flair::core::AhrsData *ahrsData; 48 49 49 50 flair::gui::Tab *eulerTab,*quaternionTab;51 flair::filter::Ahrs*self;50 private: 51 flair::gui::Tab *eulerTab, *quaternionTab; 52 flair::filter::Ahrs *self; 52 53 }; 53 54 -
trunk/lib/FlairFilter/src/unexported/ButterworthLowPass_impl.h
r10 r15 17 17 #include <Butterworth.h> 18 18 19 namespace flair 20 { 21 namespace core 22 { 23 class cvmatrix; 24 } 25 namespace gui 26 { 27 class LayoutPosition; 28 class SpinBox; 29 class DoubleSpinBox; 30 } 31 namespace filter 32 { 33 class ButterworthLowPass; 34 } 19 namespace flair { 20 namespace core { 21 class cvmatrix; 22 } 23 namespace gui { 24 class LayoutPosition; 25 class SpinBox; 26 class DoubleSpinBox; 27 } 28 namespace filter { 29 class ButterworthLowPass; 30 } 35 31 } 36 32 37 33 // Storage for Layout 38 //de-templatized for pimpl idom 39 //comes from iir from Bernd Porr 40 class LayoutStorage 41 { 42 public: 43 LayoutStorage(int MaxPoles) 44 { 45 this->MaxPoles=MaxPoles; 46 m_pairs=(Iir::PoleZeroPair*)malloc((MaxPoles+1)/2*sizeof(Iir::PoleZeroPair)); 47 } 48 ~LayoutStorage() 49 { 50 free(m_pairs); 51 } 52 operator Iir::LayoutBase () 53 { 54 return Iir::LayoutBase (MaxPoles, m_pairs); 55 } 34 // de-templatized for pimpl idom 35 // comes from iir from Bernd Porr 36 class LayoutStorage { 37 public: 38 LayoutStorage(int MaxPoles) { 39 this->MaxPoles = MaxPoles; 40 m_pairs = (Iir::PoleZeroPair *)malloc((MaxPoles + 1) / 2 * 41 sizeof(Iir::PoleZeroPair)); 42 } 43 ~LayoutStorage() { free(m_pairs); } 44 operator Iir::LayoutBase() { return Iir::LayoutBase(MaxPoles, m_pairs); } 56 45 57 58 59 46 private: 47 Iir::PoleZeroPair *m_pairs; 48 int MaxPoles; 60 49 }; 61 50 62 51 // Storage for Cascade 63 //de-templatized for pimpl idom 64 //comes from iir from Bernd Porr 65 class CascadeStages 66 { 67 public: 68 CascadeStages(int MaxStages) 69 { 70 this->MaxStages=MaxStages; 71 m_stages=(Iir::Cascade::Stage*)malloc(MaxStages*sizeof(Iir::Cascade::Stage)); 72 m_states=(Iir::DirectFormII*)malloc(MaxStages*sizeof(Iir::DirectFormII)); 73 } 74 ~CascadeStages() 75 { 76 free(m_stages); 77 free(m_states); 78 } 79 void reset () 80 { 81 Iir::DirectFormII* state = m_states; 82 for (int i = MaxStages; --i >= 0; ++state) 83 state->reset(); 84 } 52 // de-templatized for pimpl idom 53 // comes from iir from Bernd Porr 54 class CascadeStages { 55 public: 56 CascadeStages(int MaxStages) { 57 this->MaxStages = MaxStages; 58 m_stages = 59 (Iir::Cascade::Stage *)malloc(MaxStages * sizeof(Iir::Cascade::Stage)); 60 m_states = 61 (Iir::DirectFormII *)malloc(MaxStages * sizeof(Iir::DirectFormII)); 62 } 63 ~CascadeStages() { 64 free(m_stages); 65 free(m_states); 66 } 67 void reset() { 68 Iir::DirectFormII *state = m_states; 69 for (int i = MaxStages; --i >= 0; ++state) 70 state->reset(); 71 } 85 72 86 template <typename Sample> 87 inline Sample filter(const Sample in) 88 { 89 double out = in; 90 Iir::DirectFormII* state = m_states; 91 Iir::Biquad const* stage = m_stages; 92 for (int i = MaxStages; --i >= 0; ++state, ++stage) 93 out = state->process1 (out, *stage); 94 return static_cast<Sample> (out); 95 } 73 template <typename Sample> inline Sample filter(const Sample in) { 74 double out = in; 75 Iir::DirectFormII *state = m_states; 76 Iir::Biquad const *stage = m_stages; 77 for (int i = MaxStages; --i >= 0; ++state, ++stage) 78 out = state->process1(out, *stage); 79 return static_cast<Sample>(out); 80 } 96 81 97 Iir::Cascade::Storage getCascadeStorage() 98 { 99 return Iir::Cascade::Storage (MaxStages, m_stages); 100 } 82 Iir::Cascade::Storage getCascadeStorage() { 83 return Iir::Cascade::Storage(MaxStages, m_stages); 84 } 101 85 102 103 104 105 86 private: 87 int MaxStages; 88 Iir::Cascade::Stage *m_stages; 89 Iir::DirectFormII *m_states; 106 90 }; 107 91 108 //de-templatized for pimpl idom 109 //comes from iir from Bernd Porr 110 class PoleFilter : Iir::Butterworth::LowPassBase,public CascadeStages 111 { 112 public: 113 PoleFilter (int MaxPoles):CascadeStages((MaxPoles + 1) / 2) 114 { 115 this->MaxPoles=MaxPoles; 116 m_analogStorage=new LayoutStorage(MaxPoles); 117 m_digitalStorage=new LayoutStorage(MaxPoles); 118 // This glues together the factored base classes 119 // with the templatized storage classes. 120 Iir::Butterworth::LowPassBase::setCascadeStorage (this->getCascadeStorage()); 121 Iir::Butterworth::LowPassBase::setPrototypeStorage (*m_analogStorage,*m_digitalStorage); 122 } 123 ~PoleFilter() 124 { 125 delete m_analogStorage; 126 delete m_digitalStorage; 127 } 128 void setup (double sampleRate,double cutoffFrequency) 129 { 130 Iir::Butterworth::LowPassBase::setup (MaxPoles, sampleRate,cutoffFrequency); 131 } 92 // de-templatized for pimpl idom 93 // comes from iir from Bernd Porr 94 class PoleFilter : Iir::Butterworth::LowPassBase, public CascadeStages { 95 public: 96 PoleFilter(int MaxPoles) : CascadeStages((MaxPoles + 1) / 2) { 97 this->MaxPoles = MaxPoles; 98 m_analogStorage = new LayoutStorage(MaxPoles); 99 m_digitalStorage = new LayoutStorage(MaxPoles); 100 // This glues together the factored base classes 101 // with the templatized storage classes. 102 Iir::Butterworth::LowPassBase::setCascadeStorage(this->getCascadeStorage()); 103 Iir::Butterworth::LowPassBase::setPrototypeStorage(*m_analogStorage, 104 *m_digitalStorage); 105 } 106 ~PoleFilter() { 107 delete m_analogStorage; 108 delete m_digitalStorage; 109 } 110 void setup(double sampleRate, double cutoffFrequency) { 111 Iir::Butterworth::LowPassBase::setup(MaxPoles, sampleRate, cutoffFrequency); 112 } 132 113 133 134 135 LayoutStorage*m_analogStorage;136 LayoutStorage*m_digitalStorage;114 private: 115 int MaxPoles; 116 LayoutStorage *m_analogStorage; 117 LayoutStorage *m_digitalStorage; 137 118 }; 138 119 120 class ButterworthLowPass_impl { 121 public: 122 ButterworthLowPass_impl(flair::filter::ButterworthLowPass *self, 123 const flair::gui::LayoutPosition *position, 124 std::string name, int order); 125 ~ButterworthLowPass_impl(); 126 void UpdateFrom(const flair::core::io_data *data); 127 flair::core::cvmatrix *output; 139 128 140 class ButterworthLowPass_impl 141 { 142 public: 143 ButterworthLowPass_impl(flair::filter::ButterworthLowPass* self,const flair::gui::LayoutPosition* position,std::string name,int order); 144 ~ButterworthLowPass_impl(); 145 void UpdateFrom(const flair::core::io_data *data); 146 flair::core::cvmatrix *output; 147 148 private: 149 flair::gui::DoubleSpinBox *cutoff,*T; 150 PoleFilter* f; 151 bool first_update; 152 flair::core::Time previous_time; 129 private: 130 flair::gui::DoubleSpinBox *cutoff, *T; 131 PoleFilter *f; 132 bool first_update; 133 flair::core::Time previous_time; 153 134 }; 154 135 -
trunk/lib/FlairFilter/src/unexported/EulerDerivative_impl.h
r10 r15 16 16 #include <IODevice.h> 17 17 18 namespace flair 19 { 20 namespace core 21 { 22 class cvmatrix; 23 } 24 namespace gui 25 { 26 class LayoutPosition; 27 class DoubleSpinBox; 28 } 29 namespace filter 30 { 31 class EulerDerivative; 32 } 18 namespace flair { 19 namespace core { 20 class cvmatrix; 21 } 22 namespace gui { 23 class LayoutPosition; 24 class DoubleSpinBox; 25 } 26 namespace filter { 27 class EulerDerivative; 28 } 33 29 } 34 30 … … 37 33 */ 38 34 39 class EulerDerivative_impl 40 { 41 public: 42 EulerDerivative_impl(flair::filter::EulerDerivative* self,const flair::gui::LayoutPosition* position,std::string name,const flair::core::cvmatrix* init_value=NULL); 43 ~EulerDerivative_impl(); 44 void UpdateFrom(const flair::core::io_data *data); 45 flair::core::cvmatrix *output; 35 class EulerDerivative_impl { 36 public: 37 EulerDerivative_impl(flair::filter::EulerDerivative *self, 38 const flair::gui::LayoutPosition *position, 39 std::string name, 40 const flair::core::cvmatrix *init_value = NULL); 41 ~EulerDerivative_impl(); 42 void UpdateFrom(const flair::core::io_data *data); 43 flair::core::cvmatrix *output; 46 44 47 private: 48 flair::gui::DoubleSpinBox* T; 49 flair::core::Time previous_time; 50 bool first_update; 51 flair::core::cvmatrix* prev_value; 52 45 private: 46 flair::gui::DoubleSpinBox *T; 47 flair::core::Time previous_time; 48 bool first_update; 49 flair::core::cvmatrix *prev_value; 53 50 }; 54 51 -
trunk/lib/FlairFilter/src/unexported/JoyReference_impl.h
r10 r15 24 24 25 25 namespace flair { 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 26 namespace core { 27 class cvmatrix; 28 class io_data; 29 class AhrsData; 30 } 31 namespace gui { 32 class LayoutPosition; 33 class GroupBox; 34 class DoubleSpinBox; 35 class SpinBox; 36 class Label; 37 class PushButton; 38 } 39 namespace filter { 40 class JoyReference; 41 } 42 42 } 43 43 44 44 class JoyReference_impl { 45 45 46 public: 47 JoyReference_impl(flair::filter::JoyReference *self,const flair::gui::LayoutPosition* position,std::string name); 48 ~JoyReference_impl(); 49 void SetRollAxis(float value); 50 void SetPitchAxis(float value); 51 void SetYawAxis(float value); 52 void SetAltitudeAxis(float value); 53 float ZRef(void) const; 54 float dZRef(void) const; 55 float RollTrim(void) const; 56 float PitchTrim(void) const; 57 void SetYawRef(float value); 58 void SetZRef(float value); 59 void RollTrimUp(void); 60 void RollTrimDown(void); 61 void PitchTrimUp(void); 62 void PitchTrimDown(void); 63 void Update(flair::core::Time time); 64 void UpdateFrom(const flair::core::io_data *data); 65 flair::core::cvmatrix *output; 66 flair::core::AhrsData *ahrsData; 46 public: 47 JoyReference_impl(flair::filter::JoyReference *self, 48 const flair::gui::LayoutPosition *position, 49 std::string name); 50 ~JoyReference_impl(); 51 void SetRollAxis(float value); 52 void SetPitchAxis(float value); 53 void SetYawAxis(float value); 54 void SetAltitudeAxis(float value); 55 float ZRef(void) const; 56 float dZRef(void) const; 57 float RollTrim(void) const; 58 float PitchTrim(void) const; 59 void SetYawRef(float value); 60 void SetZRef(float value); 61 void RollTrimUp(void); 62 void RollTrimDown(void); 63 void PitchTrimUp(void); 64 void PitchTrimDown(void); 65 void Update(flair::core::Time time); 66 void UpdateFrom(const flair::core::io_data *data); 67 flair::core::cvmatrix *output; 68 flair::core::AhrsData *ahrsData; 67 69 68 69 70 private: 71 flair::core::cvmatrix *input; 70 72 71 72 flair::gui::DoubleSpinBox *deb_roll,*deb_pitch,*deb_wz,*deb_dz;73 74 flair::gui::Label *label_roll,*label_pitch;75 flair::gui::PushButton *button_roll,*button_pitch;73 flair::gui::GroupBox *reglages_groupbox; 74 flair::gui::DoubleSpinBox *deb_roll, *deb_pitch, *deb_wz, *deb_dz; 75 flair::gui::DoubleSpinBox *trim; 76 flair::gui::Label *label_roll, *label_pitch; 77 flair::gui::PushButton *button_roll, *button_pitch; 76 78 77 78 flair::core::Quaternion q_z=flair::core::Quaternion(1,0,0,0);79 float trim_roll,trim_pitch;80 79 float z_ref; 80 flair::core::Quaternion q_z = flair::core::Quaternion(1, 0, 0, 0); 81 float trim_roll, trim_pitch; 82 flair::core::Time previous_time; 81 83 82 84 flair::filter::JoyReference *self; 83 85 }; 84 86 -
trunk/lib/FlairFilter/src/unexported/LowPassFilter_impl.h
r10 r15 16 16 #include <IODevice.h> 17 17 18 namespace flair 19 { 20 namespace core 21 { 22 class cvmatrix; 23 } 24 namespace gui 25 { 26 class LayoutPosition; 27 class SpinBox; 28 class DoubleSpinBox; 29 } 30 namespace filter 31 { 32 class LowPassFilter; 33 } 18 namespace flair { 19 namespace core { 20 class cvmatrix; 21 } 22 namespace gui { 23 class LayoutPosition; 24 class SpinBox; 25 class DoubleSpinBox; 26 } 27 namespace filter { 28 class LowPassFilter; 29 } 34 30 } 35 31 36 class LowPassFilter_impl 37 { 32 class LowPassFilter_impl { 38 33 39 public: 40 LowPassFilter_impl(const flair::filter::LowPassFilter* self,const flair::gui::LayoutPosition* position,std::string name,const flair::core::cvmatrix* init_value=NULL); 41 ~LowPassFilter_impl(); 42 void UpdateFrom(const flair::core::io_data *data); 43 flair::core::cvmatrix *output; 34 public: 35 LowPassFilter_impl(const flair::filter::LowPassFilter *self, 36 const flair::gui::LayoutPosition *position, 37 std::string name, 38 const flair::core::cvmatrix *init_value = NULL); 39 ~LowPassFilter_impl(); 40 void UpdateFrom(const flair::core::io_data *data); 41 flair::core::cvmatrix *output; 44 42 45 46 47 48 flair::core::cvmatrix*prev_value;49 flair::gui::DoubleSpinBox *freq,*T;43 private: 44 flair::core::Time previous_time; 45 bool first_update; 46 flair::core::cvmatrix *prev_value; 47 flair::gui::DoubleSpinBox *freq, *T; 50 48 }; 51 49 -
trunk/lib/FlairFilter/src/unexported/NestedSat_impl.h
r10 r15 16 16 #include <Object.h> 17 17 18 namespace flair 19 { 20 namespace core 21 { 22 class cvmatrix; 23 class io_data; 24 } 25 namespace gui 26 { 27 class Layout; 28 class LayoutPosition; 29 class DoubleSpinBox; 30 class DataPlot1D; 31 } 32 namespace filter 33 { 34 class NestedSat; 35 } 18 namespace flair { 19 namespace core { 20 class cvmatrix; 21 class io_data; 22 } 23 namespace gui { 24 class Layout; 25 class LayoutPosition; 26 class DoubleSpinBox; 27 class DataPlot1D; 28 } 29 namespace filter { 30 class NestedSat; 31 } 36 32 } 37 33 … … 39 35 * \brief Classe permettant le calcul d'un Pid avec saturations 40 36 */ 41 class NestedSat_impl 42 { 43 public:44 NestedSat_impl(flair::filter::NestedSat* self,const flair::gui::LayoutPosition* position,std::string name);45 46 47 void UseDefaultPlot(const flair::gui::Layout* layout,int row,int col);48 49 50 37 class NestedSat_impl { 38 public: 39 NestedSat_impl(flair::filter::NestedSat *self, 40 const flair::gui::LayoutPosition *position, std::string name); 41 ~NestedSat_impl(); 42 float Value(void); 43 void UseDefaultPlot(const flair::gui::Layout *layout, int row, int col); 44 void UpdateFrom(const flair::core::io_data *data); 45 void ConvertSatFromDegToRad(void); 46 float k; 51 47 52 53 flair::filter::NestedSat*self;54 flair::gui::DoubleSpinBox *kp,*kd,*sat,*dsat,*usat;55 56 float Sat(float value,float borne);48 private: 49 flair::filter::NestedSat *self; 50 flair::gui::DoubleSpinBox *kp, *kd, *sat, *dsat, *usat; 51 flair::gui::DataPlot1D *plot; 52 float Sat(float value, float borne); 57 53 }; 58 54 59 60 55 #endif // NESTEDSAT_IMPL_H -
trunk/lib/FlairFilter/src/unexported/PidThrust_impl.h
r10 r15 16 16 #include <Object.h> 17 17 18 namespace flair 19 { 20 namespace core 21 { 22 class cvmatrix; 23 class io_data; 24 } 25 namespace gui 26 { 27 class LayoutPosition; 28 class DoubleSpinBox; 29 } 30 namespace filter 31 { 32 class PidThrust; 33 } 18 namespace flair { 19 namespace core { 20 class cvmatrix; 21 class io_data; 22 } 23 namespace gui { 24 class LayoutPosition; 25 class DoubleSpinBox; 26 } 27 namespace filter { 28 class PidThrust; 29 } 34 30 } 35 31 … … 38 34 */ 39 35 40 class PidThrust_impl 41 { 42 public:43 PidThrust_impl(flair::filter::PidThrust* self,const flair::gui::LayoutPosition* position,std::string name);44 45 void UseDefaultPlot(const flair::gui::LayoutPosition*position);46 47 float i,offset_g;48 flair::gui::DoubleSpinBox *offset,*pas_offset;36 class PidThrust_impl { 37 public: 38 PidThrust_impl(flair::filter::PidThrust *self, 39 const flair::gui::LayoutPosition *position, std::string name); 40 ~PidThrust_impl(); 41 void UseDefaultPlot(const flair::gui::LayoutPosition *position); 42 void UpdateFrom(const flair::core::io_data *data); 43 float i, offset_g; 44 flair::gui::DoubleSpinBox *offset, *pas_offset; 49 45 50 51 flair::filter::PidThrust*self;52 53 46 private: 47 flair::filter::PidThrust *self; 48 flair::core::Time previous_time; 49 bool first_update; 54 50 55 //matrix56 51 // matrix 52 flair::core::cvmatrix *state; 57 53 58 flair::gui::DoubleSpinBox *T,*kp,*ki,*kd,*sat,*sati;54 flair::gui::DoubleSpinBox *T, *kp, *ki, *kd, *sat, *sati; 59 55 }; 60 56 -
trunk/lib/FlairFilter/src/unexported/Pid_impl.h
r10 r15 16 16 #include <Object.h> 17 17 18 namespace flair 19 { 20 namespace core 21 { 22 class cvmatrix; 23 class io_data; 24 } 25 namespace gui 26 { 27 class LayoutPosition; 28 class DoubleSpinBox; 29 } 30 namespace filter 31 { 32 class Pid; 33 } 18 namespace flair { 19 namespace core { 20 class cvmatrix; 21 class io_data; 22 } 23 namespace gui { 24 class LayoutPosition; 25 class DoubleSpinBox; 26 } 27 namespace filter { 28 class Pid; 29 } 34 30 } 35 31 … … 38 34 */ 39 35 40 class Pid_impl 41 { 42 public:43 Pid_impl(flair::filter::Pid* self,const flair::gui::LayoutPosition* position,std::string name);44 45 void UseDefaultPlot(const flair::gui::LayoutPosition*position);46 47 48 36 class Pid_impl { 37 public: 38 Pid_impl(flair::filter::Pid *self, const flair::gui::LayoutPosition *position, 39 std::string name); 40 ~Pid_impl(); 41 void UseDefaultPlot(const flair::gui::LayoutPosition *position); 42 void UpdateFrom(const flair::core::io_data *data); 43 float i; 44 bool first_update; 49 45 50 51 flair::filter::Pid*self;52 46 private: 47 flair::filter::Pid *self; 48 flair::core::Time previous_time; 53 49 54 //matrix55 50 // matrix 51 flair::core::cvmatrix *state; 56 52 57 flair::gui::DoubleSpinBox *T,*kp,*ki,*kd,*sat,*sati;53 flair::gui::DoubleSpinBox *T, *kp, *ki, *kd, *sat, *sati; 58 54 }; 59 55 -
trunk/lib/FlairFilter/src/unexported/TrajectoryGenerator1D_impl.h
r10 r15 14 14 #define TRAJECTORYGENERATOR1D_IMPL_H 15 15 16 namespace flair 17 { 18 namespace core 19 { 20 class cvmatrix; 21 } 22 namespace gui 23 { 24 class LayoutPosition; 25 class DoubleSpinBox; 26 } 16 namespace flair { 17 namespace core { 18 class cvmatrix; 19 } 20 namespace gui { 21 class LayoutPosition; 22 class DoubleSpinBox; 23 } 27 24 } 28 25 … … 30 27 * \brief Class generating a trajectory in 1D 31 28 */ 32 class TrajectoryGenerator1D_impl 33 { 29 class TrajectoryGenerator1D_impl { 34 30 35 public: 36 TrajectoryGenerator1D_impl(flair::filter::TrajectoryGenerator1D* self,const flair::gui::LayoutPosition* position,std::string name,std::string unit); 37 ~TrajectoryGenerator1D_impl(); 38 void Update(flair::core::Time time); 39 void StartTraj(float start_pos,float end_pos); 40 void StopTraj(void); 41 void Reset(void); 42 flair::core::cvmatrix *output; 43 float pos_off,vel_off; 44 bool is_finished,is_started; 31 public: 32 TrajectoryGenerator1D_impl(flair::filter::TrajectoryGenerator1D *self, 33 const flair::gui::LayoutPosition *position, 34 std::string name, std::string unit); 35 ~TrajectoryGenerator1D_impl(); 36 void Update(flair::core::Time time); 37 void StartTraj(float start_pos, float end_pos); 38 void StopTraj(void); 39 void Reset(void); 40 flair::core::cvmatrix *output; 41 float pos_off, vel_off; 42 bool is_finished, is_started; 45 43 46 47 48 float pos,v,acc;49 50 51 flair::gui::DoubleSpinBox *T,*max_veloctity,*acceleration;44 private: 45 float end_position; 46 float pos, v, acc; 47 flair::core::Time previous_time; 48 bool first_update; 49 flair::gui::DoubleSpinBox *T, *max_veloctity, *acceleration; 52 50 }; 53 51 -
trunk/lib/FlairFilter/src/unexported/TrajectoryGenerator2DCircle_impl.h
r10 r15 17 17 #include <Vector2D.h> 18 18 19 namespace flair 20 { 21 namespace core 22 { 23 class cvmatrix; 24 class io_data; 25 } 26 namespace gui 27 { 28 class LayoutPosition; 29 class DoubleSpinBox; 30 } 31 namespace filter 32 { 33 class TrajectoryGenerator2DCircle; 34 } 19 namespace flair { 20 namespace core { 21 class cvmatrix; 22 class io_data; 35 23 } 36 24 namespace gui { 25 class LayoutPosition; 26 class DoubleSpinBox; 27 } 28 namespace filter { 29 class TrajectoryGenerator2DCircle; 30 } 31 } 37 32 38 33 /*! \class TrajectoryGenerator2DCircle_impl … … 40 35 */ 41 36 42 class TrajectoryGenerator2DCircle_impl 43 { 37 class TrajectoryGenerator2DCircle_impl { 44 38 45 public: 46 TrajectoryGenerator2DCircle_impl(flair::filter::TrajectoryGenerator2DCircle* self,const flair::gui::LayoutPosition* position,std::string name); 47 ~TrajectoryGenerator2DCircle_impl(); 48 void Update(flair::core::Time time); 49 void StartTraj(const flair::core::Vector2D &start_pos,float nb_lap); 50 void FinishTraj(void); 51 bool is_running; 52 flair::core::cvmatrix *output; 53 flair::core::Vector2D pos_off,vel_off; 39 public: 40 TrajectoryGenerator2DCircle_impl( 41 flair::filter::TrajectoryGenerator2DCircle *self, 42 const flair::gui::LayoutPosition *position, std::string name); 43 ~TrajectoryGenerator2DCircle_impl(); 44 void Update(flair::core::Time time); 45 void StartTraj(const flair::core::Vector2D &start_pos, float nb_lap); 46 void FinishTraj(void); 47 bool is_running; 48 flair::core::cvmatrix *output; 49 flair::core::Vector2D pos_off, vel_off; 54 50 55 56 57 float CurrentTime,FinishTime;58 bool first_update,is_finishing;59 60 61 flair::gui::DoubleSpinBox *T,*veloctity,*acceleration,*rayon;62 51 private: 52 flair::core::Time previous_time; 53 float CurrentTime, FinishTime; 54 bool first_update, is_finishing; 55 flair::core::Vector2D pos; 56 float angle_off; 57 flair::gui::DoubleSpinBox *T, *veloctity, *acceleration, *rayon; 58 float nb_lap; 63 59 }; 64 60 -
trunk/lib/FlairFilter/src/unexported/UavMultiplex_impl.h
r10 r15 17 17 #include <string> 18 18 19 namespace flair 20 { 21 namespace core 22 { 23 class FrameworkManager; 24 class cvmatrix; 25 class io_data; 26 } 27 namespace gui 28 { 29 class Tab; 30 class ComboBox; 31 class GroupBox; 32 class TabWidget; 33 } 34 namespace filter 35 { 36 class UavMultiplex; 37 } 19 namespace flair { 20 namespace core { 21 class FrameworkManager; 22 class cvmatrix; 23 class io_data; 38 24 } 39 25 namespace gui { 26 class Tab; 27 class ComboBox; 28 class GroupBox; 29 class TabWidget; 30 } 31 namespace filter { 32 class UavMultiplex; 33 } 34 } 40 35 41 36 /*! \class UavMultiplex_impl … … 43 38 * \brief Class defining uav multiplexing 44 39 */ 45 class UavMultiplex_impl 46 { 47 public: 40 class UavMultiplex_impl { 41 public: 42 /*! 43 * \brief Constructor 44 * 45 * Construct a uav multiplexing 46 * 47 * \param parent parent 48 * \param name name 49 */ 50 UavMultiplex_impl(const flair::core::FrameworkManager *parent, 51 flair::filter::UavMultiplex *self, std::string name); 48 52 49 /*! 50 * \brief Constructor 51 * 52 * Construct a uav multiplexing 53 * 54 * \param parent parent 55 * \param name name 56 */ 57 UavMultiplex_impl(const flair::core::FrameworkManager* parent,flair::filter::UavMultiplex* self,std::string name); 53 /*! 54 * \brief Destructor 55 * 56 */ 57 ~UavMultiplex_impl(); 58 58 59 /*! 60 * \brief Destructor 61 * 62 */ 63 ~UavMultiplex_impl(); 59 flair::core::cvmatrix *input; 60 void SetMultiplexComboBox(std::string name, int index); 61 int MultiplexValue(int index) const; 64 62 65 flair::core::cvmatrix *input; 66 void SetMultiplexComboBox(std::string name,int index); 67 int MultiplexValue(int index) const; 63 flair::gui::TabWidget *tabwidget; 64 flair::gui::Tab *setup_tab; 68 65 69 flair::gui::TabWidget* tabwidget; 70 flair::gui::Tab *setup_tab; 71 72 private: 73 flair::gui::Tab *main_tab; 74 flair::gui::ComboBox **multiplexcombobox; 75 flair::gui::GroupBox *groupbox; 76 flair::filter::UavMultiplex* self; 66 private: 67 flair::gui::Tab *main_tab; 68 flair::gui::ComboBox **multiplexcombobox; 69 flair::gui::GroupBox *groupbox; 70 flair::filter::UavMultiplex *self; 77 71 }; 78 72 -
trunk/lib/FlairFilter/src/unexported/X4X8Multiplex_impl.h
r10 r15 16 16 #include <string> 17 17 18 namespace flair 19 { 20 namespace core 21 { 22 class cvmatrix; 23 class io_data; 24 } 25 namespace gui 26 { 27 class DataPlot1D; 28 class ComboBox; 29 } 30 namespace filter 31 { 32 class X4X8Multiplex; 33 } 18 namespace flair { 19 namespace core { 20 class cvmatrix; 21 class io_data; 34 22 } 35 23 namespace gui { 24 class DataPlot1D; 25 class ComboBox; 26 } 27 namespace filter { 28 class X4X8Multiplex; 29 } 30 } 36 31 37 32 /*! \class X4X8Multiplex_impl … … 39 34 * \brief Class defining X4 and X8 multiplexing 40 35 */ 41 class X4X8Multiplex_impl 42 { 43 public: 44 X4X8Multiplex_impl(flair::filter::X4X8Multiplex* self,int nb_mot); 45 ~X4X8Multiplex_impl(); 46 void UseDefaultPlot(void); 47 void UpdateFrom(const flair::core::io_data *data); 48 int nb_mot; 49 std::string MotorName(int index); 36 class X4X8Multiplex_impl { 37 public: 38 X4X8Multiplex_impl(flair::filter::X4X8Multiplex *self, int nb_mot); 39 ~X4X8Multiplex_impl(); 40 void UseDefaultPlot(void); 41 void UpdateFrom(const flair::core::io_data *data); 42 int nb_mot; 43 std::string MotorName(int index); 50 44 51 52 53 54 55 flair::filter::X4X8Multiplex*self;56 float Set(float trim,float u);45 private: 46 flair::core::cvmatrix *output; 47 flair::gui::ComboBox *pas; 48 flair::gui::DataPlot1D *plots[4]; 49 flair::filter::X4X8Multiplex *self; 50 float Set(float trim, float u); 57 51 }; 58 52
Note:
See TracChangeset
for help on using the changeset viewer.