Robotics Library  0.7.0
Coach.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_COACH_H
28 #define RL_HAL_COACH_H
29 
30 #include <array>
31 #include <sstream>
32 #include <string>
33 
34 #include "CyclicDevice.h"
35 #include "JointPositionActuator.h"
36 #include "JointPositionSensor.h"
37 #include "JointTorqueActuator.h"
38 #include "JointVelocityActuator.h"
39 #include "Socket.h"
40 
41 namespace rl
42 {
43  namespace hal
44  {
46  {
47  public:
48  Coach(
49  const ::std::size_t& dof,
50  const ::std::chrono::nanoseconds& updateRate,
51  const ::std::size_t& i = 0,
52  const ::std::string& hostname = "localhost",
53  const unsigned short int& port = 11235
54  );
55 
56  virtual ~Coach();
57 
58  void close();
59 
61 
62  void open();
63 
65 
67 
69 
70  void start();
71 
72  void step();
73 
74  void stop();
75 
76  protected:
77 
78  private:
79  ::std::size_t i;
80 
81  ::std::array<char, 1024> in;
82 
83  ::std::stringstream out;
84 
86  };
87  }
88 }
89 
90 #endif // RL_HAL_COACH_H
JointTorqueActuator.h
rl::hal::Coach::in
::std::array< char, 1024 > in
Definition: Coach.h:81
rl::hal::JointPositionSensor
Definition: JointPositionSensor.h:39
rl::hal::Socket
Definition: Socket.h:48
rl::hal::Coach::step
void step()
Definition: Coach.cpp:149
rl::hal::JointVelocityActuator
Definition: JointVelocityActuator.h:39
rl::hal::Coach::open
void open()
Definition: Coach.cpp:90
rl::hal::Coach::close
void close()
Definition: Coach.cpp:63
JointVelocityActuator.h
rl::math::Vector
::Eigen::Matrix< Real, ::Eigen::Dynamic, 1 > Vector
Definition: Vector.h:42
rl::hal::Coach
Definition: Coach.h:46
rl::hal::Coach::setJointVelocity
void setJointVelocity(const ::rl::math::Vector &qd)
Definition: Coach.cpp:128
rl::hal::Coach::stop
void stop()
Definition: Coach.cpp:167
rl::hal::CyclicDevice
Definition: CyclicDevice.h:39
rl::hal::Coach::socket
Socket socket
Definition: Coach.h:85
rl::hal::AxisController::dof
::std::size_t dof
Degrees of freedom.
Definition: AxisController.h:52
rl::hal::Coach::getJointPosition
::rl::math::Vector getJointPosition() const
Definition: Coach.cpp:70
rl::hal::Coach::setJointTorque
void setJointTorque(const ::rl::math::Vector &tau)
Definition: Coach.cpp:113
rl::hal::Coach::i
::std::size_t i
Definition: Coach.h:79
rl::hal::Coach::setJointPosition
void setJointPosition(const ::rl::math::Vector &q)
Definition: Coach.cpp:98
JointPositionSensor.h
JointPositionActuator.h
rl::hal::Coach::~Coach
virtual ~Coach()
Definition: Coach.cpp:58
CyclicDevice.h
rl::hal::Coach::start
void start()
Definition: Coach.cpp:143
rl::hal::JointTorqueActuator
Definition: JointTorqueActuator.h:39
rl::hal::CyclicDevice::updateRate
::std::chrono::nanoseconds updateRate
Definition: CyclicDevice.h:55
rl::hal::JointPositionActuator
Definition: JointPositionActuator.h:39
rl::hal::Coach::out
::std::stringstream out
Definition: Coach.h:83
rl::hal::Coach::Coach
Coach(const ::std::size_t &dof, const ::std::chrono::nanoseconds &updateRate, const ::std::size_t &i=0, const ::std::string &hostname="localhost", const unsigned short int &port=11235)
Definition: Coach.cpp:38
Socket.h
rl
Robotics Library.
Definition: AnalogInput.cpp:30