Fawkes API
Fawkes Development Version
|
Katana gripper thread. More...
#include "gripper_thread.h"
Public Types | |
enum | gripper_mode_t { OPEN_GRIPPER, CLOSE_GRIPPER } |
Gripper execution mode. More... | |
Public Member Functions | |
KatanaGripperThread (fawkes::RefPtr< fawkes::KatanaController > katana, fawkes::Logger *logger, unsigned int poll_interval_ms) | |
Constructor. | |
void | set_mode (gripper_mode_t mode) |
Set mode. | |
virtual void | once () |
Execute an action exactly once. | |
Protected Member Functions | |
virtual void | run () |
Stub to see name in backtrace for easier debugging. |
Katana gripper thread.
This thread opens or closes the gripper when started.
Gripper execution mode.
Definition at line 35 of file gripper_thread.h.
KatanaGripperThread::KatanaGripperThread | ( | fawkes::RefPtr< fawkes::KatanaController > | katana, |
fawkes::Logger * | logger, | ||
unsigned int | poll_interval_ms | ||
) |
Constructor.
katana | katana controller base class |
logger | logger |
poll_interval_ms | interval in ms between two checks if the final position has been reached |
Definition at line 40 of file gripper_thread.cpp.
References OPEN_GRIPPER.
void KatanaGripperThread::once | ( | ) | [virtual] |
Execute an action exactly once.
This code is executed once and only once right after the thread is started before loop() is called. This is useful if you want to implement an one-shot background job. Just implement once() and leave once() untouched. Start the thread and detach it and it will just do its job and then die automatically. If you use set_delete_on_exit(true) even the Thread instance will be automatically deleted.
Reimplemented from fawkes::Thread.
Definition at line 61 of file gripper_thread.cpp.
References CLOSE_GRIPPER, KatanaMotionThread::_katana, KatanaMotionThread::_logger, fawkes::Logger::log_warn(), fawkes::Exception::what(), KatanaMotionThread::_finished, KatanaMotionThread::_error_code, and fawkes::Logger::log_debug().
virtual void KatanaGripperThread::run | ( | ) | [inline, protected, virtual] |
Stub to see name in backtrace for easier debugging.
Reimplemented from fawkes::Thread.
Definition at line 44 of file gripper_thread.h.
void KatanaGripperThread::set_mode | ( | gripper_mode_t | mode | ) |
Set mode.
mode | open, either open or close |
Definition at line 54 of file gripper_thread.cpp.