VisionServer  v2.1.1-1-g21dc5465
FRC vision library
vs2::VisionServer Class Referencefinal

#include <visionserver2.h>

+ Collaboration diagram for vs2::VisionServer:

Classes

class  BasePipe
 
struct  OutputStream
 

Static Public Member Functions

static const std::shared_ptr< nt::NetworkTable > & ntable ()
 
static VisionServergetInstance ()
 
static void Init ()
 
static bool addCamera (VisionCamera &&)
 
static bool addCameras (std::vector< VisionCamera > &&)
 
static bool setCameras (std::vector< VisionCamera > &&)
 
static std::vector< VisionCamera > & getCameras ()
 
static size_t numCameras ()
 
template<class pipeline >
static bool addPipeline ()
 
static bool addPipeline (BasePipe *)
 
template<class... pipelines>
static bool addPipelines ()
 
static bool addPipelines (std::vector< BasePipe * > &&)
 
static bool addPipelines (std::initializer_list< BasePipe * >)
 
template<class... pipelines>
static bool setPipelines ()
 
static bool setPipelines (std::vector< BasePipe * > &&)
 
static bool setPipelines (std::initializer_list< BasePipe * >)
 
static const std::vector< BasePipe * > & getPipelines ()
 
static size_t numPipelines ()
 
static bool addStream ()
 
static bool addStream (std::string_view)
 
static bool addStream (std::string_view, int port)
 
static bool addStream (const cs::MjpegServer &)
 
static bool addStream (cs::MjpegServer &&)
 
static bool addStreams (size_t=2)
 
static bool addStreams (std::initializer_list< std::string_view >)
 
static bool addStreams (std::initializer_list< std::pair< std::string_view, int > >)
 
static bool addStreams (const std::vector< cs::MjpegServer > &)
 
static const std::vector< OutputStream > & getStreams ()
 
static size_t numStreams ()
 
static bool compensate ()
 
static bool runRaw ()
 
static bool runRawThread ()
 
static bool run (float fps_cap=30.f)
 
static bool runSingle (float fps_cap=30.f)
 
static bool runThread (float fps_cap=30.f)
 
static bool runSingleThread (float fps_cap=30.f)
 
static bool isRunning ()
 
static bool stop ()
 
static void stopExit ()
 
template<class pipeline = void, class... pipelines>
static size_t pipeExpander (std::vector< std::unique_ptr< BasePipe > > &)
 

Static Protected Member Functions

static VisionServerinst ()
 
static void pipelineRunner (BasePipe *, float fps_cap)
 

Private Member Functions

 VisionServer ()
 
 ~VisionServer ()
 
 VisionServer (const VisionServer &)=delete
 
 VisionServer (VisionServer &&)=delete
 
void operator= (const VisionServer &)=delete
 
void operator= (VisionServer &&)=delete
 

Private Attributes

std::vector< VisionCameracameras
 
std::vector< BasePipe * > pipelines
 
std::vector< std::unique_ptr< BasePipe > > heap_allocated
 
std::vector< OutputStreamstreams
 
std::thread head
 
std::atomic< bool > is_running {false}
 

Detailed Description

Definition at line 19 of file visionserver2.h.

Constructor & Destructor Documentation

◆ VisionServer() [1/3]

VisionServer::VisionServer ( )
private

Definition at line 8 of file visionserver2.cpp.

◆ ~VisionServer()

VisionServer::~VisionServer ( )
private

Definition at line 14 of file visionserver2.cpp.

◆ VisionServer() [2/3]

vs2::VisionServer::VisionServer ( const VisionServer )
privatedelete

◆ VisionServer() [3/3]

vs2::VisionServer::VisionServer ( VisionServer &&  )
privatedelete

Member Function Documentation

◆ ntable()

static const std::shared_ptr< nt::NetworkTable > & vs2::VisionServer::ntable ( )
inlinestatic

Definition at line 22 of file visionserver2.h.

◆ getInstance()

static VisionServer & vs2::VisionServer::getInstance ( )
inlinestatic

Definition at line 27 of file visionserver2.h.

◆ Init()

static void vs2::VisionServer::Init ( )
inlinestatic

Definition at line 31 of file visionserver2.h.

◆ addCamera()

bool VisionServer::addCamera ( VisionCamera &&  c)
static

Definition at line 44 of file visionserver2.cpp.

◆ addCameras()

bool VisionServer::addCameras ( std::vector< VisionCamera > &&  cms)
static

Definition at line 55 of file visionserver2.cpp.

◆ setCameras()

bool VisionServer::setCameras ( std::vector< VisionCamera > &&  cms)
static

Definition at line 75 of file visionserver2.cpp.

◆ getCameras()

std::vector< VisionCamera > & vs2::VisionServer::getCameras ( )
inlinestatic

Definition at line 264 of file visionserver2.h.

◆ numCameras()

size_t vs2::VisionServer::numCameras ( )
inlinestatic

Definition at line 265 of file visionserver2.h.

◆ addPipeline() [1/2]

template<class pipeline >
bool vs2::VisionServer::addPipeline
static

Definition at line 273 of file visionserver2.h.

◆ addPipeline() [2/2]

bool VisionServer::addPipeline ( BasePipe p)
static

Definition at line 90 of file visionserver2.cpp.

◆ addPipelines() [1/3]

template<class... pipelines_t>
bool vs2::VisionServer::addPipelines
static

Definition at line 285 of file visionserver2.h.

◆ addPipelines() [2/3]

bool VisionServer::addPipelines ( std::vector< BasePipe * > &&  ps)
static

Definition at line 99 of file visionserver2.cpp.

◆ addPipelines() [3/3]

bool VisionServer::addPipelines ( std::initializer_list< BasePipe * >  ps)
static

