HemiStereo SDK
The C++ Software Development Kit for the HemiStereo 3D sensing device.
osp::Device Class Reference

The Device class controls a single sensor device. More...

#include <osp/sdk/device.h>

Classes

struct  Info
 The Info struct holds some information about a device. More...
 

Public Types

enum  CaptureMode { CaptureMode::RAW, CaptureMode::RGBD }
 The capture modes. More...
 
enum  StereoConfiguration { Binocular, Trinocular }
 The stereo configuration modes.
 

Public Member Functions

virtual ~Device ()
 Destructor.
 
Status open (std::string uri)
 Open device. More...
 
void close ()
 close Device
 
Status login (const PasswordCredentials &credentials)
 Log in to device using password credentials. More...
 
void logout ()
 Log out from device.
 
bool setPasswordCredentials (const PasswordCredentials &credentials)
 Set the password credentials for accessing the device. More...
 
Info info ()
 Get device infomation. More...
 
bool reboot ()
 Reboot the device. More...
 
bool poweroff ()
 Shutdown the device. More...
 
Status start ()
 Start processing of current mode. More...
 
void stop ()
 Stop processing.
 
bool running ()
 Check device running. More...
 
std::unique_ptr< osp::FramegetFrame (std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
 Get a frame from the sensor. More...
 
float temperature (TemperatureSensor sensor)
 Get temperature of the CPU. More...
 
Camera getCameraModel (CameraModelType type)
 Request camera model params. More...
 
void setCameraModel (CameraModelType type, Camera model)
 Set camera model params. More...
 
void saveCurrentCameraModelsAsDefault ()
 Set current camera model params as default.
 
void setExtrinsic (Extrinsic extrinsic)
 Set extrinsic camera parameters. More...
 
Extrinsic getExtrinsic ()
 Request extrinsic camera parameters. More...
 
CaptureMode captureMode () const
 Get current capture mode. More...
 
Status setCaptureMode (CaptureMode mode)
 Set capture mode. More...
 
bool exposureAutoLock ()
 Check if auto exposure is locked. More...
 
Range< uint64_t > exposureRange ()
 Return exposure time range. More...
 
float exposureCompensation ()
 Return exposure compensation. More...
 
Range< float > gainRange ()
 Return analog gain range. More...
 
Range< float > digitalGainRange ()
 Return digital gain range. More...
 
float frameRate ()
 Return capture frame rate. More...
 
bool setExposureAutoLock (bool lock)
 Lock/Unlock current exposure time. More...
 
bool setExposureRange (Range< uint64_t > range)
 Set exposure time range. More...
 
bool setExposureCompensation (float ev)
 Set exposure compensation. More...
 
bool setGainRange (Range< float > range)
 Set analog gain range. More...
 
bool setDigitalGainRange (Range< float > range)
 Set digital gain range. More...
 
bool setFrameRate (float frameRate)
 Set capture frame rate. More...
 
StereoConfiguration stereoConfiguration ()
 Get current stereo configuration. More...
 
bool setStereoConfiguration (StereoConfiguration config)
 Set stereo configuration. More...
 
StereoMatchingMode stereoMatchingMode ()
 Get current stereo matching mode. More...
 
bool setStereoMatchingMode (StereoMatchingMode mode)
 Set stereo matching mode. More...
 
osp::Size< size_t > stereoMatchingResolution ()
 Get current stereo matching resolution. More...
 
bool setStereoMatchingResolution (const osp::Size< size_t > &resolution)
 Set stereo matching resolution. More...
 
StreamSettings streamSettings () const
 Get current settings for streaming between device and client. More...
 
void setStreamSettings (const StreamSettings &streamSettings)
 Set settings for streaming between device and client. More...
 
StereoMatchingParams stereoMatchingParams () const
 Get the current stereo matching parameters. More...
 
bool setStereoMatchingParams (const StereoMatchingParams &stereoMatchingParams)
 Set the parameters for stereo matching. More...
 

Detailed Description

The Device class controls a single sensor device.

Member Enumeration Documentation

◆ CaptureMode

The capture modes.

Enumerator
RAW 

Capture source images [0..2]

RGBD 

Capture undistorted image from camera 0 and corresponding distance map

Member Function Documentation

◆ captureMode()

CaptureMode osp::Device::captureMode ( ) const

Get current capture mode.

Returns
Current capture mode (RGBD/RAW)

◆ digitalGainRange()

Range<float> osp::Device::digitalGainRange ( )

Return digital gain range.

Returns
Range

◆ exposureAutoLock()

bool osp::Device::exposureAutoLock ( )

Check if auto exposure is locked.

Returns
true if locked, false otherwise

◆ exposureCompensation()

float osp::Device::exposureCompensation ( )

Return exposure compensation.

Returns
exposure compensation in ev

◆ exposureRange()

Range<uint64_t> osp::Device::exposureRange ( )

Return exposure time range.

Returns
Range in [ns]

◆ frameRate()

float osp::Device::frameRate ( )

Return capture frame rate.

Returns
frames per second

◆ gainRange()

Range<float> osp::Device::gainRange ( )

Return analog gain range.

Returns
Range

◆ getCameraModel()

Camera osp::Device::getCameraModel ( CameraModelType  type)

Request camera model params.

Parameters
typeType of the camera model to be returned
Returns
Camera model

◆ getExtrinsic()

Extrinsic osp::Device::getExtrinsic ( )

Request extrinsic camera parameters.

Returns
Extrinsic parameters

◆ getFrame()

std::unique_ptr<osp::Frame> osp::Device::getFrame ( std::chrono::milliseconds  timeout = std::chrono::milliseconds(0))

Get a frame from the sensor.

Parameters
timeoutTimeout for receiving the frame. If timeout expires, the return value will be empty.
Returns
true if running, false otherwise

◆ info()

Info osp::Device::info ( )

Get device infomation.

Returns
Info about connected device

◆ login()

Status osp::Device::login ( const PasswordCredentials credentials)

Log in to device using password credentials.

Parameters
credentialsPasswordCredentials object containing the password
Returns
Status

◆ open()

Status osp::Device::open ( std::string  uri)

Open device.

Parameters
uriDevice address
Returns
Status

◆ poweroff()

bool osp::Device::poweroff ( )

Shutdown the device.

Returns
true on success, false otherwise

◆ reboot()

bool osp::Device::reboot ( )

Reboot the device.

Returns
true on success, false otherwise

◆ running()

bool osp::Device::running ( )

Check device running.

Returns
true if running, false otherwise

◆ setCameraModel()

void osp::Device::setCameraModel ( CameraModelType  type,
Camera  model 
)

Set camera model params.

Parameters
typeType of the camera model to be set
model

◆ setCaptureMode()

Status osp::Device::setCaptureMode ( CaptureMode  mode)

Set capture mode.

Parameters
modeCapture mode
Returns
Status

◆ setDigitalGainRange()

bool osp::Device::setDigitalGainRange ( Range< float >  range)

Set digital gain range.

Parameters
rangedigital gain range [1...256]
Returns
true on success, false otherwise

◆ setExposureAutoLock()

bool osp::Device::setExposureAutoLock ( bool  lock)

Lock/Unlock current exposure time.

Parameters
lockIf true, the current exposure time will be locked, otherwise the auto controls can change it.
Returns
true on success, false otherwise

◆ setExposureCompensation()

bool osp::Device::setExposureCompensation ( float  ev)

Set exposure compensation.

Parameters
evexposure compensation in ev [-10...10]
Returns
true on success, false otherwise

◆ setExposureRange()

bool osp::Device::setExposureRange ( Range< uint64_t >  range)

Set exposure time range.

Parameters
rangeexposure time range in ns [30000...400000000]
Note
The maximum reachable exposure time depends on the selected frame rate: \( \textrm{max\_exp\_ns} = 1e9/\textrm{fps} \) Therefore you should reduce the frame rate to increase the maximum exposure time.
Returns
true on success, false otherwise

◆ setExtrinsic()

void osp::Device::setExtrinsic ( Extrinsic  extrinsic)

Set extrinsic camera parameters.

Parameters
extrinsicExtrinsic parameters

◆ setFrameRate()

bool osp::Device::setFrameRate ( float  frameRate)

Set capture frame rate.

Parameters
frameRateframes per second [1...30]
Returns
true on success, false otherwise

◆ setGainRange()

bool osp::Device::setGainRange ( Range< float >  range)

Set analog gain range.

Parameters
rangeanalog gain range [1...251]
Returns
true on success, false otherwise

◆ setPasswordCredentials()

bool osp::Device::setPasswordCredentials ( const PasswordCredentials credentials)

Set the password credentials for accessing the device.

Parameters
credentialsPasswordCredentials object containing the new password
Returns
true on success, false otherwise

◆ setStereoConfiguration()

bool osp::Device::setStereoConfiguration ( StereoConfiguration  config)

Set stereo configuration.

Parameters
configstereo configuration
Returns
true on success, false otherwise

◆ setStereoMatchingMode()

bool osp::Device::setStereoMatchingMode ( StereoMatchingMode  mode)

Set stereo matching mode.

Parameters
modestereo matching mode
Returns
true on success, false otherwise

◆ setStereoMatchingParams()

bool osp::Device::setStereoMatchingParams ( const StereoMatchingParams stereoMatchingParams)

Set the parameters for stereo matching.

Parameters
Stereomatching parameters

◆ setStereoMatchingResolution()

bool osp::Device::setStereoMatchingResolution ( const osp::Size< size_t > &  resolution)

Set stereo matching resolution.

Parameters
resolutionstereo matching resolution
Returns
true on success, false otherwise

◆ setStreamSettings()

void osp::Device::setStreamSettings ( const StreamSettings streamSettings)

Set settings for streaming between device and client.

Parameters
Streamsettings object

◆ start()

Status osp::Device::start ( )

Start processing of current mode.

Returns
Status

◆ stereoConfiguration()

StereoConfiguration osp::Device::stereoConfiguration ( )

Get current stereo configuration.

Returns
stereo configuration

◆ stereoMatchingMode()

StereoMatchingMode osp::Device::stereoMatchingMode ( )

Get current stereo matching mode.

Returns
stereo matching mode

◆ stereoMatchingParams()

StereoMatchingParams osp::Device::stereoMatchingParams ( ) const

Get the current stereo matching parameters.

Returns
Stereo matching parameters

◆ stereoMatchingResolution()

osp::Size<size_t> osp::Device::stereoMatchingResolution ( )

Get current stereo matching resolution.

Returns
stereo matching resolution

◆ streamSettings()

StreamSettings osp::Device::streamSettings ( ) const

Get current settings for streaming between device and client.

Returns
Stream settings object

◆ temperature()

float osp::Device::temperature ( TemperatureSensor  sensor)

Get temperature of the CPU.

Parameters
sensortemperature sensor
Returns
temperature in °C

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