WPILibC++
unspecified
|
A vision runner is a convenient wrapper object to make it easy to run vision pipelines from robot code. More...
#include <VisionRunner.h>
Public Member Functions | |
VisionRunner (cs::VideoSource videoSource, T *pipeline, std::function< void(T &)> listener) | |
Creates a new vision runner. More... | |
![]() | |
VisionRunnerBase (cs::VideoSource videoSource) | |
Creates a new vision runner. More... | |
VisionRunnerBase (const VisionRunnerBase &)=delete | |
VisionRunnerBase & | operator= (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... | |
![]() | |
ErrorBase (const ErrorBase &)=delete | |
ErrorBase & | operator= (const ErrorBase &)=delete |
virtual Error & | GetError () |
Retrieve the current error. More... | |
virtual const Error & | GetError () 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 | |
void | DoProcess (cv::Mat &image) override |
Additional Inherited Members | |
![]() | |
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 Error & | GetGlobalError () |
Retrieve the current global error. | |
![]() | |
Error | m_error |
![]() | |
static priority_mutex | _globalErrorMutex |
static Error | _globalError |
A vision runner is a convenient wrapper object to make it easy to run vision pipelines from robot code.
The easiest way to use this is to run it in a std::thread and use the listener to take snapshots of the pipeline's outputs.
frc::VisionRunner< T >::VisionRunner | ( | cs::VideoSource | videoSource, |
T * | pipeline, | ||
std::function< void(T &)> | listener | ||
) |
Creates a new vision runner.
It will take images from the
, send them to the
, and call the
when the pipeline has finished to alert user code when it is safe to access the pipeline's outputs.
videoSource | the video source to use to supply images for the pipeline |
pipeline | the vision pipeline to run |
listener | a function to call after the pipeline has finished running |