Robotics Library  0.7.0
Jr3.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_JR3_H
28 #define RL_HAL_JR3_H
29 
30 #include <string>
31 
32 #include "Comedi.h"
33 #include "CyclicDevice.h"
35 
36 namespace rl
37 {
38  namespace hal
39  {
43  class Jr3 : public CyclicDevice, public SixAxisForceTorqueSensor
44  {
45  public:
46  Jr3(const ::std::string& filename = "/dev/comedi0", const ::std::chrono::nanoseconds& updateRate = ::std::chrono::milliseconds(1));
47 
48  virtual ~Jr3();
49 
50  void bias();
51 
52  void close();
53 
55 
56  ::rl::math::Real getForcesMaximum(const ::std::size_t& i) const;
57 
58  ::rl::math::Real getForcesMinimum(const ::std::size_t& i) const;
59 
61 
62  ::rl::math::Real getForcesTorquesMaximum(const ::std::size_t& i) const;
63 
64  ::rl::math::Real getForcesTorquesMinimum(const ::std::size_t& i) const;
65 
67 
68  ::rl::math::Real getTorquesMaximum(const ::std::size_t& i) const;
69 
70  ::rl::math::Real getTorquesMinimum(const ::std::size_t& i) const;
71 
72  void open();
73 
74  void resetBias();
75 
76  void start();
77 
78  void step();
79 
80  void stop();
81 
82  protected:
83 
84  private:
86 
87  float values[6];
88 
89  float zeroes[6];
90  };
91  }
92 }
93 
94 #endif // RL_HAL_JR3_H
rl::hal::SixAxisForceTorqueSensor
Definition: SixAxisForceTorqueSensor.h:40
SixAxisForceTorqueSensor.h
rl::hal::Jr3::comedi
Comedi comedi
Definition: Jr3.h:85
rl::hal::Jr3::~Jr3
virtual ~Jr3()
Definition: Jr3.cpp:51
rl::hal::Jr3::resetBias
void resetBias()
Definition: Jr3.cpp:166
rl::hal::Jr3::getTorquesMaximum
::rl::math::Real getTorquesMaximum(const ::std::size_t &i) const
Definition: Jr3.cpp:143
rl::hal::Jr3
JR3 force-torque sensor.
Definition: Jr3.h:44
rl::hal::Jr3::step
void step()
Definition: Jr3.cpp:180
rl::math::Vector
::Eigen::Matrix< Real, ::Eigen::Dynamic, 1 > Vector
Definition: Vector.h:42
rl::hal::Jr3::getForcesMinimum
::rl::math::Real getForcesMinimum(const ::std::size_t &i) const
Definition: Jr3.cpp:93
rl::hal::Jr3::close
void close()
Definition: Jr3.cpp:65
rl::hal::Jr3::open
void open()
Definition: Jr3.cpp:159
rl::hal::CyclicDevice
Definition: CyclicDevice.h:39
rl::hal::Jr3::getForcesTorquesMaximum
::rl::math::Real getForcesTorquesMaximum(const ::std::size_t &i) const
Definition: Jr3.cpp:114
rl::hal::Jr3::zeroes
float zeroes[6]
Definition: Jr3.h:89
rl::hal::Jr3::getForces
::rl::math::Vector getForces() const
Definition: Jr3.cpp:72
rl::hal::Jr3::getForcesTorques
::rl::math::Vector getForcesTorques() const
Definition: Jr3.cpp:101
rl::hal::Comedi
Definition: Comedi.h:40
Comedi.h
rl::hal::Jr3::bias
void bias()
Definition: Jr3.cpp:56
rl::hal::Jr3::getForcesTorquesMinimum
::rl::math::Real getForcesTorquesMinimum(const ::std::size_t &i) const
Definition: Jr3.cpp:122
rl::hal::Jr3::values
float values[6]
Definition: Jr3.h:87
rl::hal::Jr3::getForcesMaximum
::rl::math::Real getForcesMaximum(const ::std::size_t &i) const
Definition: Jr3.cpp:85
CyclicDevice.h
rl::hal::Jr3::Jr3
Jr3(const ::std::string &filename="/dev/comedi0", const ::std::chrono::nanoseconds &updateRate=::std::chrono::milliseconds(1))
Definition: Jr3.cpp:37
rl::hal::Jr3::getTorquesMinimum
::rl::math::Real getTorquesMinimum(const ::std::size_t &i) const
Definition: Jr3.cpp:151
rl::hal::CyclicDevice::updateRate
::std::chrono::nanoseconds updateRate
Definition: CyclicDevice.h:55
rl::hal::Jr3::stop
void stop()
Definition: Jr3.cpp:189
rl::math::Real
double Real
Definition: Real.h:42
rl::hal::Jr3::getTorques
::rl::math::Vector getTorques() const
Definition: Jr3.cpp:130
rl::hal::Jr3::start
void start()
Definition: Jr3.cpp:175
rl
Robotics Library.
Definition: AnalogInput.cpp:30