NDEVR
API Documentation
RealSenseClient

Client that receives point cloud data from a remote RealSense server. More...

Collaboration diagram for RealSenseClient:
[legend]

Public Member Functions

Matrix< fltp08cameraMatrix (UUID id, Time time, const Matrix< fltp08 > &fallback)
 Returns the camera matrix for a scanner at a given time.
bool collectData ()
 Collects and processes one frame of data from the server.
const Dictionary< UUID, RealSenseScanner * > & connectedScanners () const
 Returns the dictionary of connected scanners.
Buffer< QPointer< Connection > > connections ()
 Returns all active connections.
void init ()
 Initializes the client.
void initConnections ()
 Initializes the UDP connections for data transfer.
bool openPorts ()
 Opens the UDP ports for communication.
void processCommandReturn (const String &s)
 Processes a command return string from the server.
void sendConnectIfNeeded ()
 Sends a connection request to the server if not already connected.
void sendMessage (const StringView &message)
 Sends a command message to the server.
void sendPing ()
 Sends a ping to the server for latency measurement.
void setLookup (const StringView &server, DesignObjectLookup *lookup)
 Sets the server address and design object lookup.
void setOverrideMatrix (const UUID &id, const Matrix< fltp08 > &mat, Time matrix_time)
 Sets an override transformation matrix for a scanner.
void startClient ()
 Starts the client background thread.

Static Public Member Functions

static RealSenseClient * Default ()
 Returns the singleton RealSenseClient instance.

Protected Attributes

Dictionary< UUID, RealSenseScanner * > m_connected_scanners
 Connected scanner instances.
Time m_last_connection_attempt = Time(0)
 Time of last connection attempt.
DesignObjectLookupm_lookup = nullptr
 The design object lookup.
Dictionary< UUID, OverrideMatrixBuffer > m_override_matrices
 Override matrices per scanner.
RasterPacketInfo m_packet_info
 Current packet being assembled.
TimeSpan m_ping_offset = Constant<TimeSpan>::Invalid
 Measured ping latency offset.
Time m_ping_send = Constant<Time>::Invalid
 Time when last ping was sent.
String m_rx_buffer
 Receive data buffer.
uint04 m_rx_buffer_offset = 0
 Current offset in the receive buffer.
Connectionm_rx_connection = nullptr
 The receive UDP connection.
String m_server_connection
 The server address string.
WorkerThread * m_thread
 Background data collection thread.
Connectionm_tx_connection = nullptr
 The transmit UDP connection.

Detailed Description

Client that receives point cloud data from a remote RealSense server.

Connects to a RealSense server via UDP, receives compressed point and color data, and creates local RealSenseScanner instances for each connected device.

Definition at line 30 of file RealSenseClient.h.

Member Function Documentation

◆ cameraMatrix()

Matrix< fltp08 > RealSenseClient::cameraMatrix ( UUID id,
Time time,
const Matrix< fltp08 > & fallback )

Returns the camera matrix for a scanner at a given time.

Parameters
[in]idThe scanner UUID.
[in]timeThe time to query.
[in]fallbackThe fallback matrix if no override exists.
Returns
The camera transformation matrix.

◆ collectData()

bool RealSenseClient::collectData ( )

Collects and processes one frame of data from the server.

Returns
True if data was collected.

◆ connectedScanners()

const Dictionary< UUID, RealSenseScanner * > & RealSenseClient::connectedScanners ( ) const

Returns the dictionary of connected scanners.

Returns
A reference to the scanner dictionary.

◆ connections()

Buffer< QPointer< Connection > > RealSenseClient::connections ( )

Returns all active connections.

Returns
A buffer of connection pointers.

◆ Default()

RealSenseClient * RealSenseClient::Default ( )
static

Returns the singleton RealSenseClient instance.

Returns
A pointer to the default client.

◆ openPorts()

bool RealSenseClient::openPorts ( )

Opens the UDP ports for communication.

Returns
True if the ports were opened successfully.

◆ processCommandReturn()

void RealSenseClient::processCommandReturn ( const String & s)

Processes a command return string from the server.

Parameters
[in]sThe command response string.

◆ sendMessage()

void RealSenseClient::sendMessage ( const StringView & message)

Sends a command message to the server.

Parameters
[in]messageThe command string to send.

◆ setLookup()

void RealSenseClient::setLookup ( const StringView & server,
DesignObjectLookup * lookup )

Sets the server address and design object lookup.

Parameters
[in]serverThe server address string.
[in]lookupThe design object lookup for scanner models.

◆ setOverrideMatrix()

void RealSenseClient::setOverrideMatrix ( const UUID & id,
const Matrix< fltp08 > & mat,
Time matrix_time )

Sets an override transformation matrix for a scanner.

Parameters
[in]idThe scanner UUID.
[in]matThe override matrix.
[in]matrix_timeThe time the matrix applies to.

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