Flair
Framework Libre Air
BlCtrlV2_x4_speed.h
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
5 // created: 2013/04/29
6 // filename: BlCtrlV2_x4_speed.cpp
7 //
8 // author: Guillaume Sanahuja
9 // Copyright Heudiasyc UMR UTC/CNRS 7253
10 //
11 // version: $Id: $
12 //
13 // purpose: objet integrant les moteurs i2c, controle en vitesse
14 //
15 //
16 /*********************************************************************/
17 
18 #ifndef BLCTRLV2_X4_SPEED_H
19 #define BLCTRLV2_X4_SPEED_H
20 
21 #include <IODevice.h>
22 #include <Thread.h>
23 
24 namespace flair {
25 namespace core {
26 class cvmatrix;
27 class FrameworkManager;
28 class I2cPort;
29 }
30 namespace gui {
31 class TabWidget;
32 class Tab;
33 class SpinBox;
34 class DoubleSpinBox;
35 class ComboBox;
36 class PushButton;
37 class GroupBox;
38 }
39 }
40 
41 namespace flair {
42 namespace actuator {
44 
45 public:
46  BlCtrlV2_x4_speed(core::FrameworkManager *parent, std::string name,
47  core::I2cPort *i2cport, uint8_t base_address,
48  uint8_t priority);
50  void UseDefaultPlot(void);
51  void LockUserInterface(void);
52  void UnlockUserInterface(void);
53  void SetEnabled(bool status);
54  void SetUroll(float value);
55  void SetUpitch(float value);
56  void SetUyaw(float value);
57  void SetUgaz(float value);
58  void SetRollTrim(float value);
59  void SetPitchTrim(float value);
60  void SetYawTrim(float value);
61  void SetGazTrim(float value);
62  float TrimValue(void);
63  int StartValue(void);
64 
65 private:
73  void UpdateFrom(core::io_data *data){};
74  void WriteValue(uint16_t value);
75  float GetSpeed(void);
76  void StartTest(void);
77  void StopTest(void);
84  void Run(void);
85  void Update(void);
86  gui::Tab *main_tab;
87  gui::TabWidget *tab;
88  gui::GroupBox *reglages_groupbox;
89  gui::SpinBox *min, *max, *test;
90  gui::PushButton *button_avg, *button_avd, *button_arg, *button_ard;
91  gui::ComboBox *av_g, *av_d, *ar_g, *ar_d, *pas;
92  gui::DoubleSpinBox *trim, *kp, *ki;
93  gui::SpinBox *start_value, *poles;
94  core::Time start_time, flight_start_time;
95  int time_sec;
96  float speed_av_g, speed_av_d, speed_ar_g, speed_ar_d;
97  float int_av_g, int_av_d, int_ar_g, int_ar_d;
98 
99  // matrix
100  core::cvmatrix *input;
101  core::cvmatrix *output;
102 
103  int tested_motor;
104  core::I2cPort *i2cport;
105  uint8_t slave_address;
106 
107  bool enabled;
108 
109  uint16_t SatPWM(float vel_cons, uint16_t min, uint16_t max);
110 };
111 } // end namespace actuator
112 } // end namespace flair
113 #endif // BLCTRLV2_X4_SPEED_H
Abstract class for data types.
Definition: io_data.h:94
Abstract class for input/ouput system.
Definition: IODevice.h:44
namespace of the flair Framework
Definition: Ahrs.h:19
Class defining a matrix of kind CvMat.
Definition: cvmatrix.h:33
Class displaying a QGroupBox on the ground station.
Definition: GroupBox.h:27
unsigned long long Time
Time definition, in ns.
Definition: Object.h:49
Class displaying a QSpinBox on the ground station.
Definition: SpinBox.h:28
Abstract class for input/ouput system.
Definition: BlCtrlV2_x4_speed.h:43
Class displaying a QPushButton on the ground station.
Definition: PushButton.h:28
Main class of the Framework library.
Definition: FrameworkManager.h:45
Class displaying a QTabWidget on the ground station.
Definition: TabWidget.h:29
Abstract class for a thread.
Abstract class for a thread.
Definition: Thread.h:38
Class displaying a QDoubleSpinBox on the ground station.
Definition: DoubleSpinBox.h:28
Class displaying a QComboBox on the ground station.
Definition: ComboBox.h:28
Base class for i2c port.
Definition: I2cPort.h:31
Class displaying a QTab on the ground station.
Definition: Tab.h:29