gripper-control.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * François Bleibel,
4  * Olivier Stasse,
5  *
6  * CNRS/AIST
7  *
8  */
9 
10 #ifndef __SOT_SOTGRIPPERCONTROL_H__
11 #define __SOT_SOTGRIPPERCONTROL_H__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* Matrix */
19 
20 /* SOT */
22 #include <dynamic-graph/entity.h>
23 
24 #include <sot/core/flags.hh>
25 
26 /* STD */
27 #include <string>
28 
29 /* --------------------------------------------------------------------- */
30 /* --- API ------------------------------------------------------------- */
31 /* --------------------------------------------------------------------- */
32 
33 #if defined(WIN32)
34 #if defined(gripper_control_EXPORTS)
35 #define SOTGRIPPERCONTROL_EXPORT __declspec(dllexport)
36 #else
37 #define SOTGRIPPERCONTROL_EXPORT __declspec(dllimport)
38 #endif
39 #else
40 #define SOTGRIPPERCONTROL_EXPORT
41 #endif
42 
43 /* --------------------------------------------------------------------- */
44 /* --- CLASS ----------------------------------------------------------- */
45 /* --------------------------------------------------------------------- */
46 
47 namespace dynamicgraph {
48 namespace sot {
49 
57  protected:
58  double offset;
59  static const double OFFSET_DEFAULT;
62 
63  public:
64  GripperControl(void);
65 
67  // if the torque limit is reached, the normalized position is reduced by
68  // (offset)
69  void computeIncrement(const dynamicgraph::Vector &torques,
70  const dynamicgraph::Vector &torqueLimits,
71  const dynamicgraph::Vector &currentNormVel);
72 
74  dynamicgraph::Vector &computeDesiredPosition(
75  const dynamicgraph::Vector &currentPos,
76  const dynamicgraph::Vector &desiredPos,
77  const dynamicgraph::Vector &torques,
78  const dynamicgraph::Vector &torqueLimits,
79  dynamicgraph::Vector &referencePos);
80 
85  static dynamicgraph::Vector &selector(const dynamicgraph::Vector &fullsize,
86  const Flags &selec,
87  dynamicgraph::Vector &desPos);
88 };
89 
90 /* --------------------------------------------------------------------- */
91 /* --- PLUGIN ---------------------------------------------------------- */
92 /* --------------------------------------------------------------------- */
93 
95  : public dynamicgraph::Entity,
96  public GripperControl {
98 
99  public:
101 
102  public: /* --- CONSTRUCTION --- */
103  GripperControlPlugin(const std::string &name);
104  virtual ~GripperControlPlugin(void);
105 
106  /* --- DOCUMENTATION --- */
107  virtual std::string getDocString() const;
108 
109  public: /* --- SIGNAL --- */
110  /* --- INPUTS --- */
116 
117  /* --- INTERMEDIARY --- */
126 
127  /* --- OUTPUTS --- */
130 
131  public: /* --- COMMANDLINE --- */
132  void initCommands();
133 
134  void setOffset(const double &value);
135 };
136 
137 } /* namespace sot */
138 } /* namespace dynamicgraph */
139 
140 #endif // #ifndef __SOT_SOTGRIPPERCONTROL_H__
dynamicgraph::SignalPtr< Flags, int > selectionSIN
Eigen::VectorXd Vector
dynamicgraph::Vector factor
The multiplication.
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, int > positionReduceSOUT
dynamicgraph::SignalPtr< dynamicgraph::Vector, int > torqueLimitSIN
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, int > torqueReduceSOUT
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, int > torqueLimitReduceSOUT
#define DYNAMIC_GRAPH_ENTITY_DECL()
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, int > desiredPositionSOUT
dynamicgraph::SignalPtr< dynamicgraph::Vector, int > positionFullSizeSIN
#define SOTGRIPPERCONTROL_EXPORT
The goal of this entity is to ensure that the maximal torque will not be exceeded during a grasping t...
dynamicgraph::SignalPtr< dynamicgraph::Vector, int > torqueSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, int > torqueLimitFullSizeSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, int > torqueFullSizeSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, int > positionDesSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, int > positionSIN


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