WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
frc::VisionRunnerBase Class Referenceabstract

Non-template base class for VisionRunner. More...

#include <VisionRunner.h>

Inheritance diagram for frc::VisionRunnerBase:
frc::ErrorBase frc::VisionRunner< T >

Public Member Functions

 VisionRunnerBase (cs::VideoSource videoSource)
 Creates a new vision runner. More...
 
 VisionRunnerBase (const VisionRunnerBase &)=delete
 
VisionRunnerBaseoperator= (const VisionRunnerBase &)=delete
 
void RunOnce ()
 Runs the pipeline one time, giving it the next image from the video source specified in the constructor. More...
 
void RunForever ()
 A convenience method that calls runOnce() in an infinite loop. More...
 
- Public Member Functions inherited from frc::ErrorBase
 ErrorBase (const ErrorBase &)=delete
 
ErrorBaseoperator= (const ErrorBase &)=delete
 
virtual ErrorGetError ()
 Retrieve the current error. More...
 
virtual const ErrorGetError () const
 
virtual void SetErrnoError (llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set error information associated with a C library call that set an error to the "errno" global variable. More...
 
virtual void SetImaqError (int success, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetErrorRange (Error::Code code, int32_t minRange, int32_t maxRange, int32_t requestedValue, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (llvm::StringRef errorMessage, Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void CloneError (const ErrorBase &rhs) const
 
virtual void ClearError () const
 Clear the current error information associated with this sensor.
 
virtual bool StatusIsFatal () const
 Check if the current error code represents a fatal error. More...
 

Protected Member Functions

virtual void DoProcess (cv::Mat &image)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from frc::ErrorBase
static void SetGlobalError (Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber)
 
static void SetGlobalWPIError (llvm::StringRef errorMessage, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber)
 
static ErrorGetGlobalError ()
 Retrieve the current global error.
 
- Protected Attributes inherited from frc::ErrorBase
Error m_error
 
- Static Protected Attributes inherited from frc::ErrorBase
static priority_mutex _globalErrorMutex
 
static Error _globalError
 

Detailed Description

Non-template base class for VisionRunner.

Constructor & Destructor Documentation

VisionRunnerBase::VisionRunnerBase ( cs::VideoSource  videoSource)
explicit

Creates a new vision runner.

It will take images from the

videoSource

, and call the virtual DoProcess() method.

Parameters
videoSourcethe video source to use to supply images for the pipeline

Member Function Documentation

void VisionRunnerBase::RunForever ( )

A convenience method that calls runOnce() in an infinite loop.

This must be run in a dedicated thread, and cannot be used in the main robot thread because it will freeze the robot program.

Do not call this method directly from the main thread.

void VisionRunnerBase::RunOnce ( )

Runs the pipeline one time, giving it the next image from the video source specified in the constructor.

This will block until the source either has an image or throws an error. If the source successfully supplied a frame, the pipeline's image input will be set, the pipeline will run, and the listener specified in the constructor will be called to notify it that the pipeline ran. This must be run in a dedicated thread, and cannot be used in the main robot thread because it will freeze the robot program.

This method is exposed to allow teams to add additional functionality or have their own ways to run the pipeline. Most teams, however, should just use runForever in its own thread using a std::thread.


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