source: flair-dev/trunk/include/FlairSensorActuator/Srf08.h@ 35

Last change on this file since 35 was 32, checked in by Sanahuja Guillaume, 8 years ago

m

File size: 1.8 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
19namespace flair {
20namespace core {
21class FrameworkManager;
22class I2cPort;
23}
24namespace gui {
25class SpinBox;
26;
27}
28}
29
30namespace flair {
31namespace sensor {
32/*! \class Srf08
33*
34* \brief Class for ultra sonic SRF08
35*/
36class Srf08 : public core::Thread, public UsRangeFinder {
37
38public:
39 /*!
40 * \brief Constructor
41 *
42 * Construct a SRF08 sensor
43 *
44 * \param parent parent
45 * \param name name
46 * \param i2cport i2c port
47 * \param address i2c slave address
48 * \param priority priority of the Thread
49 */
50 Srf08(const core::FrameworkManager *parent, std::string name,
51 core::I2cPort *i2cport, uint16_t address, uint8_t priority);
52
53 /*!
54 * \brief Destructor
55 *
56 */
57 ~Srf08();
58
59 /*!
60 * \brief Set Range
61 *
62 * check datasheet for values
63 */
64 void SetRange(void);
65
66 /*!
67 * \brief Set Max Gain
68 *
69 * check datasheet for values
70 */
71 void SetMaxGain(void);
72
73private:
74 /*!
75 * \brief Update using provided datas
76 *
77 * Reimplemented from IODevice.
78 *
79 * \param data data from the parent to process
80 */
81 void UpdateFrom(const core::io_data *data){};
82
83 /*!
84 * \brief Run function
85 *
86 * Reimplemented from Thread.
87 *
88 */
89 void Run(void);
90
91 void SendEcho(void);
92 void GetEcho(void);
93
94 bool is_init;
95 core::Time echo_time;
96 float z_1, z_2;
97 gui::SpinBox *gain, *range;
98 uint16_t address;
99 core::I2cPort *i2cport;
100};
101} // end namespace sensor
102} // end namespace flair
103#endif // SRF08_H
Note: See TracBrowser for help on using the repository browser.