Fawkes API
Fawkes Development Version
|
Pan/tilt act thread. More...
#include "act_thread.h"
Public Member Functions | |
PanTiltActThread (const char *thread_name) | |
Constructor. | |
virtual | ~PanTiltActThread () |
Destructor. | |
virtual void | update_sensor_values ()=0 |
Update sensor values of the PTU in the BB interface. | |
![]() | |
virtual | ~Thread () |
Virtual destructor. | |
virtual void | init () |
Initialize the thread. | |
bool | prepare_finalize () |
Prepare finalization. | |
virtual bool | prepare_finalize_user () |
Prepare finalization user implementation. | |
virtual void | finalize () |
Finalize the thread. | |
void | cancel_finalize () |
Cancel finalization. | |
void | start (bool wait=true) |
Call this method to start the thread. | |
void | cancel () |
Cancel a thread. | |
void | join () |
Join the thread. | |
void | detach () |
Detach the thread. | |
void | kill (int sig) |
Send signal to a thread. | |
bool | operator== (const Thread &thread) |
Check if two threads are the same. | |
void | wakeup () |
Wake up thread. | |
void | wakeup (Barrier *barrier) |
Wake up thread and wait for barrier afterwards. | |
void | wait_loop_done () |
Wait for the current loop iteration to finish. | |
OpMode | opmode () const |
Get operation mode. | |
pthread_t | thread_id () const |
Get ID of thread. | |
bool | started () const |
Check if thread has been started. | |
bool | cancelled () const |
Check if thread has been cancelled. | |
bool | detached () const |
Check if thread has been detached. | |
bool | running () const |
Check if the thread is running. | |
bool | waiting () const |
Check if thread is currently waiting for wakeup. | |
const char * | name () const |
Get name of thread. | |
void | set_flags (uint32_t flags) |
Set all flags in one go. | |
void | set_flag (uint32_t flag) |
Set flag for the thread. | |
void | unset_flag (uint32_t flag) |
Unset flag. | |
bool | flagged_bad () const |
Check if FLAG_BAD was set. | |
void | set_delete_on_exit (bool del) |
Set whether the thread should be deleted on exit. | |
void | set_prepfin_hold (bool hold) |
Hold prepare_finalize(). | |
void | add_notification_listener (ThreadNotificationListener *notification_listener) |
Add notification listener. | |
void | remove_notification_listener (ThreadNotificationListener *notification_listener) |
Remove notification listener. | |
![]() | |
BlockedTimingAspect (WakeupHook wakeup_hook) | |
Constructor. | |
virtual | ~BlockedTimingAspect () |
Virtual empty destructor. | |
WakeupHook | blockedTimingAspectHook () const |
Get the wakeup hook. | |
![]() | |
const std::list< const char * > & | get_aspects () const |
Get list of aspect names attached to a aspected thread. | |
![]() | |
LoggingAspect () | |
Constructor. | |
virtual | ~LoggingAspect () |
Virtual empty Destructor. | |
void | init_LoggingAspect (Logger *logger) |
Set the logger. | |
![]() | |
ConfigurableAspect () | |
Constructor. | |
virtual | ~ConfigurableAspect () |
Virtual empty Destructor. | |
void | init_ConfigurableAspect (Configuration *config) |
Set the configuration It is guaranteed that this is called for a configurable thread before Thread::start() is called (when running regularly inside Fawkes). | |
![]() | |
BlackBoardAspect () | |
Constructor. | |
virtual | ~BlackBoardAspect () |
Virtual empty destructor. | |
void | init_BlackBoardAspect (BlackBoard *bb) |
Init BlackBoard aspect. |
Additional Inherited Members | |
![]() | |
enum | OpMode { OPMODE_CONTINUOUS, OPMODE_WAITFORWAKEUP } |
Thread operation mode. More... | |
enum | CancelState { CANCEL_ENABLED, CANCEL_DISABLED } |
Cancel state. More... | |
![]() | |
enum | WakeupHook { WAKEUP_HOOK_PRE_LOOP, WAKEUP_HOOK_SENSOR_ACQUIRE, WAKEUP_HOOK_SENSOR_PREPARE, WAKEUP_HOOK_SENSOR_PROCESS, WAKEUP_HOOK_WORLDSTATE, WAKEUP_HOOK_THINK, WAKEUP_HOOK_SKILL, WAKEUP_HOOK_ACT, WAKEUP_HOOK_ACT_EXEC, WAKEUP_HOOK_POST_LOOP } |
Type to define at which hook the thread is woken up. More... | |
![]() | |
static Thread * | current_thread () |
Get the Thread instance of the currently running thread. | |
static Thread * | current_thread_noexc () throw () |
Similar to current_thread, but does never throw an exception. | |
static pthread_t | current_thread_id () |
Get the ID of the currently running thread. | |
static void | init_main () |
Initialize Thread wrapper instance for main thread. | |
static void | destroy_main () |
Destroy main thread wrapper instance. | |
static void | set_cancel_state (CancelState new_state, CancelState *old_state=0) |
Set the cancel state of the current thread. | |
![]() | |
static const char * | blocked_timing_hook_to_string (WakeupHook hook) |
Get string for wakeup hook. | |
![]() | |
static const unsigned int | FLAG_BAD = 0x00000001 |
Standard thread flag: "thread is bad". | |
![]() | |
Thread (const char *name) | |
Constructor. | |
Thread (const char *name, OpMode op_mode) | |
Constructor. | |
void | exit () |
Exit the thread. | |
void | test_cancel () |
Set cancellation point. | |
void | yield () |
Yield the processor to another thread or process. | |
virtual void | run () |
Code to execute in the thread. | |
void | set_opmode (OpMode op_mode) |
Set operation mode. | |
void | set_prepfin_conc_loop (bool concurrent=true) |
Set concurrent execution of prepare_finalize() and loop(). | |
void | set_coalesce_wakeups (bool coalesce=true) |
Set wakeup coalescing. | |
void | set_name (const char *format,...) |
Set name of thread. | |
virtual void | once () |
Execute an action exactly once. | |
virtual void | loop () |
Code to execute in the thread. | |
bool | wakeup_pending () |
Check if wakeups are pending. | |
![]() | |
bool | finalize_prepared |
True if prepare_finalize() has been called and was not stopped with a cancel_finalize(), false otherwise. | |
Mutex * | loop_mutex |
Mutex that is used to protect a call to loop(). | |
Mutex * | loopinterrupt_antistarve_mutex |
Mutex to avoid starvation when trying to lock loop_mutex. | |
![]() | |
Logger * | logger |
This is the Logger member used to access the logger. | |
![]() | |
Configuration * | config |
This is the Configuration member used to access the configuration. | |
![]() | |
BlackBoard * | blackboard |
This is the BlackBoard instance you can use to interact with the BlackBoard. |
Pan/tilt act thread.
This thread integrates into the Fawkes main loop at the ACT_EXEC hook and interacts with the controller of a particular pan/tilt unit. Note that this abstract class is then implemented by threads interacting with a particular pan/tilt unit.
Each implementation of this thread shall open an instance of a PanTiltInterface and act within this thread's loop() method. The data read back from the unit shall be written in the update_sensor_values() method, that is called from the PanTiltSensorThread.
Definition at line 36 of file act_thread.h.
PanTiltActThread::PanTiltActThread | ( | const char * | thread_name | ) |
|
virtual |
Destructor.
Definition at line 56 of file act_thread.cpp.
|
pure virtual |
Update sensor values of the PTU in the BB interface.
Implemented in PanTiltRX28Thread, PanTiltDirectedPerceptionThread, and PanTiltSonyEviD100PThread.