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 --- */
128 
129  /* --- OUTPUTS --- */
132 
133  public: /* --- COMMANDLINE --- */
134  void initCommands();
135 
136  void setOffset(const double &value);
137 };
138 
139 } /* namespace sot */
140 } /* namespace dynamicgraph */
141 
142 #endif // #ifndef __SOT_SOTGRIPPERCONTROL_H__
dynamicgraph::sot::GripperControlPlugin::torqueSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > torqueSIN
Definition: gripper-control.hh:113
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t >
dynamicgraph
dynamicgraph::sot::GripperControlPlugin::desiredPositionSOUT
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, sigtime_t > desiredPositionSOUT
Definition: gripper-control.hh:131
dynamicgraph::Entity
dynamicgraph::sot::GripperControlPlugin::torqueLimitReduceSOUT
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, sigtime_t > torqueLimitReduceSOUT
Definition: gripper-control.hh:127
dynamicgraph::sot::GripperControlPlugin::torqueReduceSOUT
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, sigtime_t > torqueReduceSOUT
Definition: gripper-control.hh:123
dynamicgraph::sot::GripperControlPlugin::positionDesSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > positionDesSIN
Definition: gripper-control.hh:112
dynamicgraph::sot::GripperControlPlugin::selectionSIN
dynamicgraph::SignalPtr< Flags, sigtime_t > selectionSIN
Definition: gripper-control.hh:115
dynamicgraph::sot::GripperControlPlugin::positionReduceSOUT
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, sigtime_t > positionReduceSOUT
Definition: gripper-control.hh:120
DYNAMIC_GRAPH_ENTITY_DECL
#define DYNAMIC_GRAPH_ENTITY_DECL()
dynamicgraph::sot::GripperControlPlugin::torqueLimitSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > torqueLimitSIN
Definition: gripper-control.hh:114
dynamicgraph::sot::GripperControlPlugin::torqueFullSizeSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > torqueFullSizeSIN
Definition: gripper-control.hh:121
dynamicgraph::sot::GripperControl
The goal of this entity is to ensure that the maximal torque will not be exceeded during a grasping t...
Definition: gripper-control.hh:56
all-signals.h
dynamicgraph::sot::GripperControlPlugin::positionFullSizeSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > positionFullSizeSIN
Definition: gripper-control.hh:118
dynamicgraph::Vector
Eigen::VectorXd Vector
dynamicgraph::sot::GripperControlPlugin::torqueLimitFullSizeSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > torqueLimitFullSizeSIN
Definition: gripper-control.hh:125
flags.hh
linear-algebra.h
dynamicgraph::sot::GripperControlPlugin
Definition: gripper-control.hh:94
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, sigtime_t >
dynamicgraph::sot::GripperControl::OFFSET_DEFAULT
static const double OFFSET_DEFAULT
Definition: gripper-control.hh:59
SOTGRIPPERCONTROL_EXPORT
#define SOTGRIPPERCONTROL_EXPORT
Definition: gripper-control.hh:40
dynamicgraph::sot::Flags
Definition: flags.hh:33
dynamicgraph::sot::GripperControl::offset
double offset
Definition: gripper-control.hh:58
dynamicgraph::sot::GripperControlPlugin::positionSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > positionSIN
Definition: gripper-control.hh:111
dynamicgraph::sot::GripperControlPlugin::calibrationStarted
bool calibrationStarted
Definition: gripper-control.hh:100
compile.name
name
Definition: compile.py:23
dynamicgraph::sot::GripperControl::factor
dynamicgraph::Vector factor
The multiplication.
Definition: gripper-control.hh:61


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