Skip to content

C# example for pose stream (for T265 device) - #8860

Merged
maloel merged 3 commits into
realsenseai:developmentfrom
SergeySPF:c#-wrapper
Jun 6, 2021
Merged

maloel merged 3 commits into
realsenseai:developmentfrom
SergeySPF:c#-wrapper

Conversation

@SergeySPF

Copy link
Copy Markdown
Contributor

No description provided.

@SergeySPF SergeySPF closed this Apr 20, 2021
@SergeySPF SergeySPF reopened this Apr 20, 2021
@maloel
maloel requested a review from Nir-Az May 25, 2021 08:08
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Intel(R) RealSense(TM) SDK C# Wrapper Tutorial-1")]

@Nir-Az Nir-Az May 25, 2021 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tutorial-5

[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Intel(R) Corporation")]
[assembly: AssemblyProduct("Intel(R) RealSense(TM) SDK C# Wrapper")]
[assembly: AssemblyCopyright("Copyright ๏ฟฝ 2017, Intel Corporation. All rights reserved")]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2021

Pose data = frame.As<PoseFrame>().PoseData;

// Print the x, y, z values of the translation, relative to initial position
Console.WriteLine("Device Position: {0} {1} {2} (meters)", data.translation.x.ToString("N3"), data.translation.y.ToString("N3"), data.translation.z.ToString("N3"));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not override the printed line same as in C++ example?
"\r"

Console.WriteLine("Device Position: {0} {1} {2} (meters)", data.translation.x.ToString("N3"), data.translation.y.ToString("N3"), data.translation.z.ToString("N3"));
}

Thread.Sleep(100);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried running this example,
it keeps exit on an exception from "wait_for_frames()",
The exception is frame did not arrived in 5000 [ms].
It happens for me after ~30 seconds

Do you see it?

It does not happen on the C++ example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed C# example

@Nir-Az Nir-Az left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks goods.

@maloel
maloel merged commit b79b5ea into realsenseai:development Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants