Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Sensor from frame #3933

Merged
merged 7 commits into from
May 16, 2019
Merged

Get Sensor from frame #3933

merged 7 commits into from
May 16, 2019

Conversation

doronhi
Copy link
Contributor

@doronhi doronhi commented May 8, 2019

Change interface: add function rs2_get_frame_sensor() for C interface, frame::get_sensor(), sensor_from_frame() for C++ interface and Frame::Sensor for C# interface.
This is used for obtaining the handle of the frame's sensor.
Add demo usage in rs-data-collect and cs-tutorial-2-capture.
Tracked on: DSO-12656

…, frame::get_sensor(), sensor_from_frame() for C++ interface and Frame::Sensor for C# interface.

Add demo usage in rs-data-collect and cs-tutorial-2-capture.
@dorodnic
Copy link
Contributor

dorodnic commented May 8, 2019

C:\Users\travis\build\IntelRealSense\librealsense\wrappers\csharp\cs-tutorial-2-capture\Window.xaml.cs(84,33): error CS0103: The name 'txtTimeStamp' does not exist in the current context 

@doronhi - I think you either forgot to git add Window.xaml or to exclude changes to Window.xaml.cs

@@ -124,7 +124,7 @@ void data_collector::save_data_to_file(const string& out_filename)

for (const auto& elem : data_collection)
{
csv << "\n\nStream Type,Index,F#,HW Timestamp (ms),Host Timestamp(ms)"
csv << "\n\nStream Type,Index,F#,HW Timestamp (ms),Host Timestamp(ms), SerialNumber"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The SerialNumber attribute to be moved into the header (Lines 121-123 : csv << get_profile_description(elem);)

Copy link
Collaborator

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

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

I asked for some changes to cover certain corner cases.
Also - pls check with SR300 and T265 live

{
// Require at least one device to be plugged in
rs2::context ctx;
if (make_context(SECTION_FROM_TEST_NAME, &ctx, "2.13.0"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Fix the minimal required version to be 2.22.0

for (auto i = 0; i < 5; i++)
{
rs2::frameset data = pipe.wait_for_frames(); // Wait for next set of frames from the camera
auto frame = data.get_color_frame();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will fail for sensors w/o color stream. Replace by iterating over all the received frames and making sure all refer to the same S.N

auto frame = data.get_color_frame();
std::string frame_serail_no = sensor_from_frame(frame)->get_info(RS2_CAMERA_INFO_SERIAL_NUMBER);
REQUIRE(dev_serial_no == frame_serail_no);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Put a TODO placeholder to check some actual sensor's attributes - > e.g comparing the profile

{
rs2::frameset data = pipe.wait_for_frames(); // Wait for next set of frames from the camera
auto frame = data.get_color_frame();
std::string frame_serail_no = sensor_from_frame(frame)->get_info(RS2_CAMERA_INFO_SERIAL_NUMBER);
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo - dev_serial_no

Change-Id: Id44b561a8b519dfa207c21824de97eb713bad3af
@ev-mp ev-mp merged commit 02f29a4 into IntelRealSense:development May 16, 2019
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