Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
cDSAUpdater Class Reference

Class to create an updater thread for continuously updating tactile sensor data. More...

#include <dsaboost.h>

Public Member Functions

 cDSAUpdater (cDSA *_ts, int _error_threshold=DEFAULT_ERROR_THRESHOLD)
 
void interrupt ()
 interrupt the updater thread More...
 

Static Public Attributes

static int const DEFAULT_ERROR_THRESHOLD = 16
 default error threshold, see parameter error_threshold in CTOR More...
 

Private Member Functions

void Updater ()
 the actual run function of the updater thread More...
 

Private Attributes

int error_threshold
 
cDSAts
 
boost::thread updater_thread
 

Detailed Description

Class to create an updater thread for continuously updating tactile sensor data.

Uses boost::thread from the boost library (http://www.boost.org)!

Definition at line 61 of file dsaboost.h.

Constructor & Destructor Documentation

cDSAUpdater::cDSAUpdater ( cDSA _ts,
int  _error_threshold = DEFAULT_ERROR_THRESHOLD 
)

CTOR: start an updater thread for the connected tactile sensor _ts

Make remote DSA send frames. Create a thread that updates _ts->frame continuously

Parameters
_ts- ptr to already initialized cDSA tactile sensor object
_error_threshold- the number of errors that causes a "reset" of the connection to the remote DSA: communication errors with the remote DSACON32m controllers are counted,
  • every error increments the error level,
  • every correct communication decrements the error level (down to 0) if the error level rises above ERROR_THRESHOLD then the connection is closed and the reopened. This is usefull to recover from emergency stop since the hands loose power temporarily in that case.

Definition at line 149 of file dsaboost.cpp.

Member Function Documentation

void cDSAUpdater::interrupt ( )
inline

interrupt the updater thread

Definition at line 93 of file dsaboost.h.

void cDSAUpdater::Updater ( )
private

the actual run function of the updater thread

run function of updater thread

This function reads frames from the remote DSACON32m tactile sensor controllers continuously in an infinite loop.

Uses global variable g_ts as the tactile sensor object which must point to a valid and connected cDSA object on call.

Definition at line 67 of file dsaboost.cpp.

Member Data Documentation

int const cDSAUpdater::DEFAULT_ERROR_THRESHOLD = 16
static

default error threshold, see parameter error_threshold in CTOR

Definition at line 74 of file dsaboost.h.

int cDSAUpdater::error_threshold
private

Definition at line 66 of file dsaboost.h.

cDSA* cDSAUpdater::ts
private

Definition at line 67 of file dsaboost.h.

boost::thread cDSAUpdater::updater_thread
private

Definition at line 64 of file dsaboost.h.


The documentation for this class was generated from the following files:


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