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