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() [1/2]

Task::Task ( std::string const &  name = "stereo::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.

◆ configureHook()

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

◆ denseStereo()

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

Convert to point cloud with color

Organize point cloud

write to output

◆ initCalibration()

void Task::initCalibration ( cv::Size  imageSize)
protected

◆ sparseStereo()

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

◆ 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.

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

◆ TaskBase

friend class TaskBase
friend

Member Data Documentation

◆ calibration

frame_helper::StereoCalibration stereo::Task::calibration
protected

◆ dense_stereo

DenseStereo* stereo::Task::dense_stereo
protected

Instance of dense stereo processing.

◆ imageScalingFactor

double stereo::Task::imageScalingFactor
protected

◆ imageSize

cv::Size stereo::Task::imageSize
protected

◆ leftConv

frame_helper::FrameHelper stereo::Task::leftConv
protected

◆ leftFrame

RTT::extras::ReadOnlyPointer<base::samples::frame::Frame> stereo::Task::leftFrame
protected

◆ leftFrameTarget

base::samples::frame::Frame stereo::Task::leftFrameTarget
protected

◆ leftFrameValid

bool stereo::Task::leftFrameValid
protected

◆ rightConv

frame_helper::FrameHelper stereo::Task::rightConv
protected

◆ rightFrame

RTT::extras::ReadOnlyPointer<base::samples::frame::Frame> stereo::Task::rightFrame
protected

◆ rightFrameTarget

base::samples::frame::Frame stereo::Task::rightFrameTarget
protected

◆ rightFrameValid

bool stereo::Task::rightFrameValid
protected

◆ sparse_stereo

stereo::StereoFeatures* stereo::Task::sparse_stereo
protected

◆ sparseDebug

SparseDebugImpl* stereo::Task::sparseDebug
protected

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