Class for interacting with a Voyant Photonics, Inc. sensor to receive data streams.
More...
#include <voyant_client.hpp>
|
| VoyantClient (const std::string &bindAddr, const std::string &groupAddr, const std::string &interfaceAddr, bool filterPoints=false) |
| Creates a multicast VoyantClient for receiving data sent to a multicast group.
|
|
| VoyantClient (const std::string &addr, bool filterPoints=false) |
| Creates a unicast VoyantClient for receiving data sent directly to this machine.
|
|
| ~VoyantClient () |
| Destructor - releases resources.
|
|
bool | tryReceiveNextFrame () |
| Attempts to receive the next available frame from the data stream.
|
|
VoyantFrameWrapper & | latestFrame () |
| Gets the latest frame whether or not there's new data.
|
|
const VoyantFrameWrapper & | latestFrame () const |
| Gets the latest frame whether or not there's new data (const version)
|
|
bool | isValid () const |
| Checks if the client was initialized properly.
|
|
Class for interacting with a Voyant Photonics, Inc. sensor to receive data streams.
◆ VoyantClient() [1/2]
VoyantClient::VoyantClient |
( |
const std::string & |
bindAddr, |
|
|
const std::string & |
groupAddr, |
|
|
const std::string & |
interfaceAddr, |
|
|
bool |
filterPoints = false |
|
) |
| |
Creates a multicast VoyantClient for receiving data sent to a multicast group.
- Parameters
-
bindAddr | Local socket address to receive data on (e.g., "0.0.0.0:4444") Use "0.0.0.0" to listen on all network interfaces (recommended) The port number must match the sender's multicast port |
groupAddr | Multicast group address to join (e.g., "224.0.0.0") Must be a valid multicast address in range 224.0.0.0 - 239.255.255.255 This must match the sender's multicast group address All clients joined to this group will receive the same data |
interfaceAddr | IP address of the network interface to use for receiving multicast data For local testing: use "127.0.0.1" (loopback interface) For external devices: use the IP of your interface on the network connected to the device (e.g., "192.168.20.100") |
filterPoints | Whether to filter out invalid points during processing. When true, invalid points will be removed from frames. When false, all points including invalid ones will be included. |
◆ VoyantClient() [2/2]
VoyantClient::VoyantClient |
( |
const std::string & |
addr, |
|
|
bool |
filterPoints = false |
|
) |
| |
|
explicit |
Creates a unicast VoyantClient for receiving data sent directly to this machine.
- Parameters
-
addr | Local socket address to listen on (e.g., "0.0.0.0:4444") Use "0.0.0.0" to listen on all network interfaces Use a specific IP (e.g., "192.168.1.100:4444") to listen on just one interface The port specified must match the sender's destination port |
filterPoints | Whether to filter out invalid points during processing. When true, invalid points will be removed from frames. When false, all points including invalid ones will be included. |
◆ ~VoyantClient()
VoyantClient::~VoyantClient |
( |
| ) |
|
Destructor - releases resources.
◆ isTerminated()
static bool VoyantClient::isTerminated |
( |
| ) |
|
|
static |
Checks if a termination signal has been received.
- Returns
- true if a signal has been received
◆ isValid()
bool VoyantClient::isValid |
( |
| ) |
const |
Checks if the client was initialized properly.
- Returns
- true if client has been properly initialized
◆ latestFrame() [1/2]
Gets the latest frame whether or not there's new data.
- Returns
- Mutable reference to the internal frame
◆ latestFrame() [2/2]
Gets the latest frame whether or not there's new data (const version)
- Returns
- Const reference to the internal frame
◆ resetTerminationFlag()
static void VoyantClient::resetTerminationFlag |
( |
| ) |
|
|
static |
Resets the termination flag.
◆ setupSignalHandling()
static void VoyantClient::setupSignalHandling |
( |
int |
signal = SIGINT | ) |
|
|
static |
Sets up signal handling for graceful termination.
- Parameters
-
signal | Signal to handle (default: SIGINT) |
◆ tryReceiveNextFrame()
bool VoyantClient::tryReceiveNextFrame |
( |
| ) |
|
Attempts to receive the next available frame from the data stream.
- Returns
- true if a new frame was received and processed, false otherwise
- Note
- When successful, the internal frame is updated and can be accessed via latestFrame()
The documentation for this class was generated from the following file: