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 //======================================================================]
cDSA
SDH::cDSA is the end user interface class to access the DSACON32m, the tactile sensor controller of t...
Definition: dsa.h:111
cIsGraspedBase::ts
SDH::cDSA * ts
ptr to the cDSA tactile sensor object to use
Definition: dsaboost.h:104
cIsGraspedBase
abstract base class for calculation of IsGrasped condition using tactile sensor information
Definition: dsaboost.h:101
NAMESPACE_SDH_END
#define NAMESPACE_SDH_END
Definition: sdhlibrary_settings.h:80
cIsGraspedByArea::SetCondition
void SetCondition(double eaf0p, double eaf0d, double eaf1p, double eaf1d, double eaf2p, double eaf2d)
Definition: dsaboost.cpp:172
cIsGraspedByArea::IsGrasped
virtual bool IsGrasped(void)
Definition: dsaboost.cpp:202
cDSAUpdater
Class to create an updater thread for continuously updating tactile sensor data.
Definition: dsaboost.h:61
cIsGraspedByArea::expected_area
double expected_area[6]
array of expected contact area of sensor patch in mm*mm
Definition: dsaboost.h:125
cDSAUpdater::cDSAUpdater
cDSAUpdater(cDSA *_ts, int _error_threshold=DEFAULT_ERROR_THRESHOLD)
Definition: dsaboost.cpp:149
cIsGraspedBase::IsGrasped
virtual bool IsGrasped(void)=0
cDSAUpdater::updater_thread
boost::thread updater_thread
Definition: dsaboost.h:64
dsa.h
This file contains interface to #SDH::cDSA, a class to communicate with the tactile sensors of the SD...
NAMESPACE_SDH_START
#define NAMESPACE_SDH_START
Definition: sdhlibrary_settings.h:79
cDSAUpdater::DEFAULT_ERROR_THRESHOLD
static const int DEFAULT_ERROR_THRESHOLD
default error threshold, see parameter error_threshold in CTOR
Definition: dsaboost.h:74
cDSAUpdater::Updater
void Updater()
the actual run function of the updater thread
Definition: dsaboost.cpp:67
basisdef.h
This file contains some basic definitions (defines, macros, datatypes)
cIsGraspedByArea::cIsGraspedByArea
cIsGraspedByArea(SDH::cDSA *_ts)
default constructor which initializes the internal date
Definition: dsaboost.cpp:190
cIsGraspedByArea::FullArea
double FullArea(int m)
helper function, return full area of sensor patch m in mm*mm
Definition: dsaboost.cpp:165
cIsGraspedByArea
class for calculation of IsGrasped condition using an expected area of contact measured by the tactil...
Definition: dsaboost.h:122
cDSAUpdater::interrupt
void interrupt()
interrupt the updater thread
Definition: dsaboost.h:93
sdhlibrary_settings.h
This file contains settings to make the SDHLibrary compile on differen systems:
cIsGraspedBase::cIsGraspedBase
cIsGraspedBase(SDH::cDSA *_ts)
Definition: dsaboost.h:107
sdh.h
This file contains the interface to class #SDH::cSDH, the end user class to access the SDH from a PC.
cDSAUpdater::ts
cDSA * ts
Definition: dsaboost.h:67
util.h
Interface of auxilliary utility functions for SDHLibrary-CPP.
cDSAUpdater::error_threshold
int error_threshold
Definition: dsaboost.h:66


sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Wed Mar 2 2022 01:00:58