WPILibC++ 2024.3.2
frc::VisionRunnerBase Class Referenceabstract

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

#include <vision/VisionRunner.h>

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

Public Member Functions

 VisionRunnerBase (cs::VideoSource videoSource)
 Creates a new vision runner. More...
 
 ~VisionRunnerBase ()
 
 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...
 
void Stop ()
 Stop a RunForever() loop. More...
 

Protected Member Functions

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

Detailed Description

Non-template base class for VisionRunner.

Constructor & Destructor Documentation

◆ VisionRunnerBase() [1/2]

frc::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

◆ ~VisionRunnerBase()

frc::VisionRunnerBase::~VisionRunnerBase ( )

◆ VisionRunnerBase() [2/2]

frc::VisionRunnerBase::VisionRunnerBase ( const VisionRunnerBase )
delete

Member Function Documentation

◆ DoProcess()

virtual void frc::VisionRunnerBase::DoProcess ( cv::Mat &  image)
protectedpure virtual

Implemented in frc::VisionRunner< T >.

◆ operator=()

VisionRunnerBase & frc::VisionRunnerBase::operator= ( const VisionRunnerBase )
delete

◆ RunForever()

void frc::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.

◆ RunOnce()

void frc::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.

◆ Stop()

void frc::VisionRunnerBase::Stop ( )

Stop a RunForever() loop.


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