Last change
on this file since 448 was 324, checked in by Sanahuja Guillaume, 5 years ago |
removing opencv dependency
|
File size:
1.7 KB
|
Line | |
---|
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 Srf08.h
|
---|
7 | * \brief Class for ultra sonic SRF08
|
---|
8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
9 | * \date 2011/05/01
|
---|
10 | * \version 4.0
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef SRF08_H
|
---|
14 | #define SRF08_H
|
---|
15 |
|
---|
16 | #include <Thread.h>
|
---|
17 | #include <UsRangeFinder.h>
|
---|
18 |
|
---|
19 | namespace flair {
|
---|
20 | namespace core {
|
---|
21 | class I2cPort;
|
---|
22 | }
|
---|
23 | namespace gui {
|
---|
24 | class SpinBox;
|
---|
25 | }
|
---|
26 | }
|
---|
27 |
|
---|
28 | namespace flair {
|
---|
29 | namespace sensor {
|
---|
30 | /*! \class Srf08
|
---|
31 | *
|
---|
32 | * \brief Class for ultra sonic SRF08
|
---|
33 | */
|
---|
34 | class Srf08 : public core::Thread, public UsRangeFinder {
|
---|
35 |
|
---|
36 | public:
|
---|
37 | /*!
|
---|
38 | * \brief Constructor
|
---|
39 | *
|
---|
40 | * Construct a SRF08 sensor
|
---|
41 | * It will be child of the FrameworkManager.
|
---|
42 | *
|
---|
43 | * \param name name
|
---|
44 | * \param i2cport i2c port
|
---|
45 | * \param address i2c slave address
|
---|
46 | * \param priority priority of the Thread
|
---|
47 | */
|
---|
48 | Srf08(std::string name,
|
---|
49 | core::I2cPort *i2cport, uint16_t address, uint8_t priority);
|
---|
50 |
|
---|
51 | /*!
|
---|
52 | * \brief Destructor
|
---|
53 | *
|
---|
54 | */
|
---|
55 | ~Srf08();
|
---|
56 |
|
---|
57 | /*!
|
---|
58 | * \brief Set Range
|
---|
59 | *
|
---|
60 | * check datasheet for values
|
---|
61 | */
|
---|
62 | void SetRange(void);
|
---|
63 |
|
---|
64 | /*!
|
---|
65 | * \brief Set Max Gain
|
---|
66 | *
|
---|
67 | * check datasheet for values
|
---|
68 | */
|
---|
69 | void SetMaxGain(void);
|
---|
70 |
|
---|
71 | private:
|
---|
72 | /*!
|
---|
73 | * \brief Update using provided datas
|
---|
74 | *
|
---|
75 | * Reimplemented from IODevice.
|
---|
76 | *
|
---|
77 | * \param data data from the parent to process
|
---|
78 | */
|
---|
79 | void UpdateFrom(const core::io_data *data){};
|
---|
80 |
|
---|
81 | /*!
|
---|
82 | * \brief Run function
|
---|
83 | *
|
---|
84 | * Reimplemented from Thread.
|
---|
85 | *
|
---|
86 | */
|
---|
87 | void Run(void);
|
---|
88 |
|
---|
89 | void SendEcho(void);
|
---|
90 | void GetEcho(void);
|
---|
91 |
|
---|
92 | bool is_init;
|
---|
93 | core::Time echo_time;
|
---|
94 | float z_1, z_2;
|
---|
95 | gui::SpinBox *gain, *range;
|
---|
96 | uint16_t address;
|
---|
97 | core::I2cPort *i2cport;
|
---|
98 | };
|
---|
99 | } // end namespace sensor
|
---|
100 | } // end namespace flair
|
---|
101 | #endif // SRF08_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.