dsaboost.h
Go to the documentation of this file.
1 //======================================================================
32 //======================================================================
33 #ifndef DSABOOST_h
34 #define DSABOOST_h
35 
36 #include <iostream>
37 #include <vector>
38 #include <assert.h>
39 
40 // Include the cSDH interface
41 #include "sdh/sdh.h"
42 #include "sdh/util.h"
44 #include "sdh/basisdef.h"
45 #include "sdh/dsa.h"
46 
47 #include "boost/thread.hpp"
48 #include "boost/date_time/posix_time/posix_time.hpp"
49 
50 
51 //-----------------------------------------------------------------
52 
53 
55 
62 {
63 private:
64  boost::thread updater_thread;
65 
67  cDSA* ts;
68 
70  void Updater();
71 
72 public:
74  static int const DEFAULT_ERROR_THRESHOLD = 16;
75 
90  cDSAUpdater( cDSA* _ts, int _error_threshold=DEFAULT_ERROR_THRESHOLD );
91 
93  void interrupt()
94  { updater_thread.interrupt(); };
95 };
96 //-----------------------------------------------------------------
97 
102 {
103 protected:
104  SDH::cDSA* ts;
105 
106 public:
107  cIsGraspedBase( SDH::cDSA* _ts )
108  :
109  // init member objects:
110  ts( _ts )
111  {
112  }
113 
114  virtual bool IsGrasped(void) = 0;
115 };
116 //-----------------------------------------------------------------
117 
118 
123 {
124 private:
125  double expected_area[ 6 ];
126 
128  double FullArea( int m );
129 
130 public:
140  void SetCondition( double eaf0p, double eaf0d, double eaf1p, double eaf1d, double eaf2p, double eaf2d );
141 
143  void SetCondition( double* eafx );
144 
146  cIsGraspedByArea( SDH::cDSA* _ts );
147 
153  virtual bool IsGrasped(void);
154 };
155 
157 
158 #endif
159 
160 //======================================================================
161 /*
162  Here are some settings for the emacs/xemacs editor (and can be safely ignored)
163  (e.g. to explicitely set C++ mode for *.h header files)
164 
165  Local Variables:
166  mode:C++
167  mode:ELSE
168  End:
169 */
170 //======================================================================]
class for calculation of IsGrasped condition using an expected area of contact measured by the tactil...
Definition: dsaboost.h:122
SDH::cDSA * ts
ptr to the cDSA tactile sensor object to use
Definition: dsaboost.h:104
This file contains the interface to class #SDH::cSDH, the end user class to access the SDH from a PC...
static int const DEFAULT_ERROR_THRESHOLD
default error threshold, see parameter error_threshold in CTOR
Definition: dsaboost.h:74
int error_threshold
Definition: dsaboost.h:66
cIsGraspedBase(SDH::cDSA *_ts)
Definition: dsaboost.h:107
#define NAMESPACE_SDH_START
cDSAUpdater(cDSA *_ts, int _error_threshold=DEFAULT_ERROR_THRESHOLD)
Definition: dsaboost.cpp:149
SDH::cDSA is the end user interface class to access the DSACON32m, the tactile sensor controller of t...
Definition: dsa.h:111
abstract base class for calculation of IsGrasped condition using tactile sensor information ...
Definition: dsaboost.h:101
Interface of auxilliary utility functions for SDHLibrary-CPP.
This file contains interface to #SDH::cDSA, a class to communicate with the tactile sensors of the SD...
boost::thread updater_thread
Definition: dsaboost.h:64
void Updater()
the actual run function of the updater thread
Definition: dsaboost.cpp:67
#define NAMESPACE_SDH_END
This file contains settings to make the SDHLibrary compile on differen systems:
This file contains some basic definitions (defines, macros, datatypes)
cDSA * ts
Definition: dsaboost.h:67
Class to create an updater thread for continuously updating tactile sensor data.
Definition: dsaboost.h:61
void interrupt()
interrupt the updater thread
Definition: dsaboost.h:93


sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Sun Aug 18 2019 03:42:20