![]() |
IRSOL
C++ code implementing socket server for interacting with Baumer camera.
|
Example client that repeatedly sends gi
(get image) commands to the camera server.
More...
#include "irsol/args.hpp"
#include "irsol/irsol.hpp"
#include <atomic>
#include <csignal>
#include <opencv2/opencv.hpp>
#include <optional>
Go to the source code of this file.
Functions | |
void | signalHandler (int signal) |
std::optional< std::pair< size_t, cv::Mat > > | queryImage (irsol::types::connector_t &conn) |
std::optional< irsol::types::connector_t > | createConnectionWithRetry (const std::string &host, irsol::types::port_t port, std::chrono::seconds retryTimeout=std::chrono::seconds(1)) |
void | run (double inFps) |
int | main (int argc, char **argv) |
Variables | |
std::atomic< bool > | g_terminate {false} |
Example client that repeatedly sends gi
(get image) commands to the camera server.
This executable connects to the camera server and requests single image frames using the gi
command. Each received image is displayed using OpenCV, and the measured FPS is annotated on the image.
Command-line options: -f, –fps <fps> Set the polling frequency (default: 0.5 FPS)
Usage: ./06-client-server-interaction-image-commands-viewer-gi [-f <fps>]
The client can be interrupted with Ctrl+C or by pressing 'q' in the OpenCV window. All logging is written to logs/viewer-client-gi.log.
Definition in file viewer_client_gi.cpp.
std::optional< irsol::types::connector_t > createConnectionWithRetry | ( | const std::string & | host, |
irsol::types::port_t | port, | ||
std::chrono::seconds | retryTimeout = std::chrono::seconds(1) |
||
) |
Definition at line 142 of file viewer_client_gi.cpp.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 284 of file viewer_client_gi.cpp.
std::optional< std::pair< size_t, cv::Mat > > queryImage | ( | irsol::types::connector_t & | conn | ) |
Definition at line 41 of file viewer_client_gi.cpp.
void run | ( | double | inFps | ) |
Definition at line 167 of file viewer_client_gi.cpp.
void signalHandler | ( | int | signal | ) |
Definition at line 32 of file viewer_client_gi.cpp.
std::atomic<bool> g_terminate {false} |
Definition at line 28 of file viewer_client_gi.cpp.