Robotics Library  0.7.0
WeissKms40.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016, 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_WEISSKMS40_H
28 #define RL_HAL_WEISSKMS40_H
29 
30 #include <cstdint>
31 #include <string>
32 #include <boost/dynamic_bitset.hpp>
33 #include <rl/math/Matrix.h>
34 
35 #include "CyclicDevice.h"
36 #include "Device.h"
38 #include "Socket.h"
39 
40 namespace rl
41 {
42  namespace hal
43  {
51  {
52  public:
54  {
74  };
75 
82  WeissKms40(
83  const ::std::string& address = "192.168.1.30",
84  const unsigned short int& port = 1000,
85  const ::std::size_t& filter = 0,
86  const ::std::size_t& divider = 1
87  );
88 
89  virtual ~WeissKms40();
90 
91  void close();
92 
94 
95  ::std::pair< ::std::chrono::system_clock::time_point, ::std::chrono::system_clock::duration> doGetCalibrationDateLifetime();
96 
98 
99  ::boost::dynamic_bitset<> doGetDataAcquisitionMask();
100 
101  ::std::string doGetDescriptorString();
102 
103  ::std::size_t doGetFilter();
104 
105  ::std::string doGetFirmwareVersion();
106 
107  ::std::size_t doGetFrameSendDivider();
108 
109  ::std::size_t doGetSerialNumber();
110 
112 
113  ::std::string doGetSystemType();
114 
115  bool doGetTare();
116 
120  float doGetTemperature();
121 
122  ::std::size_t doGetVerboseLevel();
123 
124  ::std::vector< ::std::string> doPrintVariable(const ::std::vector< ::std::string>& variables);
125 
126  ::boost::dynamic_bitset<> doSetDataAcquisitionMask(const ::boost::dynamic_bitset<>& mask);
127 
128  ::std::string doSetDescriptorString(const ::std::string& value);
129 
130  ::std::size_t doSetFilter(const ::std::size_t& value);
131 
132  ::std::size_t doSetFrameSendDivider(const ::std::size_t& value);
133 
134  bool doSetTare(const bool& doOn);
135 
136  ::std::size_t doSetVerboseLevel(const ::std::size_t& level);
137 
139 
141 
143 
145 
146  ::rl::math::Real getForcesTorquesMaximum(const ::std::size_t& i) const;
147 
148  ::rl::math::Real getForcesTorquesMinimum(const ::std::size_t& i) const;
149 
151 
152  void open();
153 
154  void start();
155 
156  void step();
157 
158  void stop();
159 
160  protected:
161 
162  private:
163  ::std::string recv(const ::std::string& command);
164 
165  ::std::size_t divider;
166 
167  ::std::size_t filter;
168 
170 
171  Socket socket;
172  };
173  }
174 }
175 
176 #endif // RL_HAL_WEISSKMS40_H
rl::hal::WeissKms40::doGetDataAcquisitionMask
::boost::dynamic_bitset doGetDataAcquisitionMask()
Definition: WeissKms40.cpp:112
rl::hal::SixAxisForceTorqueSensor
Definition: SixAxisForceTorqueSensor.h:40
rl::math::Matrix
::Eigen::Matrix< Real, ::Eigen::Dynamic, ::Eigen::Dynamic > Matrix
Definition: Matrix.h:42
rl::hal::WeissKms40::step
void step()
Definition: WeissKms40.cpp:492
rl::hal::WeissKms40::getForces
::rl::math::Vector getForces() const
Definition: WeissKms40.cpp:373
SixAxisForceTorqueSensor.h
rl::hal::Socket
Definition: Socket.h:48
rl::hal::WeissKms40::filter
::std::size_t filter
Definition: WeissKms40.h:163
rl::hal::WeissKms40::doGetDescriptorString
::std::string doGetDescriptorString()
Definition: WeissKms40.cpp:135
rl::hal::WeissKms40::doGetSystemType
::std::string doGetSystemType()
Definition: WeissKms40.cpp:201
rl::hal::WeissKms40::SYSTEM_STATE_OVERRUN_FY
@ SYSTEM_STATE_OVERRUN_FY
Definition: WeissKms40.h:64
rl::hal::WeissKms40::getForcesTorquesMaximum
::rl::math::Real getForcesTorquesMaximum(const ::std::size_t &i) const
Definition: WeissKms40.cpp:385
rl::hal::WeissKms40::frame
::rl::math::Vector frame
Definition: WeissKms40.h:165
rl::hal::WeissKms40::SYSTEM_STATE_STABLE
@ SYSTEM_STATE_STABLE
Definition: WeissKms40.h:72
rl::hal::WeissKms40::recv
::std::string recv(const ::std::string &command)
Definition: WeissKms40.cpp:442
rl::hal::WeissKms40::start
void start()
Definition: WeissKms40.cpp:477
rl::hal::WeissKms40::getTorques
::rl::math::Vector getTorques() const
Definition: WeissKms40.cpp:427
rl::hal::WeissKms40::divider
::std::size_t divider
Definition: WeissKms40.h:161
rl::hal::WeissKms40::doSetTare
bool doSetTare(const bool &doOn)
Definition: WeissKms40.cpp:333
rl::hal::WeissKms40::doStopContinuousDataAcquisition
void doStopContinuousDataAcquisition()
Definition: WeissKms40.cpp:364
rl::hal::WeissKms40::SYSTEM_STATE_CMD_FAILURE
@ SYSTEM_STATE_CMD_FAILURE
Definition: WeissKms40.h:56
rl::hal::WeissKms40::close
void close()
Definition: WeissKms40.cpp:61
rl::hal::WeissKms40::~WeissKms40
virtual ~WeissKms40()
Definition: WeissKms40.cpp:52
rl::hal::WeissKms40
Weiss Robotics Force-Torque Sensor KMS 40.
Definition: WeissKms40.h:51
rl::hal::WeissKms40::doGetSystemFlags
SystemState doGetSystemFlags()
Definition: WeissKms40.cpp:190
rl::hal::WeissKms40::SYSTEM_STATE_CALIBRATION_EXPIRED
@ SYSTEM_STATE_CALIBRATION_EXPIRED
Definition: WeissKms40.h:67
rl::hal::WeissKms40::doGetFrameSendDivider
::std::size_t doGetFrameSendDivider()
Definition: WeissKms40.cpp:168
rl::hal::WeissKms40::SystemState
SystemState
Definition: WeissKms40.h:54
rl::hal::WeissKms40::getForcesTorques
::rl::math::Vector getForcesTorques() const
Definition: WeissKms40.cpp:379
rl::hal::WeissKms40::SYSTEM_STATE_TEMP_FAULT
@ SYSTEM_STATE_TEMP_FAULT
Definition: WeissKms40.h:58
rl::hal::WeissKms40::SYSTEM_STATE_SCRIPT_FAILURE
@ SYSTEM_STATE_SCRIPT_FAILURE
Definition: WeissKms40.h:55
rl::math::Vector
::Eigen::Matrix< Real, ::Eigen::Dynamic, 1 > Vector
Definition: Vector.h:42
rl::hal::WeissKms40::doGetCalibrationDateLifetime
::std::pair< ::std::chrono::system_clock::time_point, ::std::chrono::system_clock::duration > doGetCalibrationDateLifetime()
Definition: WeissKms40.cpp:92
rl::hal::WeissKms40::SYSTEM_STATE_OVERRUN_FZ
@ SYSTEM_STATE_OVERRUN_FZ
Definition: WeissKms40.h:63
rl::hal::WeissKms40::doSetDescriptorString
::std::string doSetDescriptorString(const ::std::string &value)
Definition: WeissKms40.cpp:300
rl::hal::WeissKms40::SYSTEM_STATE_DAQ_RUNNING
@ SYSTEM_STATE_DAQ_RUNNING
Definition: WeissKms40.h:69
rl::hal::WeissKms40::open
void open()
Definition: WeissKms40.cpp:433
rl::hal::WeissKms40::doGetTare
bool doGetTare()
Definition: WeissKms40.cpp:212
rl::hal::CyclicDevice
Definition: CyclicDevice.h:39
rl::hal::WeissKms40::socket
Socket socket
Definition: WeissKms40.h:167
rl::hal::WeissKms40::SYSTEM_STATE_POWER_FAULT
@ SYSTEM_STATE_POWER_FAULT
Definition: WeissKms40.h:57
rl::hal::WeissKms40::doSetFrameSendDivider
::std::size_t doSetFrameSendDivider(const ::std::size_t &value)
Definition: WeissKms40.cpp:322
rl::hal::WeissKms40::doGetTemperature
float doGetTemperature()
Definition: WeissKms40.cpp:223
rl::hal::WeissKms40::SYSTEM_STATE_OVERRUN_FX
@ SYSTEM_STATE_OVERRUN_FX
Definition: WeissKms40.h:65
rl::hal::WeissKms40::doSetFilter
::std::size_t doSetFilter(const ::std::size_t &value)
Definition: WeissKms40.cpp:311
rl::hal::WeissKms40::SYSTEM_STATE_OVERRUN_MX
@ SYSTEM_STATE_OVERRUN_MX
Definition: WeissKms40.h:62
Device.h
rl::hal::WeissKms40::doSetDataAcquisitionMask
::boost::dynamic_bitset doSetDataAcquisitionMask(const ::boost::dynamic_bitset<> &mask)
Definition: WeissKms40.cpp:270
rl::hal::WeissKms40::doGetFirmwareVersion
::std::string doGetFirmwareVersion()
Definition: WeissKms40.cpp:157
rl::hal::WeissKms40::SYSTEM_STATE_SCRIPT_RUNNING
@ SYSTEM_STATE_SCRIPT_RUNNING
Definition: WeissKms40.h:68
rl::hal::WeissKms40::doAcquireSingleFrame
::rl::math::Vector doAcquireSingleFrame()
Definition: WeissKms40.cpp:69
rl::hal::WeissKms40::SYSTEM_STATE_TARA
@ SYSTEM_STATE_TARA
Definition: WeissKms40.h:71
rl::hal::WeissKms40::doGetSerialNumber
::std::size_t doGetSerialNumber()
Definition: WeissKms40.cpp:179
rl::hal::WeissKms40::doStartContinuousDataAcquisition
void doStartContinuousDataAcquisition()
Definition: WeissKms40.cpp:355
Matrix.h
rl::hal::WeissKms40::doPrintVariable
::std::vector< ::std::string > doPrintVariable(const ::std::vector< ::std::string > &variables)
Definition: WeissKms40.cpp:245
rl::hal::WeissKms40::SYSTEM_STATE_OVERRUN_MY
@ SYSTEM_STATE_OVERRUN_MY
Definition: WeissKms40.h:61
rl::hal::WeissKms40::SYSTEM_STATE_CALIBRATION_FAULT
@ SYSTEM_STATE_CALIBRATION_FAULT
Definition: WeissKms40.h:59
rl::hal::WeissKms40::doGetFilter
::std::size_t doGetFilter()
Definition: WeissKms40.cpp:146
CyclicDevice.h
rl::hal::WeissKms40::SYSTEM_STATE_OVERRUN_MZ
@ SYSTEM_STATE_OVERRUN_MZ
Definition: WeissKms40.h:60
rl::hal::WeissKms40::SYSTEM_STATE_TEMP_WARNING
@ SYSTEM_STATE_TEMP_WARNING
Definition: WeissKms40.h:66
rl::hal::WeissKms40::getForcesTorquesMinimum
::rl::math::Real getForcesTorquesMinimum(const ::std::size_t &i) const
Definition: WeissKms40.cpp:406
rl::hal::WeissKms40::WeissKms40
WeissKms40(const ::std::string &address="192.168.1.30", const unsigned short int &port=1000, const ::std::size_t &filter=0, const ::std::size_t &divider=1)
Definition: WeissKms40.cpp:37
rl::math::Real
double Real
Definition: Real.h:42
rl::hal::WeissKms40::doSetVerboseLevel
::std::size_t doSetVerboseLevel(const ::std::size_t &level)
Definition: WeissKms40.cpp:344
Socket.h
rl::hal::WeissKms40::SYSTEM_STATE_CALIBRATION_VALID
@ SYSTEM_STATE_CALIBRATION_VALID
Definition: WeissKms40.h:73
rl::hal::WeissKms40::stop
void stop()
Definition: WeissKms40.cpp:511
rl::hal::WeissKms40::doGetCalibrationMatrix
::rl::math::Matrix doGetCalibrationMatrix()
Definition: WeissKms40.cpp:108
rl::hal::WeissKms40::doGetVerboseLevel
::std::size_t doGetVerboseLevel()
Definition: WeissKms40.cpp:234
rl::hal::WeissKms40::SYSTEM_STATE_FILTER_ENABLED
@ SYSTEM_STATE_FILTER_ENABLED
Definition: WeissKms40.h:70
rl
Robotics Library.
Definition: AnalogInput.cpp:30