Fawkes API  Fawkes Development Version
KatanaGripperThread Class Reference

Katana gripper thread. More...

#include "gripper_thread.h"

Inheritance diagram for KatanaGripperThread:

List of all members.

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.

Detailed Description

Katana gripper thread.

This thread opens or closes the gripper when started.

Author:
Tim Niemueller

Member Enumeration Documentation

Gripper execution mode.

Enumerator:
OPEN_GRIPPER 

Open gripper.

CLOSE_GRIPPER 

Close gripper.

Definition at line 35 of file gripper_thread.h.


Constructor & Destructor Documentation

KatanaGripperThread::KatanaGripperThread ( fawkes::RefPtr< CLMBase >  katana,
fawkes::Logger logger,
unsigned int  poll_interval_ms 
)

Constructor.

Parameters:
katanakatana linear motion base class
loggerlogger
poll_interval_msinterval in ms between two checks if the final position has been reached

Definition at line 39 of file gripper_thread.cpp.

References OPEN_GRIPPER.


Member Function Documentation

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 CLOSE_GRIPPER, KatanaMotionThread::_katana, KatanaMotionThread::_logger, fawkes::Logger::log_warn(), KatanaMotionThread::_finished, KatanaMotionThread::_error_code, fawkes::Logger::log_debug(), and fawkes::Thread::name().

virtual void KatanaGripperThread::run ( ) [inline, protected, virtual]

Stub to see name in backtrace for easier debugging.

See also:
Thread::run()

Reimplemented from fawkes::Thread.

Definition at line 44 of file gripper_thread.h.

void KatanaGripperThread::set_mode ( gripper_mode_t  mode)

Set mode.

Parameters:
modeopen, either open or close

Definition at line 53 of file gripper_thread.cpp.


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