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< fawkes::KatanaController > 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 < fawkes::KatanaController > | _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< fawkes::KatanaController > | katana, | ||
fawkes::Logger * | logger | ||
) |
Constructor.
thread_name | name of the thread |
katana | katana controller base class |
logger | logger |
Definition at line 45 of file motion_thread.cpp.
References _katana, _logger, _finished, and _error_code.
unsigned int KatanaMotionThread::error_code | ( | ) | const |
Error code.
Definition at line 72 of file motion_thread.cpp.
References _error_code.
bool KatanaMotionThread::finished | ( | ) | const |
Did the motion finish already?
Definition at line 61 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 84 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 56 of file motion_thread.h.
Referenced by KatanaCalibrationThread::once(), KatanaGotoThread::once(), KatanaGripperThread::once(), KatanaMotionThread(), error_code(), reset(), and KatanaMotorControlThread::once().
bool KatanaMotionThread::_finished [protected] |
Set to true when motion is finished, to false on reset.
Definition at line 52 of file motion_thread.h.
Referenced by KatanaCalibrationThread::once(), KatanaGotoThread::once(), KatanaGripperThread::once(), KatanaMotionThread(), finished(), reset(), and KatanaMotorControlThread::once().
Katana object for interaction with the arm.
Definition at line 50 of file motion_thread.h.
Referenced by KatanaCalibrationThread::once(), KatanaGotoThread::once(), KatanaGripperThread::once(), KatanaMotionThread(), and KatanaMotorControlThread::once().
fawkes::Logger* KatanaMotionThread::_logger [protected] |
Logger.
Definition at line 54 of file motion_thread.h.
Referenced by KatanaCalibrationThread::once(), KatanaGotoThread::once(), KatanaGripperThread::once(), KatanaMotionThread(), and KatanaMotorControlThread::once().