Definition at line 109 of file visionserver2.cpp.

◆ setPipelines() [1/3]

template<class... pipelines_t>
bool vs2::VisionServer::setPipelines
static

Definition at line 299 of file visionserver2.h.

◆ setPipelines() [2/3]

bool VisionServer::setPipelines ( std::vector< BasePipe * > &&  ps)
static

Definition at line 119 of file visionserver2.cpp.

◆ setPipelines() [3/3]

bool VisionServer::setPipelines ( std::initializer_list< BasePipe * >  ps)
static

Definition at line 130 of file visionserver2.cpp.

◆ getPipelines()

const std::vector< VisionServer::BasePipe * > & vs2::VisionServer::getPipelines ( )
inlinestatic

Definition at line 266 of file visionserver2.h.

◆ numPipelines()

size_t vs2::VisionServer::numPipelines ( )
inlinestatic

Definition at line 267 of file visionserver2.h.

◆ addStream() [1/5]

bool VisionServer::addStream ( )
static

Definition at line 142 of file visionserver2.cpp.

◆ addStream() [2/5]

bool VisionServer::addStream ( std::string_view  name)
static

Definition at line 150 of file visionserver2.cpp.

◆ addStream() [3/5]

bool VisionServer::addStream ( std::string_view  name,
int  port 
)
static

Definition at line 157 of file visionserver2.cpp.

◆ addStream() [4/5]

bool VisionServer::addStream ( const cs::MjpegServer &  s)
static

Definition at line 164 of file visionserver2.cpp.

◆ addStream() [5/5]

bool VisionServer::addStream ( cs::MjpegServer &&  s)
static

Definition at line 171 of file visionserver2.cpp.

◆ addStreams() [1/4]

bool VisionServer::addStreams ( size_t  n = 2)
static

Definition at line 178 of file visionserver2.cpp.

◆ addStreams() [2/4]

bool VisionServer::addStreams ( std::initializer_list< std::string_view >  strms)
static

Definition at line 189 of file visionserver2.cpp.

◆ addStreams() [3/4]

bool VisionServer::addStreams ( std::initializer_list< std::pair< std::string_view, int > >  strms)
static

Definition at line 200 of file visionserver2.cpp.

◆ addStreams() [4/4]

bool VisionServer::addStreams ( const std::vector< cs::MjpegServer > &  strms)
static

Definition at line 211 of file visionserver2.cpp.

◆ getStreams()

const std::vector< VisionServer::OutputStream > & vs2::VisionServer::getStreams ( )
inlinestatic

Definition at line 268 of file visionserver2.h.

◆ numStreams()

size_t vs2::VisionServer::numStreams ( )
inlinestatic

Definition at line 269 of file visionserver2.h.

◆ compensate()

bool VisionServer::compensate ( )
static

Definition at line 354 of file visionserver2.cpp.

◆ runRaw()

bool VisionServer::runRaw ( )
static

Definition at line 552 of file visionserver2.cpp.

◆ runRawThread()

bool VisionServer::runRawThread ( )
static

Definition at line 584 of file visionserver2.cpp.

◆ run()

bool VisionServer::run ( float  fps_cap = 30.f)
static

Definition at line 395 of file visionserver2.cpp.

◆ runSingle()

bool VisionServer::runSingle ( float  fps_cap = 30.f)
static

Definition at line 431 of file visionserver2.cpp.

◆ runThread()

bool VisionServer::runThread ( float  fps_cap = 30.f)
static

Definition at line 568 of file visionserver2.cpp.

◆ runSingleThread()

bool VisionServer::runSingleThread ( float  fps_cap = 30.f)
static

Definition at line 576 of file visionserver2.cpp.

◆ isRunning()

bool vs2::VisionServer::isRunning ( )
inlinestatic

Definition at line 270 of file visionserver2.h.

◆ stop()

bool VisionServer::stop ( )
static

Definition at line 592 of file visionserver2.cpp.

◆ stopExit()

static void vs2::VisionServer::stopExit ( )
inlinestatic

Definition at line 129 of file visionserver2.h.

◆ pipeExpander()

template<class pipeline , class... pipelines>
size_t vs2::VisionServer::pipeExpander ( std::vector< std::unique_ptr< BasePipe > > &  pipes)
static

Definition at line 316 of file visionserver2.h.

◆ inst()

static VisionServer & vs2::VisionServer::inst ( )
inlinestaticprotected

Definition at line 136 of file visionserver2.h.

◆ pipelineRunner()

void VisionServer::pipelineRunner ( BasePipe pipe,
float  fps_cap 
)
staticprotected

Definition at line 254 of file visionserver2.cpp.

◆ operator=() [1/2]

void vs2::VisionServer::operator= ( const VisionServer )
privatedelete

◆ operator=() [2/2]

void vs2::VisionServer::operator= ( VisionServer &&  )
privatedelete

Member Data Documentation

◆ cameras

std::vector<VisionCamera> vs2::VisionServer::cameras
private

Definition at line 148 of file visionserver2.h.

◆ pipelines

std::vector<BasePipe*> vs2::VisionServer::pipelines
private

Definition at line 149 of file visionserver2.h.

◆ heap_allocated

std::vector<std::unique_ptr<BasePipe> > vs2::VisionServer::heap_allocated
private

Definition at line 150 of file visionserver2.h.

◆ streams

std::vector<OutputStream> vs2::VisionServer::streams
private

Definition at line 151 of file visionserver2.h.

◆ head

std::thread vs2::VisionServer::head
private

Definition at line 153 of file visionserver2.h.

◆ is_running

std::atomic<bool> vs2::VisionServer::is_running {false}
private

Definition at line 154 of file visionserver2.h.


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