Orbbec SDK K4A Wrapper
Loading...
Searching...
No Matches
k4a::device Class Reference

#include <k4a/k4a.hpp>

Public Member Functions

 device (k4a_device_t handle=nullptr) noexcept
 
 device (device &&dev) noexcept
 
 device (const device &)=delete
 
deviceoperator= (const device &)=delete
 
deviceoperator= (device &&dev) noexcept
 
 operator bool () const noexcept
 
bool is_valid () const noexcept
 
k4a_device_t handle () const noexcept
 
void close () noexcept
 
bool get_capture (capture *cap, std::chrono::milliseconds timeout)
 
bool get_capture (capture *cap)
 
bool get_imu_sample (k4a_imu_sample_t *imu_sample, std::chrono::milliseconds timeout)
 
bool get_imu_sample (k4a_imu_sample_t *imu_sample)
 
void start_cameras (const k4a_device_configuration_t *configuration)
 
void stop_cameras () noexcept
 
void start_imu ()
 
void stop_imu () noexcept
 
std::string get_serialnum () const
 
void get_color_control (k4a_color_control_command_t command, k4a_color_control_mode_t *mode, int32_t *value) const
 
void set_color_control (k4a_color_control_command_t command, k4a_color_control_mode_t mode, int32_t value)
 
std::vector< uint8_t > get_raw_calibration () const
 
calibration get_calibration (k4a_depth_mode_t depth_mode, k4a_color_resolution_t color_resolution) const
 
bool is_sync_in_connected () const
 
bool is_sync_out_connected () const
 
k4a_hardware_version_t get_version () const
 

Static Public Member Functions

static device open (uint32_t index)
 
static uint32_t get_installed_count () noexcept
 

Detailed Description

Wrapper for k4a_device_t

Wraps a handle for a device.

Definition at line 1104 of file k4a.hpp.

Constructor & Destructor Documentation

◆ device() [1/2]

k4a::device::device ( k4a_device_t  handle = nullptr)
inlinenoexcept

Creates a device from a k4a_device_t Takes ownership of the handle, i.e. you should not call k4a_device_close on the handle after giving it to the device; the device will take care of that.

Definition at line 1112 of file k4a.hpp.

◆ device() [2/2]

k4a::device::device ( device &&  dev)
inlinenoexcept

Moves another device into a new device

Definition at line 1116 of file k4a.hpp.

◆ ~device()

k4a::device::~device ( )
inline

Definition at line 1123 of file k4a.hpp.

Member Function Documentation

◆ close()

void k4a::device::close ( )
inlinenoexcept

Closes a k4a device.

See also
k4a_device_close

Definition at line 1171 of file k4a.hpp.

◆ get_calibration()

calibration k4a::device::get_calibration ( k4a_depth_mode_t  depth_mode,
k4a_color_resolution_t  color_resolution 
) const
inline

Get the camera calibration for the entire K4A device, which is used for all transformation functions. Throws error on failure.

See also
k4a_device_get_calibration

Definition at line 1380 of file k4a.hpp.

◆ get_capture() [1/2]

bool k4a::device::get_capture ( capture cap)
inline

Reads a sensor capture into cap. Returns true if a capture was read, false if the read timed out. Throws error on failure. This API assumes an inifinate timeout.

See also
k4a_device_get_capture

Definition at line 1208 of file k4a.hpp.

◆ get_capture() [2/2]

bool k4a::device::get_capture ( capture cap,
std::chrono::milliseconds  timeout 
)
inline

Reads a sensor capture into cap. Returns true if a capture was read, false if the read timed out. Throws error on failure.

See also
k4a_device_get_capture

Definition at line 1185 of file k4a.hpp.

◆ get_color_control()

void k4a::device::get_color_control ( k4a_color_control_command_t  command,
k4a_color_control_mode_t mode,
int32_t *  value 
) const
inline

Get the K4A color sensor control value Throws error on failure.

See also
k4a_device_get_color_control

Definition at line 1327 of file k4a.hpp.

◆ get_imu_sample() [1/2]

bool k4a::device::get_imu_sample ( k4a_imu_sample_t imu_sample)
inline

Reads an IMU sample. Returns true if a sample was read, false if the read timed out. Throws error on failure. This API assumes an infinate timeout.

See also
k4a_device_get_imu_sample

Definition at line 1239 of file k4a.hpp.

◆ get_imu_sample() [2/2]

bool k4a::device::get_imu_sample ( k4a_imu_sample_t imu_sample,
std::chrono::milliseconds  timeout 
)
inline

Reads an IMU sample. Returns true if a sample was read, false if the read timed out. Throws error on failure.

See also
k4a_device_get_imu_sample

Definition at line 1218 of file k4a.hpp.

◆ get_installed_count()

static uint32_t k4a::device::get_installed_count ( )
inlinestaticnoexcept

Gets the number of connected devices

See also
k4a_device_get_installed_count

Definition at line 1470 of file k4a.hpp.

◆ get_raw_calibration()

std::vector< uint8_t > k4a::device::get_raw_calibration ( ) const
inline

Get the raw calibration blob for the entire K4A device. Throws error on failure.

See also
k4a_device_get_raw_calibration

Definition at line 1355 of file k4a.hpp.

◆ get_serialnum()

std::string k4a::device::get_serialnum ( ) const
inline

Get the K4A device serial number Throws error on failure.

See also
k4a_device_get_serialnum

Definition at line 1295 of file k4a.hpp.

◆ get_version()

k4a_hardware_version_t k4a::device::get_version ( ) const
inline

Get the version numbers of the K4A subsystems' firmware Throws error on failure.

See also
k4a_device_get_version

Definition at line 1437 of file k4a.hpp.

◆ handle()

k4a_device_t k4a::device::handle ( ) const
inlinenoexcept

Returns the underlying k4a_device_t handle

Note the k4a_device_t handle does not have a reference count will be destroyed when the C++ object is destroyed. The caller is responsible for ensuring the C++ object outlives this handle.

Definition at line 1162 of file k4a.hpp.

◆ is_sync_in_connected()

bool k4a::device::is_sync_in_connected ( ) const
inline

Get the device jack status for the synchronization in connector Throws error on failure.

Attention
The Orbbec device does not support retrieving the jack connection status, so this function will always return false (disconnected).
See also
k4a_device_get_sync_jack

Definition at line 1400 of file k4a.hpp.

◆ is_sync_out_connected()

bool k4a::device::is_sync_out_connected ( ) const
inline

Get the device jack status for the synchronization out connector Throws error on failure.

Attention
The Orbbec device does not support retrieving the jack connection status, so this function will always return false (disconnected).
See also
k4a_device_get_sync_jack

Definition at line 1420 of file k4a.hpp.

◆ is_valid()

bool k4a::device::is_valid ( ) const
inlinenoexcept

Returns true if the device is valid, false otherwise

Definition at line 1152 of file k4a.hpp.

◆ open()

static device k4a::device::open ( uint32_t  index)
inlinestatic

Open a k4a device. Throws error on failure.

See also
k4a_device_open

Definition at line 1454 of file k4a.hpp.

◆ operator bool()

k4a::device::operator bool ( ) const
inlineexplicitnoexcept

Returns true if the device is valid, false otherwise

Definition at line 1145 of file k4a.hpp.

◆ operator=()

device & k4a::device::operator= ( device &&  dev)
inlinenoexcept

Moves another device into this device; other is set to invalid

Definition at line 1132 of file k4a.hpp.

◆ set_color_control()

void k4a::device::set_color_control ( k4a_color_control_command_t  command,
k4a_color_control_mode_t  mode,
int32_t  value 
)
inline

Set the K4A color sensor control value Throws error on failure.

See also
k4a_device_set_color_control

Definition at line 1341 of file k4a.hpp.

◆ start_cameras()

void k4a::device::start_cameras ( const k4a_device_configuration_t configuration)
inline

Starts the K4A device's cameras Throws error on failure.

See also
k4a_device_start_cameras

Definition at line 1249 of file k4a.hpp.

◆ start_imu()

void k4a::device::start_imu ( )
inline

Starts the K4A IMU Throws error on failure

See also
k4a_device_start_imu

Definition at line 1272 of file k4a.hpp.

◆ stop_cameras()

void k4a::device::stop_cameras ( )
inlinenoexcept

Stops the K4A device's cameras

See also
k4a_device_stop_cameras

Definition at line 1262 of file k4a.hpp.

◆ stop_imu()

void k4a::device::stop_imu ( )
inlinenoexcept

Stops the K4A IMU

See also
k4a_device_stop_imu

Definition at line 1285 of file k4a.hpp.


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