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

#include <Task.hpp>

Inheritance diagram for stereo::Task:

Classes

struct  SparseDebugImpl
 

Public Member Functions

 Task (std::string const &name="stereo::Task")
 
 Task (std::string const &name, RTT::ExecutionEngine *engine)
 
 ~Task ()
 
bool configureHook ()
 The following lines are template definitions for the various state machine. More...
 
bool startHook ()
 
void updateHook ()
 
void stopHook ()
 
void cleanupHook ()
 

Protected Member Functions

void initCalibration (cv::Size imageSize)
 
void denseStereo (const cv::Mat &leftImage, const cv::Mat &rightImage)
 
void sparseStereo (const cv::Mat &leftImage, const cv::Mat &rightImage)
 

Protected Attributes

RTT::extras::ReadOnlyPointer< base::samples::frame::Frame > leftFrame
 
RTT::extras::ReadOnlyPointer< base::samples::frame::Frame > rightFrame
 
DenseStereo * dense_stereo
 Instance of dense stereo processing. More...
 
stereo::StereoFeatures * sparse_stereo
 
base::samples::frame::Frame leftFrameTarget
 
base::samples::frame::Frame rightFrameTarget
 
frame_helper::FrameHelper leftConv
 
frame_helper::FrameHelper rightConv
 
bool leftFrameValid
 
bool rightFrameValid
 
cv::Size imageSize
 
double imageScalingFactor
 
frame_helper::StereoCalibration calibration
 
SparseDebugImplsparseDebug
 

Friends

class TaskBase
 

Constructor & Destructor Documentation

Task::Task ( std::string const &  name = "stereo::Task")
Task::Task ( std::string const &  name,
RTT::ExecutionEngine *  engine 
)
Task::~Task ( )

Member Function Documentation

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.

bool Task::configureHook ( )

The following lines are template definitions for the various state machine.

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

void Task::denseStereo ( const cv::Mat &  leftImage,
const cv::Mat &  rightImage 
)
protected

Convert to point cloud with color

Organize point cloud

write to output

void Task::initCalibration ( cv::Size  imageSize)
protected
void Task::sparseStereo ( const cv::Mat &  leftImage,
const cv::Mat &  rightImage 
)
protected
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.

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.

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.

static int i = 0; cv::imwrite( "/tmp/left_" + boost::lexical_cast<string>(i) + ".png", leftCvFrame ); cv::imwrite( "/tmp/right_" + boost::lexical_cast<string>(i) + ".png", rightCvFrame ); i++;

Friends And Related Function Documentation

friend class TaskBase
friend

Member Data Documentation

frame_helper::StereoCalibration stereo::Task::calibration
protected
DenseStereo* stereo::Task::dense_stereo
protected

Instance of dense stereo processing.

double stereo::Task::imageScalingFactor
protected
cv::Size stereo::Task::imageSize
protected
frame_helper::FrameHelper stereo::Task::leftConv
protected
RTT::extras::ReadOnlyPointer<base::samples::frame::Frame> stereo::Task::leftFrame
protected
base::samples::frame::Frame stereo::Task::leftFrameTarget
protected
bool stereo::Task::leftFrameValid
protected
frame_helper::FrameHelper stereo::Task::rightConv
protected
RTT::extras::ReadOnlyPointer<base::samples::frame::Frame> stereo::Task::rightFrame
protected
base::samples::frame::Frame stereo::Task::rightFrameTarget
protected
bool stereo::Task::rightFrameValid
protected
stereo::StereoFeatures* stereo::Task::sparse_stereo
protected
SparseDebugImpl* stereo::Task::sparseDebug
protected

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