Class: Sensor

Sensor()

A sensor device in a RealSense camera

Constructor

new Sensor()

Construct a Sensor object, representing a RealSense camera subdevice By default, native resources associated with a Sensor object are freed automatically during cleanup.
Source:

Members

isValid

Check if everything is OK, e.g. if the device object is connected to underlying hardware
Source:

Methods

close() → {undefined}

Stops any streaming and close subdevice.
Source:
Returns:
No return value
Type
undefined

destroy() → {undefined}

Delete the resource for accessing the subdevice. The device would not be accessable from this object after the operation.
Source:
Returns:
No return value
Type
undefined

getCameraInfo(info) → {String|undefined}

Get camera information of the sensor
Parameters:
Name Type Description
info String | Integer the camera_info type, see camera_info for available values
Source:
Returns:
Type
String | undefined

getStreamProfiles() → {Array.<StreamProfile>}

Get a list of stream profiles that given subdevice can provide. The returned profiles should be destroyed by calling its destroy() method.
Source:
Returns:
all of the supported stream profiles See StreamProfile
Type
Array.<StreamProfile>

open(streamProfile, profileArray)

Open subdevice for exclusive access, by committing to a configuration. There are 2 acceptable forms of syntax:

 Syntax 1. open(streamProfile)
 Syntax 2. open(profileArray)
Syntax 2 is for opening multiple profiles in one function call and should be used for interdependent streams, such as depth and infrared, that have to be configured together.
Parameters:
Name Type Description
streamProfile StreamProfile configuration commited by the device
profileArray Array.<StreamProfile> configurations array commited by the device
Source:
See:

setNotificationsCallback(callback) → {undefined}

register notifications callback
Parameters:
Name Type Description
callback NotificationCallback The user-provied notifications callback
Source:
See:
Returns:
Type
undefined

start(callback, syncer,)

Start passing frames into user provided callback There are 2 acceptable syntax:

 Syntax 1. start(callback)
 Syntax 2. start(Syncer)
Parameters:
Name Type Description
callback FrameCallback
syncer, Syncer the syncer to synchronize frames
Source:
Example

Simply do logging when a frame is captured

 sensor.start((frame) => {
   console.log(frame.timestamp, frame.frameNumber, frame.data);
 });

stop() → {undefined}

stop streaming
Source:
Returns:
No return value
Type
undefined

supportsCameraInfo(info) → {Boolean|undefined}

Check if specific camera info is supported
Parameters:
Name Type Description
info String | Integer info type to query. See camera_info for available values
Source:
See:
Returns:
Returns undefined if an invalid info type was specified.
Type
Boolean | undefined

Events

notification

Parameters:
Name Type Description
evt NotificationEventObject
Properties
Name Type Description
descr String See NotificationEventObject for details
timestamp Float See NotificationEventObject for details
severity String See NotificationEventObject for details
category String See NotificationEventObject for details
serializedData String See NotificationEventObject for details
Source:
See: