Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added documentation
  • Loading branch information
Brent-A committed Oct 4, 2019
commit 310287a8ab3ac0b39ff400a791f7e2d7a1986dac
2 changes: 1 addition & 1 deletion include/k4arecord/playback.h
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ K4ARECORD_EXPORT void k4a_playback_data_block_release(k4a_playback_data_block_t
*
* \remarks
* The first call to k4a_playback_get_next_imu_sample() after k4a_playback_seek_timestamp() will return the first imu
* sample with a timestamp greter than or equal to the seek time.
* sample with a timestamp greater than or equal to the seek time.
*
* \remarks
* The first call to k4a_playback_get_previous_imu_sample() after k4a_playback_seek_timestamp() will return the first
Expand Down
1 change: 0 additions & 1 deletion src/csharp/Examples/Recording/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ static void Main(string[] args)
{
Console.WriteLine($"Tracks = {playback.TrackCount}");
Console.WriteLine($"RecordingLength = {playback.RecordingLength}");
Console.WriteLine($"LastTimestamp = {playback.LastTimestamp}");

for (int i = 0; i < playback.TrackCount; i++)
{
Expand Down
97 changes: 97 additions & 0 deletions src/csharp/Record/Exceptions/AzureKinectGetImuSampleException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace Microsoft.Azure.Kinect.Sensor.Record.Exceptions
{

/// <summary>
/// Represents errors that occur when reading an IMU sample.
/// </summary>
[Serializable]
public class AzureKinectGetImuSampleException : AzureKinectRecordException
{
/// <summary>
/// Initializes a new instance of the <see cref="AzureKinectGetImuSampleException"/> class.
/// </summary>
public AzureKinectGetImuSampleException()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="AzureKinectGetImuSampleException"/> class
/// with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public AzureKinectGetImuSampleException(string message)
: base(message)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="AzureKinectGetImuSampleException"/> class
/// with a specified error message and a reference to the inner exception that is the
/// cause of this exception.
/// </summary>
/// <param name="message">
/// The error message that explains the reason for the exception.
/// </param>
/// <param name="innerException">
/// The exception that is the cause of the current exception, or a null reference
/// (Nothing in Visual Basic) if no inner exception is specified.
/// </param>
public AzureKinectGetImuSampleException(string message, Exception innerException)
: base(message, innerException)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="AzureKinectGetImuSampleException"/> class
/// with serialized data.
/// </summary>
/// <param name="info">
/// The <see cref="SerializationInfo"/> that holds the serialized object data about the
/// exception being thrown.</param>
/// <param name="context">
/// The <see cref="StreamingContext"/>System.Runtime.Serialization.StreamingContext that
/// contains contextual information about the source or destination.
/// </param>
protected AzureKinectGetImuSampleException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="AzureKinectGetImuSampleException"/> class
/// with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
/// <param name="logMessages">
/// The log messages that happened during the function call that generated this error.
/// </param>
protected AzureKinectGetImuSampleException(string message, ICollection<LogMessage> logMessages)
: base(message, logMessages)
{
}

/// <summary>
/// Throws an <see cref="AzureKinectGetImuSampleException"/> if the result of the function
/// is not a success.
/// </summary>
/// <param name="function">The native function to call.</param>
/// <typeparam name="T">The type of result to expect from the function call.</typeparam>
internal static void ThrowIfNotSuccess<T>(Func<T> function)
where T : System.Enum
{
using (LoggingTracer tracer = new LoggingTracer())
{
T result = function();
if (!AzureKinectRecordException.IsSuccess(result))
{
throw new AzureKinectGetImuSampleException($"result = {result}", tracer.LogMessages);
}
}
}
}
}
Loading