NVIDIA Holoscan SDK v3.5.0

Class PoseTreeUCXClient

class PoseTreeUCXClient

UCX-based client for remote PoseTree synchronization.

This class provides a client that connects to a PoseTreeUCXServer to synchronize PoseTree updates across distributed systems using UCX (Unified Communication X).

Warning

This class is NOT thread-safe for its public methods. All public methods must be called from the same thread.

Public Types

enum class Error

Error codes used by this class.

Values:

enumerator kAlreadyConnected

kAlreadyConnected is returned when trying to connect while already connected

enumerator kInvalidArgument

kInvalidArgument is returned when invalid parameters are provided (e.g., empty host, invalid port)

enumerator kConnectionFailed

kConnectionFailed is returned when connection to the server fails

enumerator kNotConnected

kNotConnected is returned when trying to perform operations that require a connection

enumerator kThreadError

kThreadError is returned when thread operations fail

enumerator kShutdownError

kShutdownError is returned when errors occur during shutdown/disconnect

enumerator kInternalError

kInternalError is returned for unexpected internal errors

template<typename T>
using expected = holoscan::expected<T, Error>

Expected type used by this class.

using unexpected = holoscan::unexpected<Error>

Unexpected type used by this class.

Public Functions

explicit PoseTreeUCXClient(std::shared_ptr<PoseTree> pose_tree, PoseTreeUCXClientConfig config = PoseTreeUCXClientConfig{})
~PoseTreeUCXClient()

Destructor - ensures clean shutdown.

Automatically disconnects if still connected, joins the worker thread, and releases all resources. Any errors during disconnect are logged but do not throw exceptions (no-throw guarantee).

PoseTreeUCXClient(const PoseTreeUCXClient&) = delete
PoseTreeUCXClient &operator=(const PoseTreeUCXClient&) = delete
PoseTreeUCXClient(PoseTreeUCXClient&&) = delete
PoseTreeUCXClient &operator=(PoseTreeUCXClient&&) = delete
expected<void> connect(std::string_view host, uint16_t port, bool request_snapshot)

Connect to a PoseTreeUCXServer.

Starts an internal worker thread that handles UCX communication with the server. The thread runs until disconnect() is called or the destructor runs.

Note

This method blocks until the connection is established or fails

Parameters
  • host – The hostname or IP address of the server

  • port – The port number of the server

  • request_snapshot – Whether to request a full snapshot of the pose tree upon connection

Returns

Success (void) or error status

expected<void> disconnect()

Disconnect from the server.

Signals the worker thread to stop, waits for it to finish (join), and cleans up all UCX resources. This method is automatically called by the destructor if needed.

Note

This method is idempotent - calling it when already disconnected returns success

Note

This method blocks until the worker thread has fully stopped

Returns

Success (void) or error status

inline bool is_running() const

Public Static Functions

static const char *error_to_str(Error error)

Convert an error code to a human readable error string.

Parameters

error – Error code to convert.

Returns

Human-readable error string.

Previous Class PoseTreeManager
Next Class PoseTreeUCXServer
© Copyright 2022-2025, NVIDIA. Last updated on Aug 1, 2025.