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

Last change on this file since 12 was 4, checked in by Sanahuja Guillaume, 9 years ago

sensoractuator

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