Struct MotionFrame

Source
pub struct MotionFrame<Kind> { /* private fields */ }
Expand description

Holds the raw data pointer and derived data from an RS2 Motion Frame.

All fields in this struct are initialized during struct creation (via try_from). Everything called from here during runtime should be valid as long as the Frame is in scope… like normal Rust.

Implementations§

Source§

impl MotionFrame<Accel>

Source

pub fn acceleration(&self) -> &[f32; 3]

Returns a 3-item array representing the sensor motion recorded in the Accel frame.

Accelerations are reported as [x, y, z] values, and are in units of m/s^2

This function will return different data conventions entirely depending on the device used to create the measurement.

§Intel RealSense D435i
  • motion[0]: Positive x-axis points to the right.
  • motion[1]: Positive y-axis points down.
  • motion[2]: Positive z-axis points forward.
§Intel RealSense T265
  • motion[0]: Positive X direction is towards right imager.
  • motion[1]: Positive Y direction is upwards toward the top of the device.
  • motion[2]: Positive Z direction is inwards toward the back of the device.

Read more about the coordinate frames of RealSense motion in the RealSense docs

Source§

impl MotionFrame<Gyro>

Source

pub fn rotational_velocity(&self) -> &[f32; 3]

Returns a 3-item array representing the sensor motion recorded in the Gyro frame.

Gyroscope measurements are reported as [x, y, z] values, and are in units of radians/s

This function will return different data conventions entirely depending on the device used to create the measurement.

§Intel RealSense D435i
  • motion[0]: Positive x-axis points to the right.
  • motion[1]: Positive y-axis points down.
  • motion[2]: Positive z-axis points forward.
§Intel RealSense T265
  • motion[0]: Positive X direction is towards right imager.
  • motion[1]: Positive Y direction is upwards toward the top of the device.
  • motion[2]: Positive Z direction is inwards toward the back of the device.

Read more about the coordinate frames of RealSense motion in the RealSense docs

Trait Implementations§

Source§

impl<Kind: Debug> Debug for MotionFrame<Kind>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K> Drop for MotionFrame<K>

Source§

fn drop(&mut self)

Drop the raw pointer stored with this struct whenever it goes out of scope.

Source§

impl<K> FrameEx for MotionFrame<K>

Source§

fn stream_profile(&self) -> &StreamProfile

Get the stream profile associated with the frame.
Source§

fn sensor(&self) -> Result<Sensor>

Get the sensor associated with the frame.
Source§

fn timestamp(&self) -> f64

Get the frame timestamp.
Source§

fn timestamp_domain(&self) -> Rs2TimestampDomain

Get the RealSense timestamp domain for the current timestamp.
Source§

fn frame_number(&self) -> u64

Get the frame number.
Source§

fn metadata(&self, metadata_kind: Rs2FrameMetadata) -> Option<c_longlong>

Get frame metadata. Read more
Source§

fn supports_metadata(&self, metadata_kind: Rs2FrameMetadata) -> bool

Test whether the metadata arguemnt is supported by the frame.
Source§

unsafe fn get_owned_raw(self) -> NonNull<rs2_frame>

Get (and own) the underlying frame pointer for this frame. Read more
Source§

impl<K> TryFrom<NonNull<rs2_frame>> for MotionFrame<K>

Source§

fn try_from(frame_ptr: NonNull<rs2_frame>) -> Result<Self, Self::Error>

Attempt to create an Image frame of extension K from the raw rs2_frame. All members of the ImageFrame struct are validated and populated during this call.

§Errors

There are a number of errors that may occur if the data in the rs2_frame is not valid, all of type FrameConstructionError.

See FrameConstructionError documentation for more details.

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

impl<K> Send for MotionFrame<K>

Auto Trait Implementations§

§

impl<Kind> Freeze for MotionFrame<Kind>

§

impl<Kind> RefUnwindSafe for MotionFrame<Kind>
where Kind: RefUnwindSafe,

§

impl<Kind> !Sync for MotionFrame<Kind>

§

impl<Kind> Unpin for MotionFrame<Kind>
where Kind: Unpin,

§

impl<Kind> UnwindSafe for MotionFrame<Kind>
where Kind: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.