Robotics Library  0.6.2
SchunkFpsF5.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2009, Markus Rickert
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 //
8 // * Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright notice,
11 // this list of conditions and the following disclaimer in the documentation
12 // and/or other materials provided with the distribution.
13 //
14 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 // POSSIBILITY OF SUCH DAMAGE.
25 //
26 
27 #ifndef _RL_HAL_SCHUNKFPSF5_H_
28 #define _RL_HAL_SCHUNKFPSF5_H_
29 
30 #include "RangeSensor.h"
31 #include "types.h"
32 
33 #include <set>
34 
35 namespace rl
36 {
37  namespace hal
38  {
39  class Serial;
40 
41  class SchunkFpsF5 : public RangeSensor
42  {
43  public:
44  SchunkFpsF5(const ::std::string& device = "/dev/ttyS0");
45 
46  virtual ~SchunkFpsF5();
47 
48  void close();
49 
50  void getDistances(::rl::math::Vector& distances) const;
51 
52  ::std::size_t getDistancesCount() const;
53 
54  ::rl::math::Real getDistancesMaximum(const ::std::size_t& i) const;
55 
56  ::rl::math::Real getDistancesMinimum(const ::std::size_t& i) const;
57 
59 
61 
62  bool isA() const;
63 
64  bool isArea() const;
65 
66  bool isB() const;
67 
68  bool isC() const;
69 
70  bool isClosed() const;
71 
72  bool isOpened() const;
73 
74  bool isReCalc() const;
75 
76  bool isRecord() const;
77 
78  bool isUpdate() const;
79 
80  void open();
81 
82  void start();
83 
84  void step();
85 
86  void stop();
87 
88  protected:
89 
90  private:
91  uint16_t crc(const uint8_t* buf, const ::std::size_t& len) const;
92 
93  ::std::size_t recv(uint8_t* buf, const ::std::size_t& len, const uint8_t& command);
94 
95  void send(uint8_t* buf, const ::std::size_t& len);
96 
97  bool a;
98 
99  bool area;
100 
101  bool b;
102 
103  bool c;
104 
105  bool closed;
106 
107  ::std::set< ::std::pair< ::rl::math::Real, ::rl::math::Real > > fulcrums;
108 
110 
111  bool opened;
112 
113  bool reCalc;
114 
115  bool record;
116 
118 
120 
121  bool update;
122 
124 
126  };
127  }
128 }
129 
130 #endif // _RL_HAL_SCHUNKFPSF5_H_
rl::hal::SchunkFpsF5::start
void start()
Definition: SchunkFpsF5.cpp:285
rl::hal::SchunkFpsF5::isA
bool isA() const
Definition: SchunkFpsF5.cpp:152
rl::hal::SchunkFpsF5::SchunkFpsF5
SchunkFpsF5(const ::std::string &device="/dev/ttyS0")
Definition: SchunkFpsF5.cpp:38
rl::hal::SchunkFpsF5::~SchunkFpsF5
virtual ~SchunkFpsF5()
Definition: SchunkFpsF5.cpp:67
rl::hal::SchunkFpsF5
Definition: SchunkFpsF5.h:42
rl::hal::SchunkFpsF5::isUpdate
bool isUpdate() const
Definition: SchunkFpsF5.cpp:200
rl::hal::SchunkFpsF5::isC
bool isC() const
Definition: SchunkFpsF5.cpp:170
rl::hal::SchunkFpsF5::b
bool b
Definition: SchunkFpsF5.h:101
types.h
rl::hal::SchunkFpsF5::record
bool record
Definition: SchunkFpsF5.h:115
rl::hal::SchunkFpsF5::getDistancesMaximum
::rl::math::Real getDistancesMaximum(const ::std::size_t &i) const
Definition: SchunkFpsF5.cpp:124
rl::hal::SchunkFpsF5::isB
bool isB() const
Definition: SchunkFpsF5.cpp:164
rl::hal::SchunkFpsF5::isOpened
bool isOpened() const
Definition: SchunkFpsF5.cpp:182
rl::hal::SchunkFpsF5::interpolated
::rl::math::Real interpolated
Definition: SchunkFpsF5.h:109
rl::hal::SchunkFpsF5::serial
Serial * serial
Definition: SchunkFpsF5.h:117
rl::hal::SchunkFpsF5::isRecord
bool isRecord() const
Definition: SchunkFpsF5.cpp:194
rl::hal::SchunkFpsF5::opened
bool opened
Definition: SchunkFpsF5.h:111
rl::hal::SchunkFpsF5::crc
uint16_t crc(const uint8_t *buf, const ::std::size_t &len) const
Definition: SchunkFpsF5.cpp:83
rl::hal::SchunkFpsF5::stop
void stop()
Definition: SchunkFpsF5.cpp:397
rl::hal::SchunkFpsF5::voltage
::rl::math::Real voltage
Definition: SchunkFpsF5.h:125
rl::hal::SchunkFpsF5::isReCalc
bool isReCalc() const
Definition: SchunkFpsF5.cpp:188
rl::hal::SchunkFpsF5::closed
bool closed
Definition: SchunkFpsF5.h:105
rl::hal::Serial
Definition: Serial.h:46
rl::hal::SchunkFpsF5::area
bool area
Definition: SchunkFpsF5.h:99
rl::hal::SchunkFpsF5::step
void step()
Definition: SchunkFpsF5.cpp:333
rl::hal::SchunkFpsF5::value
::rl::math::Real value
Definition: SchunkFpsF5.h:123
rl::hal::SchunkFpsF5::temperature
::rl::math::Real temperature
Definition: SchunkFpsF5.h:119
rl::hal::SchunkFpsF5::open
void open()
Definition: SchunkFpsF5.cpp:206
rl::hal::SchunkFpsF5::recv
::std::size_t recv(uint8_t *buf, const ::std::size_t &len, const uint8_t &command)
Definition: SchunkFpsF5.cpp:213
rl::hal::SchunkFpsF5::isClosed
bool isClosed() const
Definition: SchunkFpsF5.cpp:176
rl::hal::SchunkFpsF5::isArea
bool isArea() const
Definition: SchunkFpsF5.cpp:158
rl::hal::SchunkFpsF5::getTemperature
::rl::math::Real getTemperature() const
Definition: SchunkFpsF5.cpp:140
rl::hal::SchunkFpsF5::getVoltage
::rl::math::Real getVoltage() const
Definition: SchunkFpsF5.cpp:146
rl::hal::SchunkFpsF5::getDistancesCount
::std::size_t getDistancesCount() const
Definition: SchunkFpsF5.cpp:118
rl::hal::SchunkFpsF5::fulcrums
::std::set< ::std::pair< ::rl::math::Real, ::rl::math::Real > > fulcrums
Definition: SchunkFpsF5.h:107
rl::hal::RangeSensor
Definition: RangeSensor.h:39
rl::hal::SchunkFpsF5::send
void send(uint8_t *buf, const ::std::size_t &len)
Definition: SchunkFpsF5.cpp:264
rl::hal::SchunkFpsF5::getDistances
void getDistances(::rl::math::Vector &distances) const
Definition: SchunkFpsF5.cpp:109
rl::math::Vector
::Eigen::Matrix< Real, ::Eigen::Dynamic, 1 > Vector
Definition: Vector.h:41
rl::hal::SchunkFpsF5::c
bool c
Definition: SchunkFpsF5.h:103
rl::math::Real
double Real
Definition: Real.h:34
rl::hal::SchunkFpsF5::a
bool a
Definition: SchunkFpsF5.h:97
RangeSensor.h
rl::hal::SchunkFpsF5::reCalc
bool reCalc
Definition: SchunkFpsF5.h:113
rl::hal::SchunkFpsF5::update
bool update
Definition: SchunkFpsF5.h:121
rl::hal::SchunkFpsF5::getDistancesMinimum
::rl::math::Real getDistancesMinimum(const ::std::size_t &i) const
Definition: SchunkFpsF5.cpp:132
rl::hal::SchunkFpsF5::close
void close()
Definition: SchunkFpsF5.cpp:73
rl
Definition: Ati.cpp:35