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 unsigned int &size);
84  // Set number of joints that are controlled by the device.
85  void setControlSize(const int &size);
86  // Get the number of joints that are controlled by the device.
87  int getControlSize() const;
88  virtual void setState(const dynamicgraph::Vector &st);
89  void setVelocitySize(const unsigned int &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 
130 
146 
147  public:
148  virtual void setRoot(const dynamicgraph::Matrix &root);
149 
150  virtual void setRoot(const MatrixHomogeneous &worldMwaist);
151 
152  private:
155  // Intermediate variable to avoid dynamic allocation
157 };
158 } // namespace sot
159 } // namespace dynamicgraph
160 
161 #endif /* #ifndef SOT_DEVICE_HH */
virtual const std::string & getClassName(void) const
Definition: device.hh:50
SOT_CORE_EXPORT friend std::ostream & operator<<(std::ostream &os, const Device &r)
Definition: device.hh:108
Eigen::Transform< double, 3, Eigen::Affine > SOT_CORE_EXPORT MatrixHomogeneous
Eigen::VectorXd Vector
dynamicgraph::Vector vel_control_
Definition: device.hh:63
dynamicgraph::Signal< dynamicgraph::Vector, int > robotState_
Definition: device.hh:137
dynamicgraph::Signal< dynamicgraph::Vector, int > pseudoTorqueSOUT
Definition: device.hh:144
dynamicgraph::Vector state_
Definition: device.hh:60
virtual void display(std::ostream &os) const
Definition: device.cpp:348
static const std::string CLASS_NAME
Definition: device.hh:49
ControlInput
Define the type of input expected by the robot.
Definition: device.hh:34
dynamicgraph::Signal< dynamicgraph::Vector, int > ZMPPreviousControllerSOUT
The ZMP reference send by the previous controller.
Definition: device.hh:128
FCL_REAL r
dynamicgraph::Signal< dynamicgraph::Vector, int > robotVelocity_
Motor velocities.
Definition: device.hh:139
dynamicgraph::Vector forceZero6
Definition: device.hh:156
dynamicgraph::SignalPtr< dynamicgraph::Vector, int > controlSIN
Definition: device.hh:115
#define SOT_CORE_EXPORT
Definition: api.hh:20
const std::string ControlInput_s[]
Definition: device.hh:41
dynamicgraph::Signal< dynamicgraph::Vector, int > motorcontrolSOUT
The current state of the robot from the command viewpoint.
Definition: device.hh:125
FCL_REAL size() const
dynamicgraph::SignalPtr< dynamicgraph::Vector, int > zmpSIN
Definition: device.hh:117
dynamicgraph::Signal< dynamicgraph::Vector, int > previousControlSOUT
Definition: device.hh:126
ControlInput controlInputType_
Definition: device.hh:64
dynamicgraph::Vector velocity_
Definition: device.hh:61
Eigen::MatrixXd Matrix
dynamicgraph::Signal< MatrixRotation, int > attitudeSOUT
Definition: device.hh:123
dynamicgraph::SignalPtr< dynamicgraph::Vector, int > attitudeSIN
Definition: device.hh:116
dynamicgraph::Signal< dynamicgraph::Vector, int > stateSOUT
Definition: device.hh:121
dynamicgraph::Signal< dynamicgraph::Vector, int > velocitySOUT
Definition: device.hh:122


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Wed Jun 21 2023 02:51:26