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 Matrix;
27 class I2cPort;
28 }
29 namespace gui {
30 class TabWidget;
31 class Tab;
32 class SpinBox;
33 class DoubleSpinBox;
34 class ComboBox;
35 class PushButton;
36 class GroupBox;
37 }
38 }
39 
40 namespace flair {
41 namespace actuator {
43 
44 public:
45  BlCtrlV2_x4_speed(std::string name,
46  core::I2cPort *i2cport, uint8_t base_address,
47  uint8_t priority);
49  void UseDefaultPlot(void);
50  void LockUserInterface(void);
51  void UnlockUserInterface(void);
52  void SetEnabled(bool status);
53  void SetUroll(float value);
54  void SetUpitch(float value);
55  void SetUyaw(float value);
56  void SetUgaz(float value);
57  void SetRollTrim(float value);
58  void SetPitchTrim(float value);
59  void SetYawTrim(float value);
60  void SetGazTrim(float value);
61  float TrimValue(void);
62  int StartValue(void);
63 
64 private:
72  void UpdateFrom(core::io_data *data){};
73  void WriteValue(uint16_t value);
74  float GetSpeed(void);
75  void StartTest(void);
76  void StopTest(void);
83  void Run(void);
84  void Update(void);
85  gui::Tab *main_tab;
86  gui::TabWidget *tab;
87  gui::GroupBox *reglages_groupbox;
88  gui::SpinBox *min, *max, *test;
89  gui::PushButton *button_avg, *button_avd, *button_arg, *button_ard;
90  gui::ComboBox *av_g, *av_d, *ar_g, *ar_d, *pas;
91  gui::DoubleSpinBox *trim, *kp, *ki;
92  gui::SpinBox *start_value, *poles;
93  core::Time start_time, flight_start_time;
94  int time_sec;
95  float speed_av_g, speed_av_d, speed_ar_g, speed_ar_d;
96  float int_av_g, int_av_d, int_ar_g, int_ar_d;
97 
98  // matrix
99  core::Matrix *input;
100  core::Matrix *output;
101 
102  int tested_motor;
103  core::I2cPort *i2cport;
104  uint8_t slave_address;
105 
106  bool enabled;
107 
108  uint16_t SatPWM(float vel_cons, uint16_t min, uint16_t max);
109 };
110 } // end namespace actuator
111 } // end namespace flair
112 #endif // BLCTRLV2_X4_SPEED_H
Abstract class for data types.
Definition: io_data.h:94
Abstract class for input/ouput system.
Definition: IODevice.h:45
namespace of the flair Framework
Definition: Ahrs.h:19
Class displaying a QGroupBox on the ground station.
Definition: GroupBox.h:27
unsigned long long Time
Time definition, in ns.
Definition: Object.h:55
Class displaying a QSpinBox on the ground station.
Definition: SpinBox.h:28
Abstract class for input/ouput system.
Definition: BlCtrlV2_x4_speed.h:42
Class displaying a QPushButton on the ground station.
Definition: PushButton.h:28
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 defining a matrix.
Definition: Matrix.h:31
Class displaying a QTab on the ground station.
Definition: Tab.h:29