Fawkes API  Fawkes Development Version
KatanaMotionThread Class Reference

Katana motion thread base class. More...

#include "motion_thread.h"

Inheritance diagram for KatanaMotionThread:

List of all members.

Public Member Functions

 KatanaMotionThread (const char *thread_name, fawkes::RefPtr< CLMBase > katana, fawkes::Logger *logger)
 Constructor.
bool finished () const
 Did the motion finish already?
virtual void reset ()
 Reset for next execution.
unsigned int error_code () const
 Error code.

Protected Attributes

fawkes::RefPtr< CLMBase > _katana
 Katana object for interaction with the arm.
bool _finished
 Set to true when motion is finished, to false on reset.
fawkes::Logger_logger
 Logger.
unsigned int _error_code
 Set to the desired error code on error.

Detailed Description

Katana motion thread base class.

Base class for motion threads for the Katana.

When implementing a motion thread ensure that you read the sensor data during the communication with the arm. The main (act) thread will not do this as not to interfere with motion thread communication. You can use code like this:

 _katana->GetBase()->GetSCT()->arr[0].recvDAT(); // update sensor values
Author:
Tim Niemueller.

Constructor & Destructor Documentation

KatanaMotionThread::KatanaMotionThread ( const char *  thread_name,
fawkes::RefPtr< CLMBase >  katana,
fawkes::Logger logger 
)

Constructor.

Parameters:
thread_namename of the thread
katanakatana linear motion base class
loggerlogger

Definition at line 46 of file motion_thread.cpp.

References _katana, _logger, _finished, and _error_code.


Member Function Documentation

unsigned int KatanaMotionThread::error_code ( ) const

Error code.

Returns:
error code, one or more of the ERROR_* constants from the KatanaInterface or'ed.

Definition at line 73 of file motion_thread.cpp.

References _error_code.

bool KatanaMotionThread::finished ( ) const

Did the motion finish already?

Returns:
true if the motion was finished, flase otherwise

Definition at line 62 of file motion_thread.cpp.

References _finished.

void KatanaMotionThread::reset ( void  ) [virtual]

Reset for next execution.

Resets _finished and _error_code. If you override this method call the base class method in your method. It should be used to do anything that is required to be able to run the thread again.

Definition at line 85 of file motion_thread.cpp.

References _finished, and _error_code.


Member Data Documentation

unsigned int KatanaMotionThread::_error_code [protected]

Set to the desired error code on error.

Definition at line 53 of file motion_thread.h.

Referenced by KatanaCalibrationThread::once(), KatanaGotoThread::once(), KatanaGripperThread::once(), KatanaMotionThread(), error_code(), and reset().

Set to true when motion is finished, to false on reset.

Definition at line 49 of file motion_thread.h.

Referenced by KatanaCalibrationThread::once(), KatanaGotoThread::once(), KatanaGripperThread::once(), KatanaMotionThread(), finished(), and reset().

Katana object for interaction with the arm.

Definition at line 47 of file motion_thread.h.

Referenced by KatanaCalibrationThread::once(), KatanaGotoThread::once(), KatanaGripperThread::once(), and KatanaMotionThread().


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