source: flair-dev/trunk/include/FlairSensorActuator/Imu.h @ 50

Last change on this file since 50 was 50, checked in by Sanahuja Guillaume, 4 years ago

doc

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