Laelaps  2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
laeThreadImu.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: Laelaps
4 //
5 // File: laeThreadImu.h
6 //
7 /*! \file
8  *
9  * $LastChangedDate: 2015-08-07 14:25:35 -0600 (Fri, 07 Aug 2015) $
10  * $Rev: 4051 $
11  *
12  * \brief Laelaps IMU thread class interface.
13  *
14  * \author Robin Knight (robin.knight@roadnarrows.com)
15  *
16  * \par Copyright
17  * \h_copy 2015-2018. RoadNarrows LLC.\n
18  * http://www.roadnarrows.com\n
19  * All Rights Reserved
20  */
21 /*
22  * @EulaBegin@
23  *
24  * Unless otherwise stated explicitly, all materials contained are copyrighted
25  * and may not be used without RoadNarrows LLC's written consent,
26  * except as provided in these terms and conditions or in the copyright
27  * notice (documents and software) or other proprietary notice provided with
28  * the relevant materials.
29  *
30  * IN NO EVENT SHALL THE AUTHOR, ROADNARROWS LLC, OR ANY
31  * MEMBERS/EMPLOYEES/CONTRACTORS OF ROADNARROWS OR DISTRIBUTORS OF THIS SOFTWARE
32  * BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
33  * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
34  * DOCUMENTATION, EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN
35  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  *
37  * THE AUTHORS AND ROADNARROWS LLC SPECIFICALLY DISCLAIM ANY WARRANTIES,
38  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
39  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
40  * "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO
41  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
42  *
43  * @EulaEnd@
44  */
45 ////////////////////////////////////////////////////////////////////////////////
46 
47 #ifndef _LAE_THREAD_IMU_H
48 #define _LAE_THREAD_IMU_H
49 
50 #include <sys/types.h>
51 #include <sys/time.h>
52 #include <time.h>
53 #include <pthread.h>
54 
55 #include <string>
56 
57 #include "rnr/rnrconfig.h"
58 #include "rnr/log.h"
59 
60 #include "Laelaps/laelaps.h"
61 #include "Laelaps/laeUtils.h"
62 #include "Laelaps/laeTune.h"
63 
64 #include "Laelaps/laeImu.h"
65 
66 #include "Laelaps/laeThread.h"
67 
68 /*!
69  * \brief The \h_laelaps namespace encapsulates all \h_laelaps related
70  * constructs.
71  */
72 namespace laelaps
73 {
74  //----------------------------------------------------------------------------
75  // LaeThreadImu Class
76  //----------------------------------------------------------------------------
77 
78  /*!
79  * IMU thread class.
80  */
81  class LaeThreadImu : public LaeThread
82  {
83  public:
84  static const double ThreadImuPrioDft; ///< default priority
85  static const double ThreadImuHzDft; ///< default run rate
86 
87  /*!
88  * \brief Default constructor.
89  */
91 
92  /*!
93  * \brief Destructor.
94  */
95  virtual ~LaeThreadImu();
96 
97  /*!
98  * \brief Reload tunable paramaters.
99  *
100  * This function executes under the lock/unlock mutex.
101  */
102  int reload(const LaeTunes &tunes);
103 
104  protected:
105  sensor::imu::LaeImuCleanFlight &m_hwif; ///< hardware interface
106 
107  /*!
108  * \brief Execute watchdog task within scheduled cycle.
109  *
110  * This function executes under the lock/unlock mutex.
111  *
112  * \par Context:
113  * This thread.
114  */
115  virtual void exec();
116  };
117 
118 } // namespace laelaps
119 
120 
121 #endif // _LAE_THREAD_IMU_H
virtual void exec()
Execute watchdog task within scheduled cycle.
Laelaps thread base class interface.
int reload(const LaeTunes &tunes)
Reload tunable paramaters.
Laelaps tuning data class.
Definition: laeTune.h:566
virtual ~LaeThreadImu()
Destructor.
LaeThreadImu(sensor::imu::LaeImuCleanFlight &hwif)
Default constructor.
static const double ThreadImuHzDft
default run rate
Definition: laeThreadImu.h:85
The <b><i>Laelaps</i></b> namespace encapsulates all <b><i>Laelaps</i></b> related constructs...
Definition: laeAlarms.h:64
Laelaps common utilities.
Laelaps built-in Inertial Measurement Unit class interface.
Laelaps tuning.
static const double ThreadImuPrioDft
default priority
Definition: laeThreadImu.h:84
sensor::imu::LaeImuCleanFlight & m_hwif
hardware interface
Definition: laeThreadImu.h:105
Top-level package include file.