Struct realsense_rust::sensor::Sensor[][src]

pub struct Sensor { /* fields omitted */ }
Expand description

Type for holding sensor-related data.

A sensor in librealsense2 corresponds to a physical component on the unit in some way, shape, or form. These may or may not correspond to multiple streams. e.g. an IMU on the device may correspond to accelerometer and gyroscope streams, or an IR camera sensor on the device may correspond to depth & video streams.

Sensors are constructed one of two ways:

  1. From the device’s sensor list
  2. By getting the sensor that corresponds to a given frame

Implementations

Get the parent device that this sensor corresponds to.

Returns the device that this sensor corresponds to iff that device is still connected and the sensor is still valid. Otherwise returns an error.

Errors

Returns DeviceConstructionError::CouldNotCreateDeviceFromSensor if the device cannot be obtained due to the physical device being disconnected or the internal sensor pointer becoming invalid.

Get sensor extension.

Get the value associated with the provided Rs2Option for the sensor.

Returns An f32 value corresponding to that option within the librealsense2 library, or None if the option is not supported.

Sets the value associated with the provided option for the sensor.

Returns null tuple if the option can be successfully set on the sensor, otherwise an error.

Errors

Returns OptionSetError::OptionNotSupported if the option is not supported on this sensor.

Returns OptionSetError::OptionIsReadOnly if the option is supported but cannot be set on this sensor.

Returns OptionSetError::CouldNotSetOption if the option is supported and not read-only, but could not be set for another reason (invalid value, internal exception, etc.).

Gets the range for a given option.

Returns some option range if the sensor supports the option, else None.

Predicate for determining if this sensor supports a given option

Returns true iff the option is supported by this sensor.

Predicate for determining if the provided option is immutable or not.

Returns true if the option is supported and can be mutated, otherwise false.

Get a list of stream profiles associated with this sensor

Returns a vector containing all the stream profiles associated with the sensor. The vector will have a length of zero if an error occurs while getting the stream profiles.

Gets the value associated with the provided camera info key from the sensor.

Returns some value corresponding to the camera info requested if this sensor supports that camera info, else None.

Predicate method for determining if the sensor supports a certain kind of camera info.

Returns true iff the sensor has a value associated with the camera_info key.

Trait Implementations

Executes the destructor for this type. Read more

Attempt to construct a Sensor from a non-null pointer to rs2_sensor.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.