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 SimuBldc.h
|
---|
7 | * \brief Class for a simulation bldc
|
---|
8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
9 | * \date 2014/02/07
|
---|
10 | * \version 4.0
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef SIMUBLDC_H
|
---|
14 | #define SIMUBLDC_H
|
---|
15 |
|
---|
16 | #include <Bldc.h>
|
---|
17 |
|
---|
18 | namespace flair {
|
---|
19 | namespace core {
|
---|
20 | class SharedMem;
|
---|
21 | class IODevice;
|
---|
22 | class cvmatrix;
|
---|
23 | }
|
---|
24 | namespace gui {
|
---|
25 | class DoubleSpinBox;
|
---|
26 | class Layout;
|
---|
27 | }
|
---|
28 | }
|
---|
29 |
|
---|
30 | namespace flair {
|
---|
31 | namespace actuator {
|
---|
32 | /*! \class SimuBldc
|
---|
33 | *
|
---|
34 | * \brief Class for a simulation bldc
|
---|
35 | *
|
---|
36 | */
|
---|
37 | class SimuBldc : public Bldc {
|
---|
38 | public:
|
---|
39 | /*!
|
---|
40 | * \brief Constructor
|
---|
41 | *
|
---|
42 | * Construct a SimuBldc. Control part.
|
---|
43 | *
|
---|
44 | * \param parent parent
|
---|
45 | * \param layout layout
|
---|
46 | * \param name name
|
---|
47 | * \param motors_count number of motors
|
---|
48 | * \param dev_id device id
|
---|
49 | */
|
---|
50 | SimuBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
|
---|
51 | uint8_t motors_count, uint32_t dev_id);
|
---|
52 |
|
---|
53 | /*!
|
---|
54 | * \brief Constructor
|
---|
55 | *
|
---|
56 | * Construct a SimuBldc. Simulation part.
|
---|
57 | *
|
---|
58 | * \param parent parent
|
---|
59 | * \param name name
|
---|
60 | * \param motors_count number of motors
|
---|
61 | * \param dev_id device id
|
---|
62 | */
|
---|
63 | SimuBldc(const core::Object *parent, std::string name, uint8_t motors_count,
|
---|
64 | uint32_t dev_id);
|
---|
65 |
|
---|
66 | /*!
|
---|
67 | * \brief Destructor
|
---|
68 | *
|
---|
69 | */
|
---|
70 | ~SimuBldc();
|
---|
71 |
|
---|
72 | /*!
|
---|
73 | * \brief Get motors speeds.
|
---|
74 | *
|
---|
75 | * This function should only be used for the simulation part.
|
---|
76 | *
|
---|
77 | * \param value array to store motors speeds
|
---|
78 | */
|
---|
79 | void GetSpeeds(float *value) const;
|
---|
80 |
|
---|
81 | /*!
|
---|
82 | * \brief Has speed measurement
|
---|
83 | *
|
---|
84 | * Reimplemented from Bldc. \n
|
---|
85 | *
|
---|
86 | * \return true if it has speed measurement
|
---|
87 | */
|
---|
88 | bool HasSpeedMeasurement(void) const { return false; };
|
---|
89 |
|
---|
90 | /*!
|
---|
91 | * \brief Has current measurement
|
---|
92 | *
|
---|
93 | * Reimplemented from Bldc. \n
|
---|
94 | *
|
---|
95 | * \return true if it has current measurement
|
---|
96 | */
|
---|
97 | bool HasCurrentMeasurement(void) const { return false; };
|
---|
98 |
|
---|
99 | private:
|
---|
100 | /*!
|
---|
101 | * \brief Set motors values
|
---|
102 | *
|
---|
103 | * Reimplemented from Bldc. \n
|
---|
104 | * Values size must be the same as MotorsCount()
|
---|
105 | *
|
---|
106 | * \param values motor values
|
---|
107 | */
|
---|
108 | void SetMotors(float *value);
|
---|
109 |
|
---|
110 | core::SharedMem *shmem;
|
---|
111 | gui::DoubleSpinBox *k;
|
---|
112 | };
|
---|
113 | } // end namespace actuator
|
---|
114 | } // end namespace flair
|
---|
115 | #endif // SIMUBLDC_H
|
---|