Skip to content

Get Sensor from frame - #3933

Merged
ev-mp merged 7 commits into
realsenseai:developmentfrom
doronhi:get_sensor
May 16, 2019
Merged

Get Sensor from frame#3933
ev-mp merged 7 commits into
realsenseai:developmentfrom
doronhi:get_sensor

Conversation

@doronhi

@doronhi doronhi commented May 8, 2019

Copy link
Copy Markdown
Contributor

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

dorodnic commented May 8, 2019

Copy link
Copy Markdown
Contributor
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

Comment thread tools/data-collect/rs-data-collect.cpp Outdated
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
Copy Markdown
Contributor

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);)

@ev-mp ev-mp left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread unit-tests/unit-tests-live.cpp Outdated
{
// 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
Copy Markdown
Contributor

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

Comment thread unit-tests/unit-tests-live.cpp Outdated
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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

Comment thread unit-tests/unit-tests-live.cpp Outdated
{
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
Copy Markdown
Contributor

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 realsenseai: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