WPILibC++
unspecified
|
Singleton class for creating and keeping camera servers. More...
#include <CameraServer.h>
Public Member Functions | |
void | StartAutomaticCapture (const cs::VideoSource &camera) |
Start automatically capturing images to send to the dashboard from an existing camera. More... | |
cs::AxisCamera | AddAxisCamera (llvm::StringRef host) |
Adds an Axis IP camera. More... | |
cs::AxisCamera | AddAxisCamera (const char *host) |
Adds an Axis IP camera. More... | |
cs::AxisCamera | AddAxisCamera (const std::string &host) |
Adds an Axis IP camera. More... | |
cs::AxisCamera | AddAxisCamera (llvm::ArrayRef< std::string > hosts) |
Adds an Axis IP camera. More... | |
template<typename T > | |
cs::AxisCamera | AddAxisCamera (std::initializer_list< T > hosts) |
Adds an Axis IP camera. More... | |
cs::AxisCamera | AddAxisCamera (llvm::StringRef name, llvm::StringRef host) |
Adds an Axis IP camera. More... | |
cs::AxisCamera | AddAxisCamera (llvm::StringRef name, const char *host) |
Adds an Axis IP camera. More... | |
cs::AxisCamera | AddAxisCamera (llvm::StringRef name, const std::string &host) |
Adds an Axis IP camera. More... | |
cs::AxisCamera | AddAxisCamera (llvm::StringRef name, llvm::ArrayRef< std::string > hosts) |
Adds an Axis IP camera. More... | |
template<typename T > | |
cs::AxisCamera | AddAxisCamera (llvm::StringRef name, std::initializer_list< T > hosts) |
Adds an Axis IP camera. More... | |
cs::CvSink | GetVideo () |
Get OpenCV access to the primary camera feed. More... | |
cs::CvSink | GetVideo (const cs::VideoSource &camera) |
Get OpenCV access to the specified camera. More... | |
cs::CvSink | GetVideo (llvm::StringRef name) |
Get OpenCV access to the specified camera. More... | |
cs::CvSource | PutVideo (llvm::StringRef name, int width, int height) |
Create a MJPEG stream with OpenCV input. More... | |
cs::MjpegServer | AddServer (llvm::StringRef name) |
Adds a MJPEG server at the next available port. More... | |
cs::MjpegServer | AddServer (llvm::StringRef name, int port) |
Adds a MJPEG server. More... | |
void | AddServer (const cs::VideoSink &server) |
Adds an already created server. More... | |
void | RemoveServer (llvm::StringRef name) |
Removes a server by name. More... | |
cs::VideoSink | GetServer () |
Get server for the primary camera feed. More... | |
cs::VideoSink | GetServer (llvm::StringRef name) |
Gets a server by name. More... | |
void | AddCamera (const cs::VideoSource &camera) |
Adds an already created camera. More... | |
void | RemoveCamera (llvm::StringRef name) |
Removes a camera by name. More... | |
void | SetSize (int size) |
Sets the size of the image to use. 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 (const llvm::Twine &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, const llvm::Twine &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, const llvm::Twine &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, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const |
Set the current error information associated with this sensor. More... | |
virtual void | SetWPIError (const llvm::Twine &errorMessage, Error::Code code, const llvm::Twine &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... | |
Static Public Member Functions | |
static CameraServer * | GetInstance () |
Get the CameraServer instance. | |
![]() | |
static void | SetGlobalError (Error::Code code, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) |
static void | SetGlobalWPIError (const llvm::Twine &errorMessage, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) |
static Error & | GetGlobalError () |
Retrieve the current global error. | |
Static Public Attributes | |
static constexpr uint16_t | kBasePort = 1181 |
static constexpr int | kSize640x480 = 0 |
static constexpr int | kSize320x240 = 1 |
static constexpr int | kSize160x120 = 2 |
Additional Inherited Members | |
![]() | |
Error | m_error |
![]() | |
static wpi::mutex | _globalErrorMutex |
static Error | _globalError |
Singleton class for creating and keeping camera servers.
Also publishes camera information to NetworkTables.
cs::AxisCamera CameraServer::AddAxisCamera | ( | llvm::StringRef | host | ) |
Adds an Axis IP camera.
This overload calls AddAxisCamera() with name "Axis Camera".
host | Camera host IP or DNS name (e.g. "10.x.y.11") |
cs::AxisCamera CameraServer::AddAxisCamera | ( | const char * | host | ) |
Adds an Axis IP camera.
This overload calls AddAxisCamera() with name "Axis Camera".
host | Camera host IP or DNS name (e.g. "10.x.y.11") |
cs::AxisCamera CameraServer::AddAxisCamera | ( | const std::string & | host | ) |
Adds an Axis IP camera.
This overload calls AddAxisCamera() with name "Axis Camera".
host | Camera host IP or DNS name (e.g. "10.x.y.11") |
cs::AxisCamera CameraServer::AddAxisCamera | ( | llvm::ArrayRef< std::string > | hosts | ) |
Adds an Axis IP camera.
This overload calls AddAxisCamera() with name "Axis Camera".
hosts | Array of Camera host IPs/DNS names |
|
inline |
Adds an Axis IP camera.
This overload calls AddAxisCamera() with name "Axis Camera".
hosts | Array of Camera host IPs/DNS names |
cs::AxisCamera CameraServer::AddAxisCamera | ( | llvm::StringRef | name, |
llvm::StringRef | host | ||
) |
Adds an Axis IP camera.
name | The name to give the camera |
host | Camera host IP or DNS name (e.g. "10.x.y.11") |
cs::AxisCamera CameraServer::AddAxisCamera | ( | llvm::StringRef | name, |
const char * | host | ||
) |
Adds an Axis IP camera.
name | The name to give the camera |
host | Camera host IP or DNS name (e.g. "10.x.y.11") |
cs::AxisCamera CameraServer::AddAxisCamera | ( | llvm::StringRef | name, |
const std::string & | host | ||
) |
Adds an Axis IP camera.
name | The name to give the camera |
host | Camera host IP or DNS name (e.g. "10.x.y.11") |
cs::AxisCamera CameraServer::AddAxisCamera | ( | llvm::StringRef | name, |
llvm::ArrayRef< std::string > | hosts | ||
) |
Adds an Axis IP camera.
name | The name to give the camera |
hosts | Array of Camera host IPs/DNS names |
|
inline |
Adds an Axis IP camera.
name | The name to give the camera |
hosts | Array of Camera host IPs/DNS names |
void CameraServer::AddCamera | ( | const cs::VideoSource & | camera | ) |
Adds an already created camera.
camera | Camera |
cs::MjpegServer CameraServer::AddServer | ( | llvm::StringRef | name | ) |
Adds a MJPEG server at the next available port.
name | Server name |
cs::MjpegServer CameraServer::AddServer | ( | llvm::StringRef | name, |
int | port | ||
) |
Adds a MJPEG server.
name | Server name |
void CameraServer::AddServer | ( | const cs::VideoSink & | server | ) |
Adds an already created server.
server | Server |
cs::VideoSink CameraServer::GetServer | ( | ) |
Get server for the primary camera feed.
This is only valid to call after a camera feed has been added with StartAutomaticCapture() or AddServer().
cs::VideoSink CameraServer::GetServer | ( | llvm::StringRef | name | ) |
Gets a server by name.
name | Server name |
cs::CvSink CameraServer::GetVideo | ( | ) |
Get OpenCV access to the primary camera feed.
This allows you to get images from the camera for image processing on the roboRIO.
This is only valid to call after a camera feed has been added with startAutomaticCapture() or addServer().
cs::CvSink CameraServer::GetVideo | ( | const cs::VideoSource & | camera | ) |
Get OpenCV access to the specified camera.
This allows you to get images from the camera for image processing on the roboRIO.
camera | Camera (e.g. as returned by startAutomaticCapture). |
cs::CvSink CameraServer::GetVideo | ( | llvm::StringRef | name | ) |
Get OpenCV access to the specified camera.
This allows you to get images from the camera for image processing on the roboRIO.
name | Camera name |
cs::CvSource CameraServer::PutVideo | ( | llvm::StringRef | name, |
int | width, | ||
int | height | ||
) |
Create a MJPEG stream with OpenCV input.
This can be called to pass custom annotated images to the dashboard.
name | Name to give the stream |
width | Width of the image being sent |
height | Height of the image being sent |
void CameraServer::RemoveCamera | ( | llvm::StringRef | name | ) |
Removes a camera by name.
name | Camera name |
void CameraServer::RemoveServer | ( | llvm::StringRef | name | ) |
Removes a server by name.
name | Server name |
void CameraServer::SetSize | ( | int | size | ) |
Sets the size of the image to use.
Use the public kSize constants to set the correct mode, or set it directly on a camera and call the appropriate StartAutomaticCapture method.
size | The size to use |
void CameraServer::StartAutomaticCapture | ( | const cs::VideoSource & | camera | ) |
Start automatically capturing images to send to the dashboard from an existing camera.
camera | Camera |