Fawkes API
Fawkes Development Version
|
Worker thread for the PanTiltDirectedPerceptionThread. More...
#include "sony/evid100p_thread.h"
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. |
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).
PanTiltDirectedPerceptionThread::WorkerThread::WorkerThread | ( | std::string | ptu_name, |
fawkes::Logger * | logger, | ||
fawkes::RefPtr< DirectedPerceptionPTU > | ptu | ||
) |
Constructor.
ptu_name | name of the pan/tilt unit |
logger | logger |
ptu | ptu 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.
void PanTiltDirectedPerceptionThread::WorkerThread::get_pantilt | ( | float & | pan, |
float & | tilt | ||
) |
Get pan/tilt value.
pan | upon return contains the current pan value |
tilt | upon 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.
pan | pan in radians |
tilt | tilt 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.
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.
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.