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< CLMBase > 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.
Definition at line 28 of file gripper_thread.h.
Gripper execution mode.
Definition at line 35 of file gripper_thread.h.
KatanaGripperThread::KatanaGripperThread | ( | fawkes::RefPtr< CLMBase > | katana, | |
fawkes::Logger * | logger, | |||
unsigned int | poll_interval_ms | |||
) |
Constructor.
katana | katana linear motion base class | |
logger | logger | |
poll_interval_ms | interval in ms between two checks if the final position has been reached |
Definition at line 39 of file gripper_thread.cpp.
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 60 of file gripper_thread.cpp.
References KatanaMotionThread::_error_code, KatanaMotionThread::_finished, KatanaMotionThread::_katana, KatanaMotionThread::_logger, CLOSE_GRIPPER, fawkes::KatanaInterface::ERROR_CMD_START_FAILED, fawkes::KatanaInterface::ERROR_COMMUNICATION, fawkes::Logger::log_debug(), fawkes::Logger::log_warn(), and fawkes::Thread::name().
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 53 of file gripper_thread.cpp.