Enpose API — C++
Enpose 6-DoF tracking API
Loading...
Searching...
No Matches
enpose::PoseStream Class Reference

RAII handle to a live pose stream from one device. More...

#include <enpose_api.hpp>

Public Member Functions

 PoseStream (const std::string &ip, bool create_thread=true)
 Connect to the device at ip (an IPv4 string; the Enpose API is IPv4-only).
 
 PoseStream (const DeviceInfo &device, bool create_thread=true)
 Connect to a discovered device.
 
 ~PoseStream ()
 
 PoseStream (const PoseStream &)=delete
 
PoseStreamoperator= (const PoseStream &)=delete
 
 PoseStream (PoseStream &&other) noexcept
 
PoseStreamoperator= (PoseStream &&other) noexcept
 
std::vector< MarkerPosereceive (bool block=false)
 Return poses received from the stream.
 

Detailed Description

RAII handle to a live pose stream from one device.

Move-only; the connection is closed automatically on destruction.

Constructor & Destructor Documentation

◆ PoseStream() [1/4]

enpose::PoseStream::PoseStream ( const std::string &  ip,
bool  create_thread = true 
)
inlineexplicit

Connect to the device at ip (an IPv4 string; the Enpose API is IPv4-only).

When create_thread is true (the default and preferred mode), a background thread receives and buffers poses. Throws Error on failure.

◆ PoseStream() [2/4]

enpose::PoseStream::PoseStream ( const DeviceInfo device,
bool  create_thread = true 
)
inlineexplicit

Connect to a discovered device.

◆ ~PoseStream()

enpose::PoseStream::~PoseStream ( )
inline

◆ PoseStream() [3/4]

enpose::PoseStream::PoseStream ( const PoseStream )
delete

◆ PoseStream() [4/4]

enpose::PoseStream::PoseStream ( PoseStream &&  other)
inlinenoexcept

Member Function Documentation

◆ operator=() [1/2]

PoseStream & enpose::PoseStream::operator= ( const PoseStream )
delete

◆ operator=() [2/2]

PoseStream & enpose::PoseStream::operator= ( PoseStream &&  other)
inlinenoexcept

◆ receive()

std::vector< MarkerPose > enpose::PoseStream::receive ( bool  block = false)
inline

Return poses received from the stream.

When block is false (the default), returns the poses that have arrived since the previous call (empty if none) without waiting. When block is true, waits for at least one pose update, up to a 3-second timeout — so the result is still empty if none arrives in that window. Throws Error on an unrecoverable communication failure.


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