Fawkes API
Fawkes Development Version
|
Katana motion thread base class. More...
#include "motion_thread.h"
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. |
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
KatanaMotionThread::KatanaMotionThread | ( | const char * | thread_name, |
fawkes::RefPtr< CLMBase > | katana, | ||
fawkes::Logger * | logger | ||
) |
Constructor.
thread_name | name of the thread |
katana | katana linear motion base class |
logger | logger |
Definition at line 46 of file motion_thread.cpp.
References _katana, _logger, _finished, and _error_code.
unsigned int KatanaMotionThread::error_code | ( | ) | const |
Error code.
Definition at line 73 of file motion_thread.cpp.
References _error_code.
bool KatanaMotionThread::finished | ( | ) | const |
Did the motion finish already?
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.
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().
bool KatanaMotionThread::_finished [protected] |
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().
fawkes::RefPtr<CLMBase> KatanaMotionThread::_katana [protected] |
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().
fawkes::Logger* KatanaMotionThread::_logger [protected] |
Logger.
Definition at line 51 of file motion_thread.h.
Referenced by KatanaCalibrationThread::once(), KatanaGotoThread::once(), KatanaGripperThread::once(), and KatanaMotionThread().