Changeset 15 in flair-src for trunk/lib/FlairCore/src/AhrsData.h


Ignore:
Timestamp:
04/08/16 15:40:57 (8 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/AhrsData.h

    r2 r15  
    1818#include <Quaternion.h>
    1919
    20 namespace flair { namespace core {
     20namespace flair {
     21namespace core {
    2122
    22     /*! \class AhrsData
    23     *
    24     * \brief Class defining AHRS datas
    25     *
    26     * AHRS datas consist of quaternion and rotational angles values. \n
    27     *
    28     */
    29     class AhrsData: public io_data {
    30         public:
    31             class Type: public DataType {
    32             public:
    33                 Type(const ScalarType &inElementDataType):
    34                     elementDataType(inElementDataType) {}
    35                 const ScalarType  &GetElementDataType() const {return elementDataType;}
    36                 std::string GetDescription() const {return "ahrs data";}
    37                 size_t GetSize() const {
    38                     return 7*elementDataType.GetSize();
    39                 }
    40             private:
    41                 const ScalarType &elementDataType;
    42             };
     23/*! \class AhrsData
     24*
     25* \brief Class defining AHRS datas
     26*
     27* AHRS datas consist of quaternion and rotational angles values. \n
     28*
     29*/
     30class AhrsData : public io_data {
     31public:
     32  class Type : public DataType {
     33  public:
     34    Type(const ScalarType &inElementDataType)
     35        : elementDataType(inElementDataType) {}
     36    const ScalarType &GetElementDataType() const { return elementDataType; }
     37    std::string GetDescription() const { return "ahrs data"; }
     38    size_t GetSize() const { return 7 * elementDataType.GetSize(); }
    4339
    44             /*!
    45             \enum PlotableData_t
    46             \brief Datas wich can be plotted in a DataPlot1D
    47             */
    48             typedef enum {
    49                 Roll/*! roll */, Pitch/*! pitch */, Yaw/*! yaw */,
    50                 RollDeg/*! roll degree*/, PitchDeg/*! pitch degree */, YawDeg/*! yaw degree */,
    51                 Q0/*! quaternion 0 */, Q1/*! quaternion 1 */, Q2/*! quaternion 2 */, Q3/*! quaternion 3 */,
    52                 Wx/*! x filtered angular rate */, Wy/*! y filtered angular rate */, Wz/*! z filtered angular rate */,
    53                 WxDeg/*! x filtered angular rate degree*/, WyDeg/*! y filtered angular rate degree*/, WzDeg/*! z filtered angular rate degree*/,
    54                 } PlotableData_t;
     40  private:
     41    const ScalarType &elementDataType;
     42  };
    5543
    56             /*!
    57             * \brief Constructor
    58             *
    59             * Construct an io_data representing AHRS datas. \n
    60             *
    61             * \param parent parent
    62             * \param name name
    63             * \param n number of samples
    64             */
    65             AhrsData(const Object* parent,std::string name="",int n=1);
     44  /*!
     45  \enum PlotableData_t
     46  \brief Datas wich can be plotted in a DataPlot1D
     47  */
     48  typedef enum {
     49    Roll /*! roll */,
     50    Pitch /*! pitch */,
     51    Yaw /*! yaw */,
     52    RollDeg /*! roll degree*/,
     53    PitchDeg /*! pitch degree */,
     54    YawDeg /*! yaw degree */,
     55    Q0 /*! quaternion 0 */,
     56    Q1 /*! quaternion 1 */,
     57    Q2 /*! quaternion 2 */,
     58    Q3 /*! quaternion 3 */,
     59    Wx /*! x filtered angular rate */,
     60    Wy /*! y filtered angular rate */,
     61    Wz /*! z filtered angular rate */,
     62    WxDeg /*! x filtered angular rate degree*/,
     63    WyDeg /*! y filtered angular rate degree*/,
     64    WzDeg /*! z filtered angular rate degree*/,
     65  } PlotableData_t;
    6666
    67             /*!
    68             * \brief Destructor
    69             *
    70             */
    71             ~AhrsData();
     67  /*!
     68  * \brief Constructor
     69  *
     70  * Construct an io_data representing AHRS datas. \n
     71  *
     72  * \param parent parent
     73  * \param name name
     74  * \param n number of samples
     75  */
     76  AhrsData(const Object *parent, std::string name = "", int n = 1);
    7277
    73             /*!
    74             * \brief Element
    75             *
    76             * Get a pointer to a specific element. This pointer can be used for plotting.
    77             *
    78             * \param plotableData data type
    79             *
    80             * \return pointer to the element
    81             */
    82             IODataElement *Element(PlotableData_t plotableData) const;
     78  /*!
     79  * \brief Destructor
     80  *
     81  */
     82  ~AhrsData();
    8383
    84             /*!
    85             * \brief Set quaternion
    86             *
    87             * This method is mutex protected.
    88             *
    89             * \param quaternion quaternion
    90             *
    91             */
    92             void SetQuaternion(const Quaternion &quaternion);
     84  /*!
     85  * \brief Element
     86  *
     87  * Get a pointer to a specific element. This pointer can be used for plotting.
     88  *
     89  * \param plotableData data type
     90  *
     91  * \return pointer to the element
     92  */
     93  IODataElement *Element(PlotableData_t plotableData) const;
    9394
    94             /*!
    95             * \brief Get quaternion
    96             *
    97             * This method is mutex protected.
    98             *
    99             * \return quaternion
    100             *
    101             */
    102             Quaternion GetQuaternion(void) const;
     95  /*!
     96  * \brief Set quaternion
     97  *
     98  * This method is mutex protected.
     99  *
     100  * \param quaternion quaternion
     101  *
     102  */
     103  void SetQuaternion(const Quaternion &quaternion);
    103104
    104             /*!
    105             * \brief Set angular rates
    106             *
    107             * This method is mutex protected.
    108             *
    109             * \param angularRates angular rates
    110             *
    111             */
    112             void SetAngularRates(const Vector3D &angularRates);
     105  /*!
     106  * \brief Get quaternion
     107  *
     108  * This method is mutex protected.
     109  *
     110  * \return quaternion
     111  *
     112  */
     113  Quaternion GetQuaternion(void) const;
    113114
    114             /*!
    115             * \brief Get angular rates
    116             *
    117             * This method is mutex protected.
    118             *
    119             * \return angular rates
    120             *
    121             */
    122             Vector3D GetAngularRates(void) const;
     115  /*!
     116  * \brief Set angular rates
     117  *
     118  * This method is mutex protected.
     119  *
     120  * \param angularRates angular rates
     121  *
     122  */
     123  void SetAngularRates(const Vector3D &angularRates);
    123124
    124             /*!
    125             * \brief Get both quaternion and angular rates
    126             *
    127             * This method is mutex protected.
    128             *
    129             * \param quaternion quaternion
    130             * \param angularRates angular rates
    131             *
    132             */
    133             void GetQuaternionAndAngularRates(Quaternion &quaternion,Vector3D &angularRates) const;
     125  /*!
     126  * \brief Get angular rates
     127  *
     128  * This method is mutex protected.
     129  *
     130  * \return angular rates
     131  *
     132  */
     133  Vector3D GetAngularRates(void) const;
    134134
    135             /*!
    136             * \brief Set both quaternion and angular rates
    137             *
    138             * This method is mutex protected.
    139             *
    140             * \param quaternion quaternion
    141             * \param angularRates angular rates
    142             *
    143             */
    144             void SetQuaternionAndAngularRates(const Quaternion &quaternion,const Vector3D &angularRates);
     135  /*!
     136  * \brief Get both quaternion and angular rates
     137  *
     138  * This method is mutex protected.
     139  *
     140  * \param quaternion quaternion
     141  * \param angularRates angular rates
     142  *
     143  */
     144  void GetQuaternionAndAngularRates(Quaternion &quaternion,
     145                                    Vector3D &angularRates) const;
    145146
    146             const Type &GetDataType() const {return dataType;}
    147         private:
    148             /*!
    149             * \brief Copy datas
    150             *
    151             * Reimplemented from io_data. \n
    152             * See io_data::CopyDatas.
    153             *
    154             * \param dst destination buffer
    155             */
    156             void CopyDatas(char *dst) const;
     147  /*!
     148  * \brief Set both quaternion and angular rates
     149  *
     150  * This method is mutex protected.
     151  *
     152  * \param quaternion quaternion
     153  * \param angularRates angular rates
     154  *
     155  */
     156  void SetQuaternionAndAngularRates(const Quaternion &quaternion,
     157                                    const Vector3D &angularRates);
    157158
    158             void Queue(char **dst,const void *src,size_t size) const;
     159  const Type &GetDataType() const { return dataType; }
    159160
    160             /*!
    161             * \brief %Quaternion
    162             *
    163             */
    164             Quaternion quaternion;
     161private:
     162  /*!
     163  * \brief Copy datas
     164  *
     165  * Reimplemented from io_data. \n
     166  * See io_data::CopyDatas.
     167  *
     168  * \param dst destination buffer
     169  */
     170  void CopyDatas(char *dst) const;
    165171
    166             /*!
    167             * \brief Angular rates
    168             *
    169             */
    170             Vector3D angularRates;
     172  void Queue(char **dst, const void *src, size_t size) const;
    171173
    172             Type dataType;
    173     };
     174  /*!
     175  * \brief %Quaternion
     176  *
     177  */
     178  Quaternion quaternion;
     179
     180  /*!
     181  * \brief Angular rates
     182  *
     183  */
     184  Vector3D angularRates;
     185
     186  Type dataType;
     187};
    174188
    175189} // end namespace core
Note: See TracChangeset for help on using the changeset viewer.