Robotics Library  0.7.0
Ati.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_ATI_H
28 #define RL_HAL_ATI_H
29 
30 #include <string>
31 #include <atidaq/ftconfig.h>
32 
33 #include "Comedi.h"
34 #include "CyclicDevice.h"
36 
37 namespace rl
38 {
39  namespace hal
40  {
44  class Ati : public CyclicDevice, public SixAxisForceTorqueSensor
45  {
46  public:
47  Ati(
48  const ::std::string& calFilePath,
49  const ::std::chrono::nanoseconds& updateRate = ::std::chrono::milliseconds(1),
50  const unsigned short int& index = 0,
51  const ::std::string& filename = "/dev/comedi0"
52  );
53 
54  virtual ~Ati();
55 
56  void bias();
57 
58  void close();
59 
60  ::std::string getAxisName(const ::std::size_t& i) const;
61 
63 
64  ::rl::math::Real getForcesMaximum(const ::std::size_t& i) const;
65 
66  ::rl::math::Real getForcesMinimum(const ::std::size_t& i) const;
67 
69 
70  ::rl::math::Real getForcesTorquesMaximum(const ::std::size_t& i) const;
71 
72  ::rl::math::Real getForcesTorquesMinimum(const ::std::size_t& i) const;
73 
75 
76  ::rl::math::Real getTorquesMaximum(const ::std::size_t& i) const;
77 
78  ::rl::math::Real getTorquesMinimum(const ::std::size_t& i) const;
79 
80  void open();
81 
82  void resetBias();
83 
84  void start();
85 
86  void step();
87 
88  void stop();
89 
90  protected:
91 
92  private:
93  Calibration* cal;
94 
96  ::std::string calFilePath;
97 
99 
101  unsigned short int index;
102 
103  float values[6];
104 
105  float voltages[6];
106  };
107  }
108 }
109 
110 #endif // RL_HAL_ATI_H
rl::hal::SixAxisForceTorqueSensor
Definition: SixAxisForceTorqueSensor.h:40
rl::hal::Ati::start
void start()
Definition: Ati.cpp:198
SixAxisForceTorqueSensor.h
rl::hal::Ati::step
void step()
Definition: Ati.cpp:203
rl::hal::Ati::open
void open()
Definition: Ati.cpp:184
rl::hal::Ati::cal
Calibration * cal
Definition: Ati.h:93
rl::hal::Ati
ATI Industrial Automation force-torque sensor.
Definition: Ati.h:45
rl::hal::Ati::getForcesTorques
::rl::math::Vector getForcesTorques() const
Definition: Ati.cpp:126
rl::hal::Ati::getForcesMinimum
::rl::math::Real getForcesMinimum(const ::std::size_t &i) const
Definition: Ati.cpp:118
rl::hal::Ati::values
float values[6]
Definition: Ati.h:103
rl::hal::Ati::calFilePath
::std::string calFilePath
The name and path of the calibration file.
Definition: Ati.h:96
rl::hal::Ati::getForces
::rl::math::Vector getForces() const
Definition: Ati.cpp:97
rl::hal::Ati::getForcesTorquesMinimum
::rl::math::Real getForcesTorquesMinimum(const ::std::size_t &i) const
Definition: Ati.cpp:147
rl::math::Vector
::Eigen::Matrix< Real, ::Eigen::Dynamic, 1 > Vector
Definition: Vector.h:42
rl::hal::Ati::getTorquesMinimum
::rl::math::Real getTorquesMinimum(const ::std::size_t &i) const
Definition: Ati.cpp:176
rl::hal::Ati::getTorques
::rl::math::Vector getTorques() const
Definition: Ati.cpp:155
rl::hal::CyclicDevice
Definition: CyclicDevice.h:39
rl::hal::Ati::getAxisName
::std::string getAxisName(const ::std::size_t &i) const
Definition: Ati.cpp:89
rl::hal::Comedi
Definition: Comedi.h:40
Comedi.h
rl::hal::Ati::~Ati
virtual ~Ati()
Definition: Ati.cpp:67
rl::hal::Ati::Ati
Ati(const ::std::string &calFilePath, const ::std::chrono::nanoseconds &updateRate=::std::chrono::milliseconds(1), const unsigned short int &index=0, const ::std::string &filename="/dev/comedi0")
Definition: Ati.cpp:38
rl::hal::Ati::voltages
float voltages[6]
Definition: Ati.h:105
rl::hal::Ati::getForcesMaximum
::rl::math::Real getForcesMaximum(const ::std::size_t &i) const
Definition: Ati.cpp:110
rl::hal::Ati::index
unsigned short int index
The number of the calibration within the file (usually 1).
Definition: Ati.h:101
CyclicDevice.h
rl::hal::Ati::close
void close()
Definition: Ati.cpp:82
rl::hal::Ati::resetBias
void resetBias()
Definition: Ati.cpp:191
rl::hal::Ati::stop
void stop()
Definition: Ati.cpp:214
rl::hal::CyclicDevice::updateRate
::std::chrono::nanoseconds updateRate
Definition: CyclicDevice.h:55
rl::hal::Ati::getForcesTorquesMaximum
::rl::math::Real getForcesTorquesMaximum(const ::std::size_t &i) const
Definition: Ati.cpp:139
rl::math::Real
double Real
Definition: Real.h:42
rl::hal::Ati::getTorquesMaximum
::rl::math::Real getTorquesMaximum(const ::std::size_t &i) const
Definition: Ati.cpp:168
rl::hal::Ati::bias
void bias()
Definition: Ati.cpp:76
rl::hal::Ati::comedi
Comedi comedi
Definition: Ati.h:98
rl
Robotics Library.
Definition: AnalogInput.cpp:30