Exemplo n.º 1
0
        /// <summary>Reads the previous IMU sample in the recording sequence.</summary>
        /// <param name="imuSample">If successful this contains IMU sample.</param>
        /// <returns>
        /// <see langword="true"/> - if a sample is returned,
        /// <see langword="false"/> - if the start of the recording is reached.
        /// All other failures will throw <see cref="PlaybackException"/> exception.
        /// </returns>
        /// <remarks><para>
        /// This method always returns the previous IMU sample in sequence before the most recently returned sample.
        /// </para><para>
        /// The first call to this method after <see cref="SeekTimestamp"/> will return the IMU sample
        /// in the recording closest to the seek time with timestamp less than the seek time.
        /// </para><para>
        /// If a call was made to <see cref="TryGetNextImuSample(out Sensor.ImuSample)"/> that returned <see langword="false"/> (which means EOF), the playback
        /// position is at the end of the stream and this method will return the last IMU sample in the recording.
        /// </para></remarks>
        /// <exception cref="ObjectDisposedException">This method cannot be called for disposed object.</exception>
        /// <exception cref="PlaybackException">Error during reading from recording. See logs for details.</exception>
        public bool TryGetPreviousImuSample(out Sensor.ImuSample imuSample)
        {
            var res = NativeApi.PlaybackGetPreviousImuSample(handle.ValueNotDisposed, out imuSample);

            if (res == NativeCallResults.StreamResult.Eof)
            {
                return(false);
            }
            if (res == NativeCallResults.StreamResult.Succeeded)
            {
                return(true);
            }
            throw new PlaybackException(FilePath);
        }
Exemplo n.º 2
0
 public void WriteImuSample(Sensor.ImuSample imuSample)
 => CheckResult(NativeApi.RecordWriteImuSample(handle.ValueNotDisposed, imuSample));
Exemplo n.º 3
0
 public static extern NativeCallResults.Result RecordWriteImuSample(NativeHandles.RecordHandle recordingHandle, Sensor.ImuSample imuSample);
Exemplo n.º 4
0
 public static extern NativeCallResults.StreamResult PlaybackGetPreviousImuSample(
     NativeHandles.PlaybackHandle playbackHandle,
     out Sensor.ImuSample imuSample);