Robotics Library  0.7.0
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 <cstdint>
31 #include <set>
32 
33 #include "CyclicDevice.h"
34 #include "RangeSensor.h"
35 #include "Serial.h"
36 
37 namespace rl
38 {
39  namespace hal
40  {
44  class SchunkFpsF5 : public CyclicDevice, public RangeSensor
45  {
46  public:
47  SchunkFpsF5(const ::std::string& device = "/dev/ttyS0");
48 
49  virtual ~SchunkFpsF5();
50 
51  void close();
52 
54 
55  ::std::size_t getDistancesCount() const;
56 
57  ::rl::math::Real getDistancesMaximum(const ::std::size_t& i) const;
58 
59  ::rl::math::Real getDistancesMinimum(const ::std::size_t& i) const;
60 
62 
64 
65  bool isA() const;
66 
67  bool isArea() const;
68 
69  bool isB() const;
70 
71  bool isC() const;
72 
73  bool isClosed() const;
74 
75  bool isOpened() const;
76 
77  bool isReCalc() const;
78 
79  bool isRecord() const;
80 
81  bool isUpdate() const;
82 
83  void open();
84 
85  void start();
86 
87  void step();
88 
89  void stop();
90 
91  protected:
92 
93  private:
94  ::std::uint16_t crc(const ::std::uint8_t* buf, const ::std::size_t& len) const;
95 
96  ::std::size_t recv(::std::uint8_t* buf, const ::std::size_t& len, const ::std::uint8_t& command);
97 
98  void send(::std::uint8_t* buf, const ::std::size_t& len);
99 
100  bool a;
101 
102  bool area;
103 
104  bool b;
105 
106  bool c;
107 
108  bool closed;
109 
110  ::std::set< ::std::pair< ::rl::math::Real, ::rl::math::Real>> fulcrums;
111 
113 
114  bool opened;
115 
116  bool reCalc;
117 
118  bool record;
119 
121 
123 
124  bool update;
125 
127 
129  };
130  }
131 }
132 
133 #endif // RL_HAL_SCHUNKFPSF5_H
rl::hal::SchunkFpsF5::start
void start()
Definition: SchunkFpsF5.cpp:279
rl::hal::SchunkFpsF5::isA
bool isA() const
Definition: SchunkFpsF5.cpp:146
rl::hal::SchunkFpsF5::SchunkFpsF5
SchunkFpsF5(const ::std::string &device="/dev/ttyS0")
Definition: SchunkFpsF5.cpp:37
rl::hal::SchunkFpsF5::~SchunkFpsF5
virtual ~SchunkFpsF5()
Definition: SchunkFpsF5.cpp:65
rl::hal::SchunkFpsF5
Schunk FPS-F5 flexible position sensor.
Definition: SchunkFpsF5.h:45
rl::hal::SchunkFpsF5::isUpdate
bool isUpdate() const
Definition: SchunkFpsF5.cpp:194
rl::hal::SchunkFpsF5::isC
bool isC() const
Definition: SchunkFpsF5.cpp:164
rl::hal::SchunkFpsF5::b
bool b
Definition: SchunkFpsF5.h:104
rl::hal::SchunkFpsF5::record
bool record
Definition: SchunkFpsF5.h:118
rl::hal::SchunkFpsF5::getDistances
::rl::math::Vector getDistances() const
Definition: SchunkFpsF5.cpp:104
rl::hal::SchunkFpsF5::getDistancesMaximum
::rl::math::Real getDistancesMaximum(const ::std::size_t &i) const
Definition: SchunkFpsF5.cpp:120
rl::hal::SchunkFpsF5::isB
bool isB() const
Definition: SchunkFpsF5.cpp:158
rl::hal::SchunkFpsF5::recv
::std::size_t recv(::std::uint8_t *buf, const ::std::size_t &len, const ::std::uint8_t &command)
Definition: SchunkFpsF5.cpp:207
Serial.h
rl::hal::SchunkFpsF5::send
void send(::std::uint8_t *buf, const ::std::size_t &len)
Definition: SchunkFpsF5.cpp:258
rl::hal::SchunkFpsF5::isOpened
bool isOpened() const
Definition: SchunkFpsF5.cpp:176
rl::hal::SchunkFpsF5::interpolated
::rl::math::Real interpolated
Definition: SchunkFpsF5.h:112
rl::hal::SchunkFpsF5::isRecord
bool isRecord() const
Definition: SchunkFpsF5.cpp:188
rl::math::Vector
::Eigen::Matrix< Real, ::Eigen::Dynamic, 1 > Vector
Definition: Vector.h:42
rl::hal::SchunkFpsF5::opened
bool opened
Definition: SchunkFpsF5.h:114
rl::hal::SchunkFpsF5::fulcrums
::std::set< ::std::pair< ::rl::math::Real, ::rl::math::Real > > fulcrums
Definition: SchunkFpsF5.h:110
rl::hal::SchunkFpsF5::stop
void stop()
Definition: SchunkFpsF5.cpp:389
rl::hal::SchunkFpsF5::voltage
::rl::math::Real voltage
Definition: SchunkFpsF5.h:128
rl::hal::SchunkFpsF5::isReCalc
bool isReCalc() const
Definition: SchunkFpsF5.cpp:182
rl::hal::SchunkFpsF5::closed
bool closed
Definition: SchunkFpsF5.h:108
rl::hal::Serial
Definition: Serial.h:48
rl::hal::CyclicDevice
Definition: CyclicDevice.h:39
rl::hal::SchunkFpsF5::area
bool area
Definition: SchunkFpsF5.h:102
rl::hal::SchunkFpsF5::step
void step()
Definition: SchunkFpsF5.cpp:327
rl::hal::SchunkFpsF5::value
::rl::math::Real value
Definition: SchunkFpsF5.h:126
rl::hal::SchunkFpsF5::temperature
::rl::math::Real temperature
Definition: SchunkFpsF5.h:122
rl::hal::SchunkFpsF5::serial
Serial serial
Definition: SchunkFpsF5.h:120
rl::hal::SchunkFpsF5::open
void open()
Definition: SchunkFpsF5.cpp:200
rl::hal::SchunkFpsF5::crc
::std::uint16_t crc(const ::std::uint8_t *buf, const ::std::size_t &len) const
Definition: SchunkFpsF5.cpp:78
rl::hal::SchunkFpsF5::isClosed
bool isClosed() const
Definition: SchunkFpsF5.cpp:170
rl::hal::SchunkFpsF5::isArea
bool isArea() const
Definition: SchunkFpsF5.cpp:152
rl::hal::SchunkFpsF5::getTemperature
::rl::math::Real getTemperature() const
Definition: SchunkFpsF5.cpp:134
rl::hal::SchunkFpsF5::getVoltage
::rl::math::Real getVoltage() const
Definition: SchunkFpsF5.cpp:140
rl::hal::SchunkFpsF5::getDistancesCount
::std::size_t getDistancesCount() const
Definition: SchunkFpsF5.cpp:114
rl::hal::RangeSensor
Definition: RangeSensor.h:39
CyclicDevice.h
rl::hal::SchunkFpsF5::c
bool c
Definition: SchunkFpsF5.h:106
rl::math::Real
double Real
Definition: Real.h:42
rl::hal::SchunkFpsF5::a
bool a
Definition: SchunkFpsF5.h:100
RangeSensor.h
rl::hal::SchunkFpsF5::reCalc
bool reCalc
Definition: SchunkFpsF5.h:116
rl::hal::SchunkFpsF5::update
bool update
Definition: SchunkFpsF5.h:124
rl::hal::SchunkFpsF5::getDistancesMinimum
::rl::math::Real getDistancesMinimum(const ::std::size_t &i) const
Definition: SchunkFpsF5.cpp:127
rl::hal::SchunkFpsF5::close
void close()
Definition: SchunkFpsF5.cpp:70
rl
Robotics Library.
Definition: AnalogInput.cpp:30