source: flair-src/trunk/lib/FlairSensorActuator/src/SimuImu.h@ 191

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

maj imu

File size: 2.1 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 SimuImu.h
7 * \brief Class for a simulation Imu
8 * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2014/02/07
10 * \version 4.0
11 */
12
13#ifndef SIMUIMU_H
14#define SIMUIMU_H
15
16#include <Imu.h>
17#include <Thread.h>
18
19namespace flair {
20 namespace core {
21 class SharedMem;
22 class AhrsData;
23 }
24 namespace gui {
25 class SpinBox;
26 }
27}
28
29namespace flair {
30namespace sensor {
31/*! \class SimuImu
32*
33* \brief Class for a simulation Imu
34*/
35class SimuImu : public Imu, public core::Thread {
36public:
37 /*!
38 * \brief Constructor
39 *
40 * Construct a SimuImu. Control part.
41 * It will be child of the FrameworkManager.
42 *
43 * \param name name
44 * \param modelId Model id
45 * \param deviceId Imu id of the Model
46 * \param priority priority of the Thread
47 */
48 SimuImu(std::string name,
49 uint32_t modelId,uint32_t deviceId, uint8_t priority);
50
51 /*!
52 * \brief Constructor
53 *
54 * Construct a SimuImu. Simulation part.\n
55 * The Thread of this class should not be run.
56 *
57 * \param parent parent
58 * \param name name
59 * \param modelId Model id
60 * \param deviceId Imu id of the Model
61 */
62 SimuImu(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId);
63
64 /*!
65 * \brief Destructor
66 *
67 */
68 ~SimuImu();
69
70private:
71 /*!
72 * \brief Run function
73 *
74 * Reimplemented from Thread.
75 *
76 */
77 void Run(void);
78
79 /*!
80 * \brief Update using provided datas
81 *
82 * Reimplemented from IODevice.
83 *
84 * \param data data from the parent to process
85 */
86 void UpdateFrom(const core::io_data *data);
87
88 typedef struct {
89 float q0;
90 float q1;
91 float q2;
92 float q3;
93 float wx;
94 float wy;
95 float wz;
96 float ax;
97 float ay;
98 float az;
99 float mx;
100 float my;
101 float mz;
102 } imu_states_t;
103
104 std::string ShMemName(uint32_t modelId,uint32_t deviceId);
105
106 gui::SpinBox *dataRate;
107 core::SharedMem *shmem;
108 core::AhrsData *ahrsData;
109};
110} // end namespace sensor
111} // end namespace flair
112#endif // SIMUIMU_H
Note: See TracBrowser for help on using the repository browser.