Fawkes API  Fawkes Development Version
PanTiltDirectedPerceptionThread::WorkerThread Class Reference

Worker thread for the PanTiltDirectedPerceptionThread. More...

#include "sony/evid100p_thread.h"

Inheritance diagram for PanTiltDirectedPerceptionThread::WorkerThread:

List of all members.

Public Member Functions

 WorkerThread (std::string ptu_name, fawkes::Logger *logger, fawkes::RefPtr< DirectedPerceptionPTU > ptu)
 Constructor.
 ~WorkerThread ()
 Destructor.
void goto_pantilt (float pan, float tilt)
 Goto desired pan/tilt values.
void get_pantilt (float &pan, float &tilt)
 Get pan/tilt value.
bool is_final ()
 Check if motion is final.
void stop_motion ()
 Stop currently running motion.
bool has_fresh_data ()
 Check is fresh sensor data is available.
void reset ()
 Trigger a reset of the PTU.
virtual void loop ()
 Code to execute in the thread.

Detailed Description

Worker thread for the PanTiltDirectedPerceptionThread.

This continuous thread issues commands to the camera. In each loop it will first execute pending operations, and then update the sensor data (lengthy operation). Sensor data will only be updated while either a servo in the chain is still moving or torque is disabled (so the motor can be move manually).

Author:
Tim Niemueller

Constructor & Destructor Documentation

PanTiltDirectedPerceptionThread::WorkerThread::WorkerThread ( std::string  ptu_name,
fawkes::Logger logger,
fawkes::RefPtr< DirectedPerceptionPTU ptu 
)

Constructor.

Parameters:
ptu_namename of the pan/tilt unit
loggerlogger
ptuptu controller

Definition at line 233 of file dp_thread.cpp.

References fawkes::Thread::set_name(), fawkes::Thread::set_coalesce_wakeups(), and fawkes::LoggingAspect::logger.

PanTiltDirectedPerceptionThread::WorkerThread::~WorkerThread ( )

Destructor.

Definition at line 256 of file dp_thread.cpp.


Member Function Documentation

void PanTiltDirectedPerceptionThread::WorkerThread::get_pantilt ( float &  pan,
float &  tilt 
)

Get pan/tilt value.

Parameters:
panupon return contains the current pan value
tiltupon return contains the current tilt value

Definition at line 292 of file dp_thread.cpp.

Referenced by PanTiltDirectedPerceptionThread::update_sensor_values().

void PanTiltDirectedPerceptionThread::WorkerThread::goto_pantilt ( float  pan,
float  tilt 
)

Goto desired pan/tilt values.

Parameters:
panpan in radians
tilttilt in radians

Definition at line 277 of file dp_thread.cpp.

References fawkes::Thread::wakeup().

Referenced by PanTiltDirectedPerceptionThread::loop().

bool PanTiltDirectedPerceptionThread::WorkerThread::has_fresh_data ( )

Check is fresh sensor data is available.

Note that this method will return true at once per sensor update cycle.

Returns:
true if fresh data is available, false otherwise

Definition at line 324 of file dp_thread.cpp.

Referenced by PanTiltDirectedPerceptionThread::update_sensor_values().

bool PanTiltDirectedPerceptionThread::WorkerThread::is_final ( )

Check if motion is final.

Returns:
true if motion is final, false otherwise

Definition at line 311 of file dp_thread.cpp.

Referenced by PanTiltDirectedPerceptionThread::update_sensor_values(), and PanTiltDirectedPerceptionThread::loop().

void PanTiltDirectedPerceptionThread::WorkerThread::loop ( ) [virtual]

Code to execute in the thread.

Implement this method to hold the code you want to be executed continously. If you do not implement this method, the default is that the thread will exit. This is useful if you choose to only implement once().

Reimplemented from fawkes::Thread.

Definition at line 333 of file dp_thread.cpp.

References fawkes::RefPtr::reset(), fawkes::Thread::name(), and fawkes::Thread::wakeup().

void PanTiltDirectedPerceptionThread::WorkerThread::reset ( void  )

Trigger a reset of the PTU.

Definition at line 301 of file dp_thread.cpp.

Referenced by PanTiltDirectedPerceptionThread::loop().

void PanTiltDirectedPerceptionThread::WorkerThread::stop_motion ( )

Stop currently running motion.

Definition at line 264 of file dp_thread.cpp.


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