device.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * Florent Lamiraux
4  *
5  * CNRS
6  *
7  */
8 
9 #ifndef SOT_DEVICE_HH
10 #define SOT_DEVICE_HH
11 
12 /* --------------------------------------------------------------------- */
13 /* --- INCLUDE --------------------------------------------------------- */
14 /* --------------------------------------------------------------------- */
15 
16 #include <pinocchio/fwd.hpp>
17 
18 /* -- MaaL --- */
20 
21 /* SOT */
23 #include <dynamic-graph/entity.h>
24 
27 
28 #include "sot/core/api.hh"
29 
30 namespace dynamicgraph {
31 namespace sot {
32 
39 };
40 
41 const std::string ControlInput_s[] = {"noInteg", "oneInteg", "twoInteg"};
42 
43 /* --------------------------------------------------------------------- */
44 /* --- CLASS ----------------------------------------------------------- */
45 /* --------------------------------------------------------------------- */
46 
47 class SOT_CORE_EXPORT Device : public Entity {
48  public:
49  static const std::string CLASS_NAME;
50  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
51 
56  FORCE_SIGNAL_LARM
57  };
58 
59  protected:
65  bool withForceSignals[4];
66  double timestep_;
67 
77  public:
78  /* --- CONSTRUCTION --- */
79  Device(const std::string &name);
80  /* --- DESTRUCTION --- */
81  virtual ~Device();
82 
83  virtual void setStateSize(const size_type &size);
84  // Set number of joints that are controlled by the device.
85  void setControlSize(const size_type &size);
86  // Get the number of joints that are controlled by the device.
87  size_type getControlSize() const;
88  virtual void setState(const dynamicgraph::Vector &st);
89  void setVelocitySize(const size_type &size);
90  virtual void setVelocity(const dynamicgraph::Vector &vel);
91  virtual void setSecondOrderIntegration();
92  virtual void setNoIntegration();
93  virtual void setControlInputType(const std::string &cit);
94  void getControl(std::map<std::string, ControlValues> &anglesOut,
95  const double &period);
96 
99  void setSanityCheck(const bool &enableCheck);
100  void setPositionBounds(const Vector &lower, const Vector &upper);
101  void setVelocityBounds(const Vector &lower, const Vector &upper);
102  void setTorqueBounds(const Vector &lower, const Vector &upper);
104 
105  public: /* --- DISPLAY --- */
106  virtual void display(std::ostream &os) const;
107  virtual void cmdDisplay();
108  SOT_CORE_EXPORT friend std::ostream &operator<<(std::ostream &os,
109  const Device &r) {
110  r.display(os);
111  return os;
112  }
113 
114  public: /* --- SIGNALS --- */
118 
131 
147 
148  public:
149  virtual void setRoot(const dynamicgraph::Matrix &root);
150 
151  virtual void setRoot(const MatrixHomogeneous &worldMwaist);
152 
153  private:
156  // Intermediate variable to avoid dynamic allocation
158 };
159 } // namespace sot
160 } // namespace dynamicgraph
161 
162 #endif /* #ifndef SOT_DEVICE_HH */
dynamicgraph::Signal< dynamicgraph::Vector, sigtime_t >
dynamicgraph::sot::Device::FORCE_SIGNAL_LLEG
@ FORCE_SIGNAL_LLEG
Definition: device.hh:54
dynamicgraph::sot::Device::getClassName
virtual const std::string & getClassName(void) const
Definition: device.hh:50
dynamicgraph::sot::MatrixHomogeneous
Eigen::Transform< double, 3, Eigen::Affine > SOT_CORE_EXPORT MatrixHomogeneous
Definition: matrix-geometry.hh:75
SOT_CORE_EXPORT
#define SOT_CORE_EXPORT
Definition: api.hh:20
dynamicgraph::sot::Device::controlSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > controlSIN
Definition: device.hh:115
dynamicgraph::sot::Device::CLASS_NAME
static const std::string CLASS_NAME
Definition: device.hh:49
dynamicgraph::sot::Device
Definition: device.hh:47
dynamicgraph::sot::ControlInput
ControlInput
Define the type of input expected by the robot.
Definition: device.hh:34
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t >
dynamicgraph
dynamicgraph::sot::Device::vel_control_
dynamicgraph::Vector vel_control_
Definition: device.hh:63
dynamicgraph::sot::Device::forceZero6
dynamicgraph::Vector forceZero6
Definition: device.hh:157
abstract-sot-external-interface.hh
dynamicgraph::sot::Device::state_
dynamicgraph::Vector state_
Definition: device.hh:60
dynamicgraph::Entity
dynamicgraph::sot::ControlInput_s
const std::string ControlInput_s[]
Definition: device.hh:41
dynamicgraph::Matrix
Eigen::MatrixXd Matrix
dynamicgraph::sot::TORQUE_CONTROL
@ TORQUE_CONTROL
Definition: device.hh:37
dynamicgraph::sot::Device::upperVelocity_
Vector upperVelocity_
Definition: device.hh:71
dynamicgraph::sot::Device::controlSize_
size_type controlSize_
Definition: device.hh:155
dynamicgraph::sot::Device::FORCE_SIGNAL_RLEG
@ FORCE_SIGNAL_RLEG
Definition: device.hh:53
r
FCL_REAL r
dynamicgraph::sot::Device::upperTorque_
Vector upperTorque_
Definition: device.hh:72
dynamicgraph::sot::Device::lastTimeControlWasRead_
sigtime_t lastTimeControlWasRead_
Definition: device.hh:154
dynamicgraph::sot::Device::zmpSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > zmpSIN
Definition: device.hh:117
dynamicgraph::sot::CONTROL_SIZE
@ CONTROL_SIZE
Definition: device.hh:38
dynamicgraph::sigtime_t
int64_t sigtime_t
dynamicgraph::sot::Device::lowerTorque_
Vector lowerTorque_
Definition: device.hh:75
dynamicgraph::sot::Device::lowerPosition_
Vector lowerPosition_
Definition: device.hh:73
dynamicgraph::sot::Device::FORCE_SIGNAL_RARM
@ FORCE_SIGNAL_RARM
Definition: device.hh:55
dynamicgraph::sot::Device::pseudoTorqueSOUT
dynamicgraph::Signal< dynamicgraph::Vector, sigtime_t > pseudoTorqueSOUT
Definition: device.hh:145
api.hh
size
FCL_REAL size() const
dynamicgraph::sot::Device::ForceSignalSource
ForceSignalSource
Definition: device.hh:52
dynamicgraph::sot::Device::motorcontrolSOUT
dynamicgraph::Signal< dynamicgraph::Vector, sigtime_t > motorcontrolSOUT
The current state of the robot from the command viewpoint.
Definition: device.hh:125
all-signals.h
dynamicgraph::size_type
Matrix::Index size_type
display
dynamicgraph::Vector
Eigen::VectorXd Vector
dynamicgraph::sot::POSITION_CONTROL
@ POSITION_CONTROL
Definition: device.hh:35
dynamicgraph::sot::Device::upperPosition_
Vector upperPosition_
Definition: device.hh:70
dynamicgraph::sot::Device::previousControlSOUT
dynamicgraph::Signal< dynamicgraph::Vector, sigtime_t > previousControlSOUT
Definition: device.hh:126
dynamicgraph::sot::Device::sanityCheck_
bool sanityCheck_
Definition: device.hh:62
dynamicgraph::sot::Device::timestep_
double timestep_
Definition: device.hh:66
linear-algebra.h
dynamicgraph::sot::Device::attitudeSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > attitudeSIN
Definition: device.hh:116
dynamicgraph::sot::Device::velocity_
dynamicgraph::Vector velocity_
Definition: device.hh:61
dynamicgraph::sot::Device::velocitySOUT
dynamicgraph::Signal< dynamicgraph::Vector, sigtime_t > velocitySOUT
Definition: device.hh:122
matrix-geometry.hh
dynamicgraph::sot::Device::controlInputType_
ControlInput controlInputType_
Definition: device.hh:64
dynamicgraph::sot::Device::robotState_
dynamicgraph::Signal< dynamicgraph::Vector, sigtime_t > robotState_
Definition: device.hh:138
dynamicgraph::sot::Device::ZMPPreviousControllerSOUT
dynamicgraph::Signal< dynamicgraph::Vector, sigtime_t > ZMPPreviousControllerSOUT
The ZMP reference send by the previous controller.
Definition: device.hh:129
dynamicgraph::sot::Device::robotVelocity_
dynamicgraph::Signal< dynamicgraph::Vector, sigtime_t > robotVelocity_
Motor velocities.
Definition: device.hh:140
dynamicgraph::sot::Device::stateSOUT
dynamicgraph::Signal< dynamicgraph::Vector, sigtime_t > stateSOUT
Definition: device.hh:121
dynamicgraph::sot::Device::attitudeSOUT
dynamicgraph::Signal< MatrixRotation, sigtime_t > attitudeSOUT
Definition: device.hh:123
dynamicgraph::sot::Device::lowerVelocity_
Vector lowerVelocity_
Definition: device.hh:74
dynamicgraph::sot::VELOCITY_CONTROL
@ VELOCITY_CONTROL
Definition: device.hh:36
dynamicgraph::sot::Device::operator<<
SOT_CORE_EXPORT friend std::ostream & operator<<(std::ostream &os, const Device &r)
Definition: device.hh:108
compile.name
name
Definition: compile.py:23


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:31