source: flair-src/trunk/lib/FlairSensorActuator/src/Srf08.h@ 107

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

gps

File size: 1.8 KB
RevLine 
[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]19namespace flair {
20namespace core {
21class FrameworkManager;
22class I2cPort;
[3]23}
[15]24namespace gui {
25class SpinBox;
26;
27}
28}
[3]29
[15]30namespace flair {
31namespace sensor {
32/*! \class Srf08
33*
34* \brief Class for ultra sonic SRF08
35*/
36class Srf08 : public core::Thread, public UsRangeFinder {
[3]37
[15]38public:
39 /*!
40 * \brief Constructor
41 *
[51]42 * Construct a SRF08 sensor
[15]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);
[3]52
[15]53 /*!
54 * \brief Destructor
55 *
56 */
57 ~Srf08();
[3]58
[15]59 /*!
60 * \brief Set Range
61 *
62 * check datasheet for values
63 */
64 void SetRange(void);
[3]65
[15]66 /*!
67 * \brief Set Max Gain
68 *
69 * check datasheet for values
70 */
71 void SetMaxGain(void);
[3]72
[15]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){};
[3]82
[15]83 /*!
84 * \brief Run function
85 *
86 * Reimplemented from Thread.
87 *
88 */
89 void Run(void);
[3]90
[15]91 void SendEcho(void);
92 void GetEcho(void);
[3]93
[15]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};
[3]101} // end namespace sensor
102} // end namespace flair
103#endif // SRF08_H
Note: See TracBrowser for help on using the repository browser.