Last change
on this file since 316 was 137, checked in by Sanahuja Guillaume, 8 years ago |
singleton manager
|
File size:
1.7 KB
|
Rev | Line | |
---|
[3] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[3] | 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 |
|
---|
[15] | 19 | namespace flair {
|
---|
| 20 | namespace core {
|
---|
| 21 | class I2cPort;
|
---|
[3] | 22 | }
|
---|
[15] | 23 | namespace gui {
|
---|
| 24 | class SpinBox;
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
[3] | 27 |
|
---|
[15] | 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 {
|
---|
[3] | 35 |
|
---|
[15] | 36 | public:
|
---|
| 37 | /*!
|
---|
| 38 | * \brief Constructor
|
---|
| 39 | *
|
---|
[51] | 40 | * Construct a SRF08 sensor
|
---|
[137] | 41 | * It will be child of the FrameworkManager.
|
---|
[15] | 42 | *
|
---|
| 43 | * \param name name
|
---|
| 44 | * \param i2cport i2c port
|
---|
| 45 | * \param address i2c slave address
|
---|
| 46 | * \param priority priority of the Thread
|
---|
| 47 | */
|
---|
[137] | 48 | Srf08(std::string name,
|
---|
[15] | 49 | core::I2cPort *i2cport, uint16_t address, uint8_t priority);
|
---|
[3] | 50 |
|
---|
[15] | 51 | /*!
|
---|
| 52 | * \brief Destructor
|
---|
| 53 | *
|
---|
| 54 | */
|
---|
| 55 | ~Srf08();
|
---|
[3] | 56 |
|
---|
[15] | 57 | /*!
|
---|
| 58 | * \brief Set Range
|
---|
| 59 | *
|
---|
| 60 | * check datasheet for values
|
---|
| 61 | */
|
---|
| 62 | void SetRange(void);
|
---|
[3] | 63 |
|
---|
[15] | 64 | /*!
|
---|
| 65 | * \brief Set Max Gain
|
---|
| 66 | *
|
---|
| 67 | * check datasheet for values
|
---|
| 68 | */
|
---|
| 69 | void SetMaxGain(void);
|
---|
[3] | 70 |
|
---|
[15] | 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){};
|
---|
[3] | 80 |
|
---|
[15] | 81 | /*!
|
---|
| 82 | * \brief Run function
|
---|
| 83 | *
|
---|
| 84 | * Reimplemented from Thread.
|
---|
| 85 | *
|
---|
| 86 | */
|
---|
| 87 | void Run(void);
|
---|
[3] | 88 |
|
---|
[15] | 89 | void SendEcho(void);
|
---|
| 90 | void GetEcho(void);
|
---|
[3] | 91 |
|
---|
[15] | 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 | };
|
---|
[3] | 99 | } // end namespace sensor
|
---|
| 100 | } // end namespace flair
|
---|
| 101 | #endif // SRF08_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.