camera_base
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
camera_base::Task Class Reference

#include <Task.hpp>

Inheritance diagram for camera_base::Task:

Public Member Functions

 Task (std::string const &name="camera::Task")
 
 Task (std::string const &name, RTT::ExecutionEngine *engine)
 
 ~Task ()
 
virtual bool configureCamera ()
 
virtual void setExtraAttributes (base::samples::frame::Frame *frame_ptr)
 
bool configureHook ()
 
bool startHook ()
 
void updateHook ()
 
void stopHook ()
 
void cleanupHook ()
 

Protected Member Functions

virtual double getDoubleAttrib (::camera::double_attrib::CamAttrib const &type)
 
virtual double getDoubleRangeMax (::camera::double_attrib::CamAttrib const &type)
 
virtual double getDoubleRangeMin (::camera::double_attrib::CamAttrib const &type)
 
virtual boost::int32_t getIntAttrib (::camera::int_attrib::CamAttrib const &type)
 
virtual boost::int32_t getIntRangeMax (::camera::int_attrib::CamAttrib const &type)
 
virtual boost::int32_t getIntRangeMin (::camera::int_attrib::CamAttrib const &type)
 
virtual ::std::string getStringAttrib (::camera::str_attrib::CamAttrib const &type)
 
virtual bool isEnumAttribSet (::camera::enum_attrib::CamAttrib const &type)
 
virtual bool setDoubleAttrib (::camera::double_attrib::CamAttrib const &type, double value)
 
virtual bool setEnumAttrib (::camera::enum_attrib::CamAttrib const &type)
 
virtual bool setIntAttrib (::camera::int_attrib::CamAttrib const &type, boost::int32_t value)
 
virtual bool setStringAttrib (::camera::str_attrib::CamAttrib const &type, ::std::string const &value)
 
virtual void onRetrieveNewFrame (base::samples::frame::Frame &frame)
 
virtual bool getFrame ()
 
virtual void processImage ()
 
virtual bool setExposure (int exposure)
 
virtual bool setExposure_mode (std::string const &value)
 
virtual bool setTarget_gray_value (boost::int32_t value)
 

Protected Attributes

camera::CamInterface * cam_interface
 
RTT::extras::ReadOnlyPointer< base::samples::frame::Frame > camera_frame
 
RTT::extras::ReadOnlyPointer< base::samples::frame::Frame > output_frame
 
bool process_image
 
frame_helper::FrameHelper frame_helper
 
unsigned int invalid_frames_count
 
unsigned int valid_frames_count
 
float stat_frame_rate
 
float stat_invalid_frame_rate
 
float stat_valid_frame_rate
 
base::Time time_save
 

Friends

class TaskBase
 

Constructor & Destructor Documentation

◆ Task() [1/2]

Task::Task ( std::string const &  name = "camera::Task")

◆ Task() [2/2]

Task::Task ( std::string const &  name,
RTT::ExecutionEngine *  engine 
)

◆ ~Task()

Task::~Task ( )

Member Function Documentation

◆ cleanupHook()

void Task::cleanupHook ( )

This hook is called by Orocos when the state machine transitions from Stopped to PreOperational, requiring the call to configureHook() before calling start() again.

◆ configureCamera()

bool Task::configureCamera ( )
virtual

◆ configureHook()

bool Task::configureHook ( )

This hook is called by Orocos when the state machine transitions from PreOperational to Stopped. If it returns false, then the component will stay in PreOperational. Otherwise, it goes into Stopped.

It is meaningful only if the #needs_configuration has been specified in the task context definition with (for example):

task_context "TaskName" do needs_configuration ... end

◆ getDoubleAttrib()

double Task::getDoubleAttrib ( ::camera::double_attrib::CamAttrib const &  type)
protectedvirtual

◆ getDoubleRangeMax()

double Task::getDoubleRangeMax ( ::camera::double_attrib::CamAttrib const &  type)
protectedvirtual

◆ getDoubleRangeMin()

double Task::getDoubleRangeMin ( ::camera::double_attrib::CamAttrib const &  type)
protectedvirtual

◆ getFrame()

bool Task::getFrame ( )
protectedvirtual

Reads the frame into camera_frame.

Returns
true if successful.

◆ getIntAttrib()

int Task::getIntAttrib ( ::camera::int_attrib::CamAttrib const &  type)
protectedvirtual

◆ getIntRangeMax()

boost::int32_t Task::getIntRangeMax ( ::camera::int_attrib::CamAttrib const &  type)
protectedvirtual

◆ getIntRangeMin()

boost::int32_t Task::getIntRangeMin ( ::camera::int_attrib::CamAttrib const &  type)
protectedvirtual

◆ getStringAttrib()

std::string Task::getStringAttrib ( ::camera::str_attrib::CamAttrib const &  type)
protected

◆ isEnumAttribSet()

bool Task::isEnumAttribSet ( ::camera::enum_attrib::CamAttrib const &  type)
protectedvirtual

◆ onRetrieveNewFrame()

void Task::onRetrieveNewFrame ( base::samples::frame::Frame &  frame)
protectedvirtual

◆ processImage()

void Task::processImage ( )
protectedvirtual

Processes a frame an puts it into output_frame.

◆ setDoubleAttrib()

bool Task::setDoubleAttrib ( ::camera::double_attrib::CamAttrib const &  type,
double  value 
)
protectedvirtual

◆ setEnumAttrib()

bool Task::setEnumAttrib ( ::camera::enum_attrib::CamAttrib const &  type)
protectedvirtual

◆ setExposure()

bool Task::setExposure ( int  exposure)
protectedvirtual

◆ setExposure_mode()

bool Task::setExposure_mode ( std::string const &  value)
protectedvirtual

◆ setExtraAttributes()

void Task::setExtraAttributes ( base::samples::frame::Frame *  frame_ptr)
virtual

◆ setIntAttrib()

bool Task::setIntAttrib ( ::camera::int_attrib::CamAttrib const &  type,
boost::int32_t  value 
)
protectedvirtual

◆ setStringAttrib()

bool Task::setStringAttrib ( ::camera::str_attrib::CamAttrib const &  type,
::std::string const &  value 
)
protectedvirtual

◆ setTarget_gray_value()

bool Task::setTarget_gray_value ( boost::int32_t  value)
protectedvirtual

◆ startHook()

bool Task::startHook ( )

This hook is called by Orocos when the state machine transitions from Stopped to Running. If it returns false, then the component will stay in Stopped. Otherwise, it goes into Running and updateHook() will be called.

◆ stopHook()

void Task::stopHook ( )

This hook is called by Orocos when the component is in the RunTimeError state, at each activity step. See the discussion in updateHook() about triggering options.

Call recovered() to go back in the Runtime state. This hook is called by Orocos when the state machine transitions from Running to Stopped after stop() has been called.

◆ updateHook()

void Task::updateHook ( )

This hook is called by Orocos when the component is in the Running state, at each activity step. Here, the activity gives the "ticks" when the hook should be called.

The error(), exception() and fatal() calls, when called in this hook, allow to get into the associated RunTimeError, Exception and FatalError states.

In the first case, updateHook() is still called, and recover() allows you to go back into the Running state. In the second case, the errorHook() will be called instead of updateHook(). In Exception, the component is stopped and recover() needs to be called before starting it again. Finally, FatalError cannot be recovered.

Friends And Related Function Documentation

◆ TaskBase

friend class TaskBase
friend

Member Data Documentation

◆ cam_interface

camera::CamInterface* camera_base::Task::cam_interface
protected

◆ camera_frame

RTT::extras::ReadOnlyPointer<base::samples::frame::Frame> camera_base::Task::camera_frame
protected

◆ frame_helper

frame_helper::FrameHelper camera_base::Task::frame_helper
protected

◆ invalid_frames_count

unsigned int camera_base::Task::invalid_frames_count
protected

◆ output_frame

RTT::extras::ReadOnlyPointer<base::samples::frame::Frame> camera_base::Task::output_frame
protected

◆ process_image

bool camera_base::Task::process_image
protected

◆ stat_frame_rate

float camera_base::Task::stat_frame_rate
protected

◆ stat_invalid_frame_rate

float camera_base::Task::stat_invalid_frame_rate
protected

◆ stat_valid_frame_rate

float camera_base::Task::stat_valid_frame_rate
protected

◆ time_save

base::Time camera_base::Task::time_save
protected

◆ valid_frames_count

unsigned int camera_base::Task::valid_frames_count
protected

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