[10] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[10] | 4 | // %flair:license}
|
---|
[7] | 5 | /*!
|
---|
| 6 | * \file X4X8Multiplex.h
|
---|
| 7 | * \brief Class defining X4 and X8 multiplexing
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2014/04/10
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef X4X8MULTIPLEX_H
|
---|
| 14 | #define X4X8MULTIPLEX_H
|
---|
| 15 |
|
---|
| 16 | #include <UavMultiplex.h>
|
---|
| 17 |
|
---|
| 18 | class X4X8Multiplex_impl;
|
---|
| 19 |
|
---|
[15] | 20 | namespace flair {
|
---|
| 21 | namespace filter {
|
---|
| 22 | /*! \class X4X8Multiplex
|
---|
| 23 | *
|
---|
| 24 | * \brief Class defining X4 and X8 multiplexing
|
---|
| 25 | *
|
---|
| 26 | * The output order of the motors can be changed through ground station.
|
---|
| 27 | */
|
---|
| 28 | class X4X8Multiplex : public UavMultiplex {
|
---|
| 29 | friend class ::X4X8Multiplex_impl;
|
---|
[7] | 30 |
|
---|
[15] | 31 | public:
|
---|
| 32 | /*!
|
---|
| 33 | \enum UavType_t
|
---|
| 34 | \brief type of UAV
|
---|
| 35 | */
|
---|
| 36 | typedef enum {
|
---|
| 37 | X4, /*!< 4 motors: front left, front right, rear left, rear right */
|
---|
| 38 | X8 /*!< 8 motors: top front left, top front right, top rear left, top rear
|
---|
| 39 | right, bottom front left, bottom front right, bottom rear left, bottom
|
---|
| 40 | rear right */
|
---|
| 41 | } UavType_t;
|
---|
[7] | 42 |
|
---|
[15] | 43 | /*!
|
---|
| 44 | \enum MotorNames_t
|
---|
| 45 | \brief Motor names
|
---|
| 46 | */
|
---|
| 47 | typedef enum {
|
---|
| 48 | TopFrontLeft = 0, /*!< Top front left, X4 or X8 */
|
---|
| 49 | TopFrontRight = 1, /*!< Top front right, X4 or X8 */
|
---|
| 50 | TopRearLeft = 2, /*!< Top rear left, X4 or X8 */
|
---|
| 51 | TopRearRight = 3, /*!< Top rear right, X4 or X8 */
|
---|
| 52 | BottomFrontLeft = 4, /*!< Bottom front left, X8 */
|
---|
| 53 | BottomFrontRight = 5, /*!< Bottom front right, X8 */
|
---|
| 54 | BottomRearLeft = 6, /*!< Bottom rear left, X8 */
|
---|
| 55 | BottomRearRight = 7, /*!< Bottom rear right, X8 */
|
---|
| 56 | } MotorNames_t;
|
---|
[7] | 57 |
|
---|
[15] | 58 | /*!
|
---|
| 59 | * \brief Constructor
|
---|
| 60 | *
|
---|
[137] | 61 | * Construct a X4 and X8 multiplexing. It will be child of the FrameworkManager.
|
---|
[15] | 62 | *
|
---|
| 63 | * \param name name
|
---|
| 64 | * \param type type
|
---|
| 65 | */
|
---|
[137] | 66 | X4X8Multiplex(std::string name, UavType_t type);
|
---|
[7] | 67 |
|
---|
[15] | 68 | /*!
|
---|
| 69 | * \brief Destructor
|
---|
| 70 | *
|
---|
| 71 | */
|
---|
| 72 | ~X4X8Multiplex();
|
---|
[7] | 73 |
|
---|
[15] | 74 | /*!
|
---|
| 75 | * \brief Use default plot
|
---|
| 76 | *
|
---|
| 77 | * Plot the output values.
|
---|
| 78 | *
|
---|
| 79 | */
|
---|
| 80 | void UseDefaultPlot(void);
|
---|
[7] | 81 |
|
---|
[15] | 82 | /*!
|
---|
| 83 | * \brief Motors count
|
---|
| 84 | *
|
---|
| 85 | * Reimplemented from UavMultiplex.
|
---|
| 86 | *
|
---|
| 87 | * \return motors count
|
---|
| 88 | */
|
---|
| 89 | uint8_t MotorsCount(void) const;
|
---|
[7] | 90 |
|
---|
[15] | 91 | private:
|
---|
| 92 | /*!
|
---|
| 93 | * \brief Update using provided datas
|
---|
| 94 | *
|
---|
| 95 | * Reimplemented from IODevice.
|
---|
| 96 | *
|
---|
| 97 | * \param data data from the parent to process
|
---|
| 98 | */
|
---|
| 99 | void UpdateFrom(const core::io_data *data);
|
---|
[7] | 100 |
|
---|
[15] | 101 | X4X8Multiplex_impl *pimpl_;
|
---|
| 102 | };
|
---|
[7] | 103 | } // end namespace filter
|
---|
| 104 | } // end namespace flair
|
---|
| 105 | #endif // X4X8MULTIPLEX_H
|
---|