source: flair-src/trunk/lib/FlairSensorActuator/src/Imu.h@ 173

Last change on this file since 173 was 173, checked in by Sanahuja Guillaume, 7 years ago

modif imu

File size: 3.0 KB
Line 
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/*!
6 * \file Imu.h
7 * \brief Base class for Imu
8 * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2014/01/16
10 * \version 4.0
11 */
12
13#ifndef IMU_H
14#define IMU_H
15
16#include <IODevice.h>
17#include <Vector3D.h>
18
19namespace flair {
20 namespace core {
21 class ImuData;
22 class OneAxisRotation;
23 }
24 namespace gui {
25 class Tab;
26 class TabWidget;
27 class GroupBox;
28 class Layout;
29 class DataPlot1D;
30 }
31}
32
33class Ahrs_impl;
34
35namespace flair {
36namespace sensor {
37/*! \class Imu
38*
39* \brief Base class for Imu
40*
41* Use this class to define a custom Imu.
42*
43*/
44class Imu : public core::IODevice {
45 friend class ::Ahrs_impl;
46
47public:
48 /*!
49 * \brief Constructor
50 *
51 * Construct an Imu.
52 * It will be child of the FrameworkManager.
53 *
54 * \param name name
55 */
56 Imu(std::string name);
57
58 /*!
59 * \brief Constructor
60 *
61 * Construct an Imu. \n
62 * This contructor must only be called for a simulated device.
63 *
64 * \param parent parent
65 * \param name name
66 */
67 Imu(const core::IODevice *parent, std::string name);
68
69 /*!
70 * \brief Destructor
71 *
72 */
73 ~Imu();
74
75 /*!
76 * \brief Setup Layout
77 *
78 * \return setup Layout
79 */
80 gui::Layout *GetLayout(void) const;
81
82 /*!
83 * \brief Lock user interface
84 *
85 */
86 void LockUserInterface(void) const;
87
88 /*!
89 * \brief Unlock user interface
90 *
91 */
92 void UnlockUserInterface(void) const;
93
94 /*!
95 * \brief Use default plot
96 *
97 */
98 void UseDefaultPlot(void);
99
100 /*!
101 * \brief Plot tab
102 *
103 * \return plot Tab
104 */
105 gui::Tab *GetPlotTab(void) const;
106
107 /*!
108 * \brief Get OneAxisRotation
109 *
110 * \return fixed rotation of the imu
111 */
112 core::OneAxisRotation *GetOneAxisRotation(void) const;
113
114
115protected:
116 /*!
117 * \brief Setup GroupBox
118 *
119 * \return setup GroupBox
120 */
121 gui::GroupBox *GetGroupBox(void) const;
122
123 /*!
124 * \brief ApplyRotation
125 *
126 * The reimplemented class must call this function to rotate IMU datas, before filling the ImuData. \n
127 * It handles the data rotation if it was defined.
128 *
129 * \param vector vector to apply rotation to
130 */
131 void ApplyRotation(core::Vector3Df& vector);
132
133 /*!
134 * \brief ApplyRotation
135 *
136 * The reimplemented class must call this function to rotate IMU datas, before filling the ImuData. \n
137 * It handles the data rotation if it was defined.
138 *
139 * \param quaternion quaternion to apply rotation to
140 */
141 void ApplyRotation(core::Quaternion& quaternion);
142
143 /*!
144 * \brief Get imu datas
145 *
146 * \param imuData imu datas
147 */
148 void GetDatas(core::ImuData **imuData) const;
149
150private:
151 gui::Tab *mainTab, *sensorTab, *plotTab;
152 gui::TabWidget *tab;
153 gui::GroupBox *setupGroupbox;
154 core::OneAxisRotation *rotation;
155 core::ImuData *imuData;
156
157 gui::DataPlot1D *axPlot, *ayPlot, *azPlot;
158 gui::DataPlot1D *gxPlot, *gyPlot, *gzPlot;
159 gui::DataPlot1D *mxPlot, *myPlot, *mzPlot;
160};
161} // end namespace sensor
162} // end namespace flair
163
164#endif // IMU_H
Note: See TracBrowser for help on using the repository browser.