Fawkes API  Fawkes Development Version
KatanaSensorAcquisitionThread Class Reference

Katana sensor acquisition thread. More...

#include "sensacq_thread.h"

Inheritance diagram for KatanaSensorAcquisitionThread:

List of all members.

Public Member Functions

 KatanaSensorAcquisitionThread (fawkes::RefPtr< CLMBase > katana, fawkes::Logger *logger)
 Constructor.
void set_enabled (bool enabled)
 Set whether data acquisition is enabled or not.
virtual void loop ()
 Code to execute in the thread.

Protected Member Functions

virtual void run ()
 Stub to see name in backtrace for easier debugging.

Detailed Description

Katana sensor acquisition thread.

This thread runs continuously and acquires data from the sensor. Since the operation is blocking and may take several miliseconds it is done concurrently to the main loop at specified intervals.

Author:
Tim Niemueller

Constructor & Destructor Documentation

KatanaSensorAcquisitionThread::KatanaSensorAcquisitionThread ( fawkes::RefPtr< CLMBase >  katana,
fawkes::Logger logger 
)

Constructor.

Parameters:
katanakatana linear motion base class
loggerlogger

Definition at line 42 of file sensacq_thread.cpp.


Member Function Documentation

void KatanaSensorAcquisitionThread::loop ( ) [virtual]

Code to execute in the thread.

Implement this method to hold the code you want to be executed continously. If you do not implement this method, the default is that the thread will exit. This is useful if you choose to only implement once().

Reimplemented from fawkes::Thread.

Definition at line 71 of file sensacq_thread.cpp.

References fawkes::Logger::log_warn(), fawkes::Thread::name(), and fawkes::Exception::what().

virtual void KatanaSensorAcquisitionThread::run ( ) [inline, protected, virtual]

Stub to see name in backtrace for easier debugging.

See also:
Thread::run()

Reimplemented from fawkes::Thread.

Definition at line 44 of file sensacq_thread.h.

void KatanaSensorAcquisitionThread::set_enabled ( bool  enabled)

Set whether data acquisition is enabled or not.

In general the thread should only be woken up if sensor data can be acquired. But for safety data acqusition can also be turned off to be safe against spurious wakeups. Additionally, this method will acquire the loop mutex, thereby assuring that a possibly running loop has finished.

Parameters:
enabledtrue to enable sensor data acquisition, false to disable.

Definition at line 62 of file sensacq_thread.cpp.

References fawkes::Thread::loop_mutex, fawkes::Mutex::lock(), and fawkes::Mutex::unlock().


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