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

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

modifs imu

File size: 3.3 KB
RevLine 
[3]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[3]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>
[173]17#include <Vector3D.h>
[3]18
19namespace flair {
[51]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 }
[3]31}
32
33class Ahrs_impl;
34
[15]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;
[3]46
[15]47public:
48 /*!
49 * \brief Constructor
50 *
51 * Construct an Imu.
[137]52 * It will be child of the FrameworkManager.
[15]53 *
54 * \param name name
[198]55 * \param needRotation true will enable post rotation in GCS. Post rotation must be applied manually in reimplemented code
[15]56 */
[198]57 Imu(std::string name,bool needRotation=true);
[3]58
[15]59 /*!
60 * \brief Constructor
61 *
62 * Construct an Imu. \n
63 * This contructor must only be called for a simulated device.
64 *
65 * \param parent parent
66 * \param name name
67 */
68 Imu(const core::IODevice *parent, std::string name);
[3]69
[15]70 /*!
71 * \brief Destructor
72 *
73 */
74 ~Imu();
[179]75
76 /*!
77 * \brief Get IMU datas
78 *
79 * \return ImuData
80 */
81 const core::ImuData *GetDatas(void) const;
[3]82
[179]83
[15]84 /*!
85 * \brief Setup Layout
86 *
87 * \return setup Layout
88 */
89 gui::Layout *GetLayout(void) const;
[3]90
[15]91 /*!
92 * \brief Lock user interface
93 *
94 */
95 void LockUserInterface(void) const;
[3]96
[15]97 /*!
98 * \brief Unlock user interface
99 *
100 */
101 void UnlockUserInterface(void) const;
[3]102
[15]103 /*!
104 * \brief Use default plot
105 *
106 */
107 void UseDefaultPlot(void);
[3]108
[15]109 /*!
110 * \brief Plot tab
111 *
112 * \return plot Tab
113 */
114 gui::Tab *GetPlotTab(void) const;
[3]115
[99]116 /*!
117 * \brief Get OneAxisRotation
118 *
119 * \return fixed rotation of the imu
120 */
121 core::OneAxisRotation *GetOneAxisRotation(void) const;
122
123
[15]124protected:
125 /*!
126 * \brief Setup GroupBox
127 *
128 * \return setup GroupBox
129 */
130 gui::GroupBox *GetGroupBox(void) const;
[3]131
[15]132 /*!
[173]133 * \brief ApplyRotation
[15]134 *
[173]135 * The reimplemented class must call this function to rotate IMU datas, before filling the ImuData. \n
[15]136 * It handles the data rotation if it was defined.
137 *
[173]138 * \param vector vector to apply rotation to
[15]139 */
[173]140 void ApplyRotation(core::Vector3Df& vector);
141
142 /*!
143 * \brief ApplyRotation
144 *
145 * The reimplemented class must call this function to rotate IMU datas, before filling the ImuData. \n
146 * It handles the data rotation if it was defined.
147 *
148 * \param quaternion quaternion to apply rotation to
149 */
150 void ApplyRotation(core::Quaternion& quaternion);
[3]151
[15]152 /*!
153 * \brief Get imu datas
154 *
[179]155 * Can be used by dervied class to fill core::ImuData
156 *
[15]157 * \param imuData imu datas
158 */
159 void GetDatas(core::ImuData **imuData) const;
[3]160
[15]161private:
162 gui::Tab *mainTab, *sensorTab, *plotTab;
163 gui::TabWidget *tab;
164 gui::GroupBox *setupGroupbox;
165 core::OneAxisRotation *rotation;
166 core::ImuData *imuData;
[3]167
[15]168 gui::DataPlot1D *axPlot, *ayPlot, *azPlot;
169 gui::DataPlot1D *gxPlot, *gyPlot, *gzPlot;
170 gui::DataPlot1D *mxPlot, *myPlot, *mzPlot;
171};
[3]172} // end namespace sensor
173} // end namespace flair
174
175#endif // IMU_H
Note: See TracBrowser for help on using the repository browser